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, 9 months
Localization in DSL
by Shigeaki Wakizaka
Hello.
I'd like to use Japanese in DSL.
Is it possible?
Do you have a plan to do the localize-thing with DSL and
brand-new BRMS?
Thanks in advance
Shige
15 years, 9 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, 2 months
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, 6 months
Accessing maps (hashmaps) keys and values in rules
by Ryan, Dennis (Dennis)
We are using Maps (HashMaps) in our rules and the only way we have found
to access keys and values in the Map in the "when" clauses is thru use
on eval() which I know is a big no-no by rules purists. Is there a
better way, maybe some shorthand I'm not familiar with to deal with Maps
in the when clause?
Thanks,
Dennis
16 years, 9 months
How to write constraint about a Map inside a Map?
by Felipe Piccolini
Suppouse I have a Map attribute and one of the values is another
Map...how can I check a member of the inner Map?
class MyFact{
Map map;
public MyFact(){
this.map = new HashMap();
}
....setter and getter...
}
-- test --
MyFact myFact = new MyFact();
Map innerMap = new HashMap();
innerMap.put("innerKey", new String("InnerValue"));
Map map = new HashMap();
map.put("mapKey", innerMap);
myFact.setMap(map);
.... set the RuleBase and insert myFact as a fact for the
WorkingMemory...
-------
Now... how should I write the rule to check the innerKey ??
rule "test InnerMap"
when
$mf: MyFact( map['mapKey']['innerKey'] ==
"InnerValue" ) // doesnt work...
....
$mf: MyFact( map['mapKey'].this['innerKey'] ==
"InnerValue" ) // doesnt work...
$mf: MyFact( map['mapKey'].['innerKey'] == "InnerValue" ) //
doesnt work...
$mf: MyFact( $innerMap: map['mapKey'], $innerMap['innerKey'] ==
"InnerValue" ) // doesnt work...
$mf: MyFact( $innerMap: map['mapKey'] -> ($innerMap
['innerKey'] == "InnerValue" )) // doesnt work...
Thanks.
Felipe Piccolini M.
felipe.piccolini(a)bluesoft.cl
16 years, 11 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, 1 month
Rule compilation errors under heavy load
by Dean Jones
Hello folks,
I'm experiencing some odd behaviour from Drools (or maybe the Eclipse
compiler) when load-testing my application, and wondered if anyone
else had experienced the same issue. I have a web service which, for
every request, loads in rules from the database, creates a
org.drools.lang.descr.PackageDescr and then uses this to create a
org.drools.rule.Package. The code is something like:
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
PackageBuilder builder = new PackageBuilder(conf);
PackageDescr packageDescr = new PackageDescr("MyRulebaseName");
populatePackageDescr(packageDescr);
builder.addPackage(packageDescr);
Package _package = builder.getPackage();
return _package;
This code gets run every request. The populatePackageDescr() method
adds imports, globals, functions and rules to the PackageDescr. My
load-test just repeatedly calls the same rulebase, so
populatePackageDescr() will be doing exactly the same thing for each
request. Occasionally (normally once or twice per 100 requests) I get
a rule compilation error (the exact error varies from request to
request) whereas most of the time the same rule compiles fine. This
makes me suspect a thread-safety issue in either the PackageBuilder or
the compiler (I'm using the eclipse compiler).
Initially, I suspected a problem in my
populatePackageDescr(packageDescr) method, but I think I've ruled this
out. There is nothing stateful in this method, and I've tried dumping
the XML representation of the packageDescr immediately after
populating it; it looks fine to me and is exactly the same whether
compilation succeeds or and fails.
Has anyone done this kind of thing successfully under a heavy load?
Thanks,
Dean.
17 years, 4 months
Another problem
by Natraj Gudla
Hi, I am using Drools 3.0.6, and facing a peculiar problem.
My rule:
*
rule* "Calculate Business profit,1"*
**salience* 1000
*when
**EMIAgainstProperty ( BP1 : refBP1 )
*emi : EMIAgainstProperty ( businessProfit2 > BP1 )
*then* *
*System.out.println(" BP "+(emi.getBusinessProfit1
()+emi.getBusinessProfit2())/2);*
*emi.setBusinessProfit((emi.getBusinessProfit1
()+emi.getBusinessProfit2())/2);*
**end*
**
The above line in bold inside the condition part seem to create problem for
rule evaluation. WHen i have this, the rule does not show up in the Agenda
view, hence i dont see the console print in the action part. As soon as i
remove this line and replace BP1 with 1.5 in the second line, i see the rule
being fired.
As far as i understand, I am doing a declaration to set refBP1 an object
attribute to BP1, which i later use.What is that i am missing here? My fact
has proper getter and setters for refBP1 attribute.
Thanks
Natraj
17 years, 4 months