working with version 5.0
by Oli Blub
hello,
i work with drools guvnor and expert version 5.0.0.
I hat the problem with stateless session in comibnation with rule flow
componentet.
So i use stateful session and build a second delete ruleflow to delete all
objects in memory. Is there a better solution?
I installed v. 5.2 but the import of the repository from 5.0 caused many
compilation problems. Is there a workaround?
I'm interested in working with GWT and fix some little bugs of Guvnor V 5.0.
Is there a good guidence to get started?
13 years, 3 months
What would you call a Fact that is only evaluated once?
by Mark Proctor
What would you call a fact that is inserted once and the conflict set
computed (the rules that can fire). The fact is then retracted so no
more matches can take place, but the conflict set itself is allowed to
fire (assuming their other facts remain true).
I think this is quite a common use case and most users will handle this
via a lower salience and retracting the fact manually, but I think it's
useful enough to build in as a keyword on type declaration. We just need
a name for it :)
Mark
13 years, 3 months
Error in Guvnor with Enumerations (5.1.1)
by John Peterson
Hi,
I'm trying to utilize a "load method" for Guvnor, but I can't seem to get it working. His is my DataHelper class (modeling it off the documentation):
package com.enumerations;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class DataHelper {
public List<String> getQuestionNumberList(){
ArrayList returnList = new ArrayList();
Iterator it = com.enumerations.DroolsTest.questionList.iterator();
while (it.hasNext()){
QuestionAndAnswer qAndA = (QuestionAndAnswer)it.next();
if (!returnList.contains(qAndA.getQuestionNumber())){
returnList.add((String)qAndA.getQuestionNumber());
}
}
return (List<String>)returnList;
}
}
I've placed this (both as a .jar and .class file) in my JBoss installation under \jboss-4.2.3.GA\server\default\deploy\drools-guvnor.war\WEB-INF\classes\com\enumerations.
Using this syntax as an enumeration in Guvnor:
'QuestionAndAnswer.questionNumber' : (new com.enumerations.DataHelper()).getQuestionNumberList()
I get the following errors:
[Enumerations] Unable to load enumeration data.
[Enumerations] [Error: failed to access property: getQuestionNumberList(): [Error: unable to invoke method: getQuestionNumberList] [Near : {... Unknown ....}] ^[Line: 1, Column: 0]][Near : {... r()).getQuestionNumberList() ....}] ^ [Line: 1, Column: 0]
[Enumerations] Error type: org.mvel2.PropertyAccessException
I am using Drools 5.1.1. Does anyone have any suggestions on what to do to correct this error?
jp
13 years, 3 months
Collect with same value
by wendy
Hi,
I'm trying to write the following rule but am having some trouble.
We have a object say Shape and which has attributes size and color. I
want to get a list of all shapes with the same color that have size > 5.
How can I make sure the color is the same for all objects in the collect
without having different rules for 'red', 'green'...?
Thank you,
Wendy
--
View this message in context: http://drools.46999.n3.nabble.com/Collect-with-same-value-tp3242904p32429...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
New Fact Role
by Isaac Pereira
Hi,
I would like to know if there's a way to add new role types without change
the drools core? The reason is to build a module that handles situations
(state of affairs) to support context aware systems. Situation would be the
new role and then adds all specific handling for this type of fact.
Thanks,
Isaac Pereira
13 years, 3 months
Drools Queries with relation to the LHS and RHS syntax of the rule
by Dibya
I have the below two requirement for Drools implementation.
1. To use a java method(with single argument) of my application class in the
'LHS' of the rule .
2. To pass the object set in 'RHS' of the rule back to my application.
Is it possible to implement point 1 and point 2 as below ?
Example :
Application class is defined as :
//Class for getting various types from my application
package application.custom;
public class Project
{
public string getStringValue(String name) {
<Logic of the application>
return ;
}
}
//Class 2 for setting the rule result
package application.customresults;
public class ProjectResults
{
public void setResult(String name) {
<Logic of the application>
}}
===========================================================================
Drl file like :
package application.rules
#I shall set the object 'projRes' in my appl using setGlobal
global application.customresults.ProjectResults projRes ;
import application.custom.Project;
rule "project-1.option1"
when
$proj : application.custom.Project();
eval ($proj.getStringValue("Drools") .equals ("ABC")) # Logic specific to my
application
then
#Requirement is to set and make use of the object 'projRes' in my
application
modify (projRes) {projRes.setResult("Drools project"); }
end
rule "project-1.option2"
when
$proj : application.custom.Project();
$projRes : application.customresults.ProjectResults();
eval ($proj.getStringValue("Java") .equals ("DEF")) # Logic specific to my
application
then
#Requirement is to set and make use of the object 'projRes' in my
application
modify (projRes) {projRes.setResult("Java project");
}
end
Please let me know if the above way of writing the drl would suffice both
the requirements (or) is there a better way to implement it.
Thanks
Dibya
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Queries-with-relation-to-the-LHS...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
Drools 4.0.7 compatible with Jboss 3.2.7
by Dibya Ranjan
Thanks for the update.
Would like to know if Drools version 4.0.7 is compatible with J-boss version
3.2.7.
/BR
Dibya
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools5-2-2-integration-with-scala2-9-0...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 7 Aug 2011 14:33:25 +0200
> From: Dibya Ranjan <dibya.tcs(a)gmail.com>
> Subject: [rules-users] Regd Drools compatibility with Jboss version
> To: rules-users(a)lists.jboss.org
> Message-ID:
> <CAK=+3B9m73RKWQB951Ze1Ca-rpFbB+a+gds4aHVmaGNB4TZ+Vg(a)mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi
>
> We have a requirement to implement Drools in an application ,which is
> hosting the application server in Jboss with version as 3.2.7.
>
> It further uses java 1.4 version with the application being build and
> deployed with Ant 1.6.2.
>
> Could anyone help me in providing the Drools version that is compatible
> with
> above .
>
> --
> With Warm Regards
>
> Dibya Ranjan
> -
> *******************************************
>
13 years, 3 months
Rule o
by DroolersEye
Hi,
Some one can help me,
I want to use Rule object...I noticed Rule interface available in two
packages ...which one to be used...
"org.drools.definitions.rule" or "org.drools.rule"
please some one can advise us...
thanks,
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/Rule-o-tp3243667p3243667.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
Lock-on-active and ruleflow-group
by bitter
I have three rules:
rule "First rule"
salience 20
ruleflow-group "rfs_1"
lock-on-active true
when
$c: Car(color == "red")
then
$c.setPrice(1);
update($c);
end
rule "Second rule"
salience 25
ruleflow-group "rfs_1"
lock-on-active true
when
$c: Car(size == "small")
then
$c.setPrice(2);
update($c);
end
rule "Second step"
salience 40
ruleflow-group "rfs_2"
lock-on-active true
when
$c: Car()
then
System.out.println($c);
end
I have class, for example Car, which has three prioperties: color, size,
price.
I insert into session fact-Car("red", "small"), next start process, and
execute rules.
After that, price value is 1. I thought that "Second rule" should be fired
only because it has bigger salience but it is exactly the opposite. Could
anyone explain me why first rule was executed/fired and what can I do to
fire only "Second rule" (without invoking "First rule").
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp323...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months
Calling a method in when part
by Sumeet Karawal
Hi,
I have a requirement where there is a customized Java class having a method
that returns some value.
like:
getValueBoolean("Some String")
{ //some calculation
// returns a boolean value
}
The default getters and setters are not being used in the Application. The
value that is being returned by the method needs to be checked in the .drl
file.
There are different Java classes with these kind of methods. Where the
string and integer value is also returned. I have gone through the
documentation for Drools-Expert but have only found the implementation for
the method in the consequence part, i.e., the then part.
This is how I tried:
importing the class
in when
binding the a variable to the Class name suppose $c
eval ($c.getValueBoolean("abc"))
then
System.out.println("the value is true")
It didn't work this way.
I tried by another way like :
creating a function in the .drl itself that calls the method of that class
and returns a value
then calling this drl function in the when part and carrying on.
It would be very helpful if some body could let me know how to do this in
the .drl.
Thanks & Regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
13 years, 3 months