Working with collections
by Marcin Krol
Hello everyone,
I'm a beginner in Drools, so please account for that. :-)
How do I use memberOf operator when working with collections? Depending
on a day of week, I want to check if a day is a working day or weekend day.
I tried this:
package com.sample
dialect "mvel"
import com.sample.ThermostatTimeData;
import com.sample.Thermostat.WorkDay;
import com.sample.Thermostat.WorkDays;
rule "Rule 1"
when
$wd : WorkDays()
$ttd : ThermostatTimeData( day memberOf $wd.daylist )
//$ttd: ThermostatTimeData ( day == "Monday" || day == "Tuesday" || day
== "Wednesday" || day == "Thursday" || day == "Friday" )
then
insert( new WorkDay() );
System.out.println("inserting new workday");
end
with this in my Thermostat class:
public static class WorkDays {
private String[] dl = {"Monday", "Tuesday", "Wednesday", "Thursday",
"Friday"};
public WorkDays() {
}
public String[] getDaylist() {
return this.dl;
}
}
Now the above rule works fine when I select days using the regular fact
field selection in Drools:
$ttd: ThermostatTimeData ( day == "Monday" || day == "Tuesday" || day ==
"Wednesday" || day == "Thursday" || day == "Friday"
However, when I try to access WorkDays.dl or WorkDays.daylist(), the
rule doesn't fire (the program output is empty).
Regards,
MK
17 years, 10 months
to have some hierarchical control over rules in the same package
by hongyu lu
Hi,
I have a use case where I would like to group rules by package(each package would be one experiment in my app). There are a couple attributes at the package level, which will enable/disable all rules of that package(not being fired). What would be the best way to achieve this? I am new to Drools and it looks like the rule definition is kinda flat. I would like to avoid defining package level conditions within each rule.
thanks
Jeff
17 years, 10 months
RE: Category Tree Display Overlaps the box area in Guvnor in Internet Explorer
by Vikrant Yagnick
Actually, this is pretty much a blocker bug for Internet Explorer as I am unable to add a name to a new rule, if my category is in the lower half of the list.
Anybody, have any ideas on how this can be worked around or solved?
From: Vikrant Yagnick
Sent: Wednesday, October 01, 2008 1:00 PM
To: 'Rules Users List'
Subject: Category Tree Display Overlaps the box area in Guvnor in Internet Explorer
Hi All,
I am not sure, if this has been raised before(could not find an existing JIRA) for it.
The display of categories in IE 7 seems to overlap the box area(See attached).
This works correctly with Safari and FireFox. Sounds like a problem with Z-Indexes in IE.
Cheers,
Vikrant
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 years, 10 months
Category Tree Display Overlaps the box area in Guvnor in Internet Explorer
by Vikrant Yagnick
Hi All,
I am not sure, if this has been raised before(could not find an existing JIRA) for it.
The display of categories in IE 7 seems to overlap the box area(See attached).
This works correctly with Safari and FireFox. Sounds like a problem with Z-Indexes in IE.
Cheers,
Vikrant
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 years, 10 months