query
by prateek.katiyar@wipro.com
Hi
In one of my program i am getting the following erroe message
Exception in thread "main" org.drools.compiler.PackageBuilder$MissingPackageNameException: Missing package name for rule package.
at org.drools.compiler.PackageBuilder.validatePackageName(PackageBuilder.java:294)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:226)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:160)
at org.drools.compiler.RuleBaseLoader.loadFromReader(RuleBaseLoader.java:38)
at stockoffer.BusinessLayer.loadRules(BusinessLayer.java:47)
at stockoffer.BusinessLayer.evaluateStockPurchase(BusinessLayer.java:60)
at stockoffer.Tempclass.main(Tempclass.java:22)
So please send me the solution for this error.
Thanks.
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
16 years, 7 months
architectural question about saving the static data
by Waruzjan Shahbazian
Hi,
I have a question regarding the way of saving the values of some static
data, wich will be used by the drools engine to calculate the price for some
product. I will explain it with the following example:
I have an website where the user can fill a form where he can choose between
different kind of tables, and other specifications regarding to the table.
Lets say we have 3 sort of tables in our store and the user can choose
between them:
1) 80x40
2) 100x60
3) 90x50
For each of these types we know, it's a static information wich will not be
calculated on basis of another value, what the price of it is and how long
it will take to produce it. So lets say that we have the following options:
Option1:
Type:80x40
Price:$40
Duration:5 hours
Option2:
Type:100x60
Price:$60
Duration:8 hours
Option3:
Type:90x50
Price:$50
Duration:7 hours
The question is, whats the best way to save the rest of the data ( so the
price and the duration, since the user can only chooses the type) into the
application, so it will be easy to extand the options in the future and it
will be easy to change it by the administrator?
I can think of 3 different ways:
1) Make 3 rules ( in drl ), each for every option and check in the LFS wich
option it's chosen and use the setter for the Price and Duration variabele
of the object Table.
2) Create in the java code 3 different instances of table which will have 3
different values for the variabeles, so instance1 will have Type="90x50",
Price="$50", Duration="7" and instance2 will have the values of option2 and
instance3 the values of option3. Then the java application can check what
the user has choosen and insert that into the working memory. So the .drl
file doesn't has set those variabeles of the object, so it can use them in
the rest of the rules.So it doesn't has to know anything about these values.
3) Make a spreadsheet with these 3 differen type tables which will represent
the rules of the value of the Price and Duration on basis of the chosen
Type. So if the application starts, it will compile the spreadsheet so it
can have the latest values for every type of table. So it can use that in
combination with the rest of the rules wich are defined in the .drl file.
These of course with a look in the future extanding of the options, so wich
will be the best practice way to implement. Also its important the the
administrator will be able to easaly change the values of these options.
Will it be easier to add a rule, or will it be easier to add an instance of
the type table on basis of the chosen type in the java code.
If someone has a suggestion about another way of doing these, I will be
glade to hear too!
Thanks,
Waruzjan
16 years, 7 months
serialization size: a switch in Drools 2.5 ?
by writetochristoph
Hi!
I have a server which uses a Drools RuleBase to evaluate about 2500 rules.
The server stores the Drools RuleBase in a database as a serialized java
object. I also need to transfer the Drools RuleBase to clients for offline
usage. For the server, I need fast loading of the Drools RuleBase. For
transfer to the client, I need the serialized Drool RuleBase to be as small
as possible. You see, there is a trade-off here which I have to cope with.
I have to use Drools 2.x i.e. Drools 2.1 or Drools 2.5 repectively. I have
to do so because the rules have been written for Drools 2.x. And my company
doesn't want to migrate the rules because there are about 2500 ones.
We used to use Drools 2.1. Serialized Drools RuleBases of Drools 2.1 are
very small because there're large parts which aren't serialized because
they're transient. The size of the serialized Drools RuleBase of Drools 2.1
is a few hundred kB. Therefore transfering the Drools RuleBase to a client
is feasible. But since the transient parts haven't been saved, they'll have
to be recreated after the Drools RuleBase is deserialized. And this takes
time - too much time (a couple of minutes!). This will especially be a
problem if you often change the active Drools RuleBase. (And sadly, we'll
have to do that in the future.)
So we decided to try Drools 2.5. In Drools 2.5 the evaluation tree for the
rules is no longer transient, it will stored in the database if the Drools
RuleBase is serialized. Hence, it won't have to be recreated after
deserialization because it will already be there. Therefore I'm able to load
and reuse a serialized Drools RuleBase in no time. But since more
information is stored, the serialized object of a Drools RuleBase has grown.
And it has grown a lot: The size of a serialized Drools RuleBase in Drools
2.5 is about 10MB (with using GZIP for compression!). This is much to much
information to transfer to a client!
What I'd need is a switch which will allow to switch between serialization
to a small serialized object (which may take a long time to load like in
Drools 2.1) and serialization to a big serialized object (which can be
loaded extremely fast but which may be to big to be transferred anywhere).
By doing so, I could tranfer the small serialized Drools RuleBase to a
client. And then the client can create the "big version" when he stores the
Drools RuleBase for the first time. In this way, I wouldn't have to transfer
much data and the problem with slow loading of the Drools RuleBase would
occur only once.
Is there a switch in Drools 2.5 to decide whether ot not the evaluation tree
is stored in the serialized object?
By the way, transferring the rules to the client and letting the client
build the Drools RuleBase itself is definitely not feasible. Building the
Drools RuleBase takes too much memory and too much time. The clients which
are going to run the offline version will mostly be laptops with limited
processing power.
Yours sincerely,
Christoph
--
View this message in context: http://www.nabble.com/serialization-size%3A-a-switch-in-Drools-2.5---tf45...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
database and Drools
by marimuthu.balasubramanian@wipro.com
Hi,
My application require to implement business rules with SQL query. How
can i implement business rule wjhich has SQL query?
Is their any option to integrate with hibernate?
Regards
Marimuthu
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
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
16 years, 7 months
assertion of object
by Raffaele Viola
Hi all,
how can I assert an object to the rules engine and be sure that for each
rule fired it use s a new istance of my object??
Thanks
Raffo
16 years, 7 months
Unable to build expression for 'consequence'
by kissro@lidp.com
Using the BRMS Business Rule Asset screen, I've created a new rule:
rule "Premium Rule"
dialect "mvel"
when
Policy( premium > "50.00" && <= "500.00" )
then
Policy fact0 = new Policy();
fact0.setStatus( 13 );
insertLogical( fact0 );
end
When I try to validate or build a package for deployment, I get:
Unable to build expression for 'consequence'
Policy fact0 = new Policy(); fact0.setStatus( 13 ); insertLogical( fact0 )
Does anyone know what's wrong with my rule or why I getting the error?
Thanks,
Rod
16 years, 7 months
Execute only on most current instance
by Brian Enderle
I have a rule that I only want to execute on the most current instance, where
init_dt is closest to today. Anyone know of a way to do this?
For instance, I have a few objects with init_dt of Jan-12-2005, Feb-06-2005
and April-01-2005. I only want to execute the rule on the instance which has
an init_dt of April-01-2005. Every object will have a valid init_dt in the
past (before today).
Thanks in advance,
Brian Enderle
16 years, 7 months
drools cannot be resolved
by Raffaele Viola
Hi all,
why if I set in the condition
eval(statoNodo.variabiliInOR(drools.getRule().getName()))
I get the error
drools cannot be resolved??
Thanks
Raffo
16 years, 7 months
capturing matches from regular expressions?
by Godmar Back
Hi,
is there a syntax to capture the match(es) from a regular expression
inside a "matches" condition in a when statement, similar to
Matcher.group(int) in Java's regexps or $1, $2, $3 in Perl work?
Thanks.
- Godmar
16 years, 7 months
BRMS Problem on Tomcat
by ekke
I'm just testing the BRMS
environment:
Eclipse 3.3
java.version=1.5.0_07
Mac OSX 10.4.10
installed servers in Eclipse WTP:
Tomcat 5.5.20
Tomcat 6.0.14
JBoss-4.2.1.GA
Imported the BMRS.war 4.0.1 into eclipse
Run on JBoss 4.2.1: no problems
Run on Tomcat 5.5.20 or 6.0.14 causes:
java.lang.NoClassDefFoundError: javax/faces/context/FacesContext
at org.jboss.seam.util.Resources.getResourceAsStream(Resources.java:21)
at
org.jboss.seam.init.Initialization.getReplacements(Initialization.java:140)
at
org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:126)
at org.jboss.seam.init.Initialization.<init>(Initialization.java:81)
at
org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:589)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
its no real problem yet, because I can do my tests using jBoss,
but it should be possible to run BRMS on Tomcat,
what could be wrong ?
ekke
--
View this message in context: http://www.nabble.com/BRMS-Problem-on-Tomcat-tf4497750.html#a12827066
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months