Drools server and knowledge agent functionality
by Manuel Ortiz
Hello everybody:
I am taking a look at Drools Integration documentation to understand how
Drools server works and how can be used, and have a doubt concerning, let's
say... 'KnowledgeAgent capabilities'. Does Drools server support on the fly
rule updating as when using KnowledgeAgent to create KnowledgeBase objects?
If it does, where can be configured 'KnowledgeAgent related' properties such
as newInstance or resource scanner interval?
Thank you in advance for your time.
Kind regards,
Manuel Ortiz.
11 years
Question about custom accumulation functions
by Bruno Freudensprung
Hi,
While testing my custom accumulation function I noticed an unexpected
behavior (th'ats of course a personal point of view).
It seems that Drools 5.1 calls accumulate(...) and getResult(...) as
many times as the number of accumulated facts (accumulate, getResult,
accumulate, getResult, etc...).
Is it supposed to work like this?
Best regards,
Bruno.
11 years, 1 month
Dependency enumeration
by agarwalk
Hi
I have created following enumeration and java class file.
*Enumeration:*
'OrderData.propertyState':(new com.asps.rules.OrderData()).loadStates()
'OrderData.fulfillmentReviewerName[propertyState]':'(new
com.asps.rules.OrderData()).loadReviewers("@{propertyState}")'
*Java class:*
public class OrderData implements Serializable {
private String propertyState;
private String fulfillmentReviewerName;
// getters and setters
public List<String> loadStates() {
List<String> states = new ArrayList<String>();
states.add("CA");
states.add("NY");
states.add("FL");
return states;
}
public List<String> loadReviewers(final String propertyState) {
List<String> reviewers = new ArrayList<String>();
System.out.println("### in load reviewers ### : " + propertyState);
if ("CA".equalsIgnoreCase(propertyState)) {
reviewers.add("A");
reviewers.add("B");
System.out.println("Reviewers : A & B");
} else if ("NY".equalsIgnoreCase(propertyState)) {
reviewers.add("C");
reviewers.add("D");
System.out.println("Reviewers : C& D");
} else if ("FL".equalsIgnoreCase(propertyState)) {
reviewers.add("E");
reviewers.add("F");
System.out.println("Reviewers : E& F");
} else {
reviewers.add("G");
reviewers.add("H");
System.out.println("Reviewers : G& H");
}
return reviewers;
}
}
I created a rule as follows
WHEN
There is an OrderData with:
propertyState[propertyState]* FL* --- This is a drop down which
is being displayed correctly
fulfillmentReviewerName [fulfillmentReviewerName] -- This should
have been the drop down. Values are dependent on the state selected.
When i try to create above rule the enumeration is loaded correctly for
propertyState but the enumeration is not loaded for fulfillmentReviewerName
field. When I saw the logs the correct method and condition is being
invoked (as per Sys out)but drop down does not contain anything.
ANy suggestions?
--
View this message in context: http://drools.46999.n3.nabble.com/Dependency-enumeration-tp3245703p324570...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 2 months
Guvnor - Loading enums programatically using rule metadata
by GPatel@tsys.com
The Guvnor manual specifies how to load enum data programtically but it
seems like only other fields on the same Fact can be used to filter the
values that can show up in the drop-down fields, as shown below:
'Fact.field[dependentField1, dependentField2]' : '(new
com.yourco.DataHelper()).getListOfAges("@{dependentField1}",
"@{dependentField2}")'
Is it possible to somehow use other rule attributes, like package name or
rule metadata to filter the list? Something like the following:
'Fact.field[dependentField1]' : '(new
com.yourco.DataHelper()).getListOfAges("@{dependentField1}",
drools.getRule().getMetaData().get("ID"))'
Thanks
G. Patel
-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you
11 years, 3 months
how to debug rules in JBoss AS?
by Marina
Hello,
I know one can debug rules (put breakpoints in .drl and ruleflow files) when
running/debugging an application as a Drools Application.
However, I would like to debug rules when my application is running in JBoss AS
- just like we do a normal debugging of a Remote application running in a
different JVM ,by enabling the JDWP on the server
(-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n) and then
connecting to the specified port.
Basically, I would like to be able to debug both my Java classes and rules
together. Is it possible?
thanks,
Marina
11 years, 3 months
Re: [rules-users] java.lang.ClassCastException: [Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package
by Manasi
Hi,
I am also getting same error when trying to a call rule stored in guvnor.
Following error I am getting:
Exception in thread "main" java.lang.ClassCastException:
[Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package
at org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:82)
at org.drools.agent.URLScanner.readPackage(URLScanner.java:171)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:143)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:119)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:427)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:379)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:364)
at org.drools.agent.RuleAgent.init(RuleAgent.java:264)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:204)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:164)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:273)
I am using Drools 5.4 version.
The error is coming when trying to get the RuleAgent:
RuleAgent agent = RuleAgent.newRuleAgent("/com/model/drools.properties");
drools.properties contains:
url =
http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/FeltKnapRes...
name=guvnorAgent
enableBasicAuthentication=True
username=admin
password=admin
FeltKnapRestriktionerKundeMedAnl is the package name I have created in
guvnor ,and I want to call one of the rule in this package.
Thanks,
Manasi
--
View this message in context: http://drools.46999.n3.nabble.com/java-lang-ClassCastException-Lorg-drool...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 4 months
Fire Rule in Stateless Knowledge Session
by snehils
Hi,
I am new in Drools. I am using Drools version 5.1.0
My requirement is kind of request response, where I have to perform some
checks for the request and respond the result. Hence, I decided to go with
stateless knowledge session.
I have prepared .DRL file and it contains set of rules. When some request
receives I have to identify the rule(s) belongs to that request and then
fire the rule(s).
I am not able to figure out how to categories the rules request wise in DRL
file? Also, how to fire only those rules which belongs to the category.
For example, there are three kinds of requests Rq1, Rq2 and Rq3. There are
rules in DRL file: R1, R2, R3, R4 and R5. R1, R2 belongs to Rq1, R3 belongs
to Rq2 and R4, R5 belongs to Rq3.
When some request receives only its belonging rules should be fired. For
example, on receiving of Rq2 only R3 should be fired.
Please provide me some code snipped or link.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Fire-Rule-in-Stateless-Knowledge-Sessio...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
Guvnor: Accessing Bound Variable in "Then" Statement
by Vann_the_Red
Hello. I started with a search and didn't find an answer. I apologize if my
search-fu was lacking today.
I'm a non-developer tasked with rules creation and testing using guvnor. I
have found some scenarios where I can bind a variable to either the whole
input model or a fact in the input model and then later access those in the
output model by selecting "Bound Variable" from the popup box in the Then
statement. In other scenarios, "Bound Variable" is not an option (only
Literal or Formula). What must I do to be able to access the bound
variables from the When statement(s) in the Then statement(s)?
TIA,
Vann
This is a repost because I wasn't on the mailing list yet and I gather most
didn't see it. Apologies again.
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Accessing-Bound-Variable-in-Then...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months