Problem using Package Builder
by Mehak
Hi
I am using Package Builder for making rule base in my web application. The
code is:
public class DroolSetUp implements ResourceLoaderAware{
private static RuleBase ruleBase;
private Resource drlFiles;
public void setResourceLoader(ResourceLoader arg0) {
try {
ruleBase = RuleBaseFactory.newRuleBase();
File file = drlFiles.getFile();
FileInputStream fileStream = new FileInputStream(file);
Reader source = new InputStreamReader(fileStream );
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromXml(source);
System.out.println(builder.toString());
Package pkg = builder.getPackage();
ruleBase.addPackage(pkg );
}
catch(Exception e)
{
}
}
}
But there is a problem that the method returns after the statement
PackageBuilder builder = new PackageBuilder();
Please le me know what the problem can be.
Waiting for an early response
Thanks
--
View this message in context: http://www.nabble.com/Problem-using-Package-Builder-tp15891216p15891216.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 8 months
Unable to access setter fields of fact in RHS using guided rule editor
by David Godfrey
Using Drools 4-0-4, I am trying to setup a very simple prototype system to
use either of the Guided Rule Editors in Eclipse or BRMS.
I have created a simple bean class to act as my Fact, and can see this when
setting up the LHS, e.g. I can create a condition that a field in my fact
must equal "X".
I then want to set a different field to a new value as the RHS, but in the
"Then" section of the guided rule editor, when I try to choose a value from
the drop down list option "set the values of a field on", I do not see my
fact, hence I can't access it to set the value I want.
I get the same behaviour using both Eclipse and BRMS guided rule editors,
e.g. my Fact bean is accessible in the LHS but not the RHS?
I've read and re-read the user guides and documentation, and tried using the
supplied example Drools projects as the basis of some guided rules, but I
always get the same result.
Any suggestions much appreciated.
16 years, 8 months
RE: Can I use drools to solve my problem?
by Anstis, Michael (M.)
In my opinion it will be much easier if you insert individual Orders and
Products
Here's a hurriedly put together example to help you think in terms of rules
(I have no experience of your problem domain so this might be laughably
wrong):-
Global ArrayList branch1;
rule "Delievery split - Branch 1"
when
$p : Product( $b : branch = "Branch 1" )
$o : Order( products contains $p )
then
OrderDelievery od = new OrderDelievery($o, $p, $b);
insert(od);
end
rule "Consolidate delieveries"
when
$od : OrderDelievery( branch = "Branch 1" )
then
branch1.add($od);
end
Or you could just retrieve the OrderDelievery objects from WM at the end.
Drools can definately achieve what you want. If you can solve the problem
with hard-coded rules you can solve it with Drools.
Good luck,
Mike
_____
From: KinG CD [mailto:kingcd8@hotmail.com]
Sent: 07 March 2008 17:08
To: Anstis, Michael (M.)
Subject: RE: Can I use drools to solve my problem?
alright. I was trying not to boder you.
My companie is developing a billing software for a e-commerce site. So we
have an Order and we have to transform it into deliveries. So each Order has
many products and I have to filter it and define X deliveries(i call it
'delivery split'). There are filters like disponibility(in how many days it
will be ok), brach(in what city is the product), type(if it is a kit,
ticket...),...
I tried many ways and i really think that drools isn't the best tool for my
problem. The point is that mi boos dont want to use the hard code for define
the deliveries. He wats drolls to do everything. So i tried inserting the
the order in the WM, and using 'rom' chained with 'collect' i could iterate
and set a list based in some rules, but how can i create lists based on the
branch. how can i group in Y different lists the Z different products i
have.
I also inserted each product manually and tried to manipulate each one. But
the point is that the rules should be interdependent but i was not able to
do it.
the resume is that i want to take the order and set N deliveries based on
interdependent rules. i would like to do almost everything with drools not
using the hard code.
Sorry for the English, thanj you very much for the help, i'm a little lost.
ect: FW: Can I use drools to solve my problem?
> Date: Fri, 7 Mar 2008 15:45:22 +0000
> From: manstis1(a)ford.com
> To: rules-users(a)lists.jboss.org
> CC: kingcd8(a)hotmail.com
>
> Posted to forum for a wider audience.
>
> I think you will need to be more specific with your use case.
>
> With kind regards,
>
> Mike
>
> -----Original Message-----
> From: kingcd8(a)hotmail.com [mailto:kingcd8@hotmail.com]
> Sent: 07 March 2008 15:35
> To: Anstis, Michael (M.)
> Subject: Can I use drools to solve my problem?
>
> I have a list of products and want to divide this list in other lists
> applying the rules, than i want to apply the same rules to this new lists.
> So I keep dividing them until no rules are applicable anymore.
>
> Thank you
_____
Encontre o que você procura com mais eficiência! Instale já a Barra de
Ferramentas com Windows Desktop Search! É GRÁTIS!
<http://www.windowslive.com.br>
16 years, 8 months
Setting date during execution of rules.
by Nimesh Muley
Hi,
Is there a way to set the date while executing the rules? The effective dates would be checked against this date instead of today's date. By default the effective dates would be checked with System date. But in some cases we would need to execute the rules in a 'back-dated' mode.
Use case.
Let's say in insurance industry there are commission calculation rules for an agent. On these rules the effective dates are appropriate (as per their needs). Now when an agent is promoted and his/her promotion date is couple of months back then we would want to calculate the commission once again with the date as 2 months back.
The nearest I could see is TimeMachine, as this is being used during execution of rules. Although I could not find a way to set the TimeMachine in release 4.0.4.
Has anyone tried something like this before?
Regards,
- Nimesh
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
MASTEK LTD.
Making a valuable difference
Mastek 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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 years, 8 months
Hire a programmer from JBoss Rules
by Arjun Dhar
Hey guys,
I reference of mine is interested in hiring a JBoss Rules resource for a new
venture. To ensure the person is good I'm not throwing this to the general
public; is it possible to contact you guys?
lemme know.
16 years, 8 months
can't install via eclipse update manager
by howard goldberg
eclipse 3.3.1.1 or 3.3.0
Attempt to install 4.04
Got a "feature not found" error using eclipse update manager for both remote
site and archive file. Didn't see any reports in the archives or JIRA. No
problem with manual install.
Thanks,
Howard
16 years, 8 months
Maven compilation mojo?
by Eric Miles
Is there a Maven Drools compilation mojo, provided either by the Drools
team or some open source project? If not, I have one that I'd be
willing to submit. I think it's pretty slick and would only require a
few tweaks to truly make it useful (hard coded to currently use XStream
serialization).
16 years, 8 months
Ant compiler task?
by Eric Miles
I see numerous references to the Ant task in the documentation but see
no documentation on how to use it. Where can I find some? Google
turned up nothing...
16 years, 8 months