Drools-Spring usage
by Bryan Memmelaar
Hi -
Following the documentation I have setup a RESTful endpoint at which to call drools from Ruby. I have a use case where I need to generate somewhat "dynamic" rules because each user can configure their rules in a certain way. To accomplish this I have made rule files with unique names (these do not change often, example: 12.drl), and have setup multiple ksession ids, kbase ids that load the different drl files. I name the ksession with the rule name (example: ksession12) and use a lookup in my JSON to direct to the correct rule.
Example:
{"batch-execution": { "lookup":"ksession12", "commands": [ { "insert": <continued....>
My question is this is not working for multiple users. The first user will work correctly and return the executed rule. However the second user (if I switch the lookup) seems to do nothing - not even log the debugging content. I have been through the documentation and am unable to find what I am doing wrong. Can anyone point me in a direction?
I am looking to have multiple rule files and decide based on the lookup what to run. I assume this is pretty basic, but cannot find the right document that talks to it.
thanks
12 years, 5 months
Drools and jBPM Public Training London 2013
by plugtreelabs
We're making a workshop that introduces Business Process Management and
prepares you to be immediately effective in using both Drools and jBPM to
improve your applications. You will learn how to utilize the different
stages of BPM where development is involved, for both versions 5 and 6 of
the Drools and jBPM platform.
We'll discuss several best practices that allow for effective BPM, and how
the jBPM components are more suitable placed into those best practices.
We'll also cover how is the best way to perceive the software writing work
related to running effective Business Processes and rules, and see how this
allows a best fit from an End User perspective.
Where? London, England, Number 1 Poultry, EC2R 8JR
When? October 21-25 , filled with Q&A sessions and workshops, from 10:00 AM
to 18:00 PM, with the last two hours for specialized questions and
workshopping everyday.
By Who? By jBPM commiter and Plugtree's CTO Mariano De Maio (a.k.a. Marian
Buenosayres), jBPM commiter and Plugtree's CTO. Mariano has provided several
contributions to the Drools and jBPM community, including the initial
version of jBPM Form Builder, Drools and jBPM persistence using infinispan,
and jBPM rollback API.
What will it cover? Full theoretical and technical overview of Drools and
jBPM. You can download the full agenda from
http://www.plugtree.com/wp-content/uploads/2013/08/agenda.pdf
We offer different options depending on your interest:
- Introduction: October 21. Full theoretical introduction to Drools and
jBPM components. USD 500.00
- Drools: October 21-23. Introduction + full technical coverage of Drools.
USD 1350.00
- jBPM: October 21, 24 and 25. Introduction + full technical coverage of
jBPM. USD 1350.00
- Full: October 21 + 25. USD 1728.00, and 1929.00 after 9/21/13. Register
and get the early bird pricing!
Or send us an email at trainings(a)plugtree.com for other payment methods. See
you at London!
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-and-jBPM-Public-Training-London-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
No errors thrown from KnowledgeAgent
by De Rooms Brecht
Dear Drools users,
I have been testing with the KnowledgeAgent from version 5.4 and 5.5. It
monitors a changeset and is set to incrementally build the
knowledgebase. I noticed that it sometimes crashes but never throws out
errors. This happens for example when I define a type two times and when
I remove a file. Does anyone experience similar behaviour and has an
idea of how I could see the errors? I already tried to check the errors
by building it myself using a knowledgebuilder before I update the file
that the knowledgeAgent monitors but that's quite a dirty solution.
Kind Regards,
De Rooms Brecht
12 years, 5 months
Insert, fire, then retract from consequence
by Jonathan Knehr
I am wondering if I can insert a fact, fire all activated rules, then retract the fact all in a rules consequence.
I have similar behavior using the API that I'd like to be able to do inside a rule, as well.
The idea is that once all the rules that cause activations get fired, it gets retracted immediately. This is so that we don't have to have cleanup rules all over the place, and have to ensure that the salience is set correctly.
Any ideas?
Thanks in advance!
Sent from my iPhone
12 years, 5 months
latest event within a timeframe
by Alexander Wolf
[Drools Version 5.5.0 Final]
Hey -
I got an event E1 that is only valid, if the latest event E2 following E1 within 2 minutes has the value 1
--> I want have the rule fire 2 minutes after E1 but only if E1 is valid
This is my rule:
rule "inform about E1"
when
//event (T1) is the initial trigger
$event1 : Event(type == EventType.T1)
//there is an event (T2) with value 0 between 0,2m after doorClosed
$event2: Event(type == EventType.T2, value == 1, this after [0, 2m] $event1, $timestamp : timestamp)
//there is no newer event (T2) within the timeframe
not Measurement(type == EventType.T2, this after [0, 2m] $event1, timestamp > $timestamp)
then
//print info
log(drools, "E1 valid");
end
An example of Events:
12:00:00 - E1
12:01:00 - E2 ( value = 0 )
12:01:10 - E2 ( value = 0 )
12:01:40 - E2 ( value = 0 )
12:01:50 - E2 ( value = 1 )
12:02:10 - E2 ( value = 0 )
I would expect the output: [log() does log the clock-time when my rule fires)
12:02:00 E1 valid
But what I get is:
12:03:50 E1 valid
So I see that the late coming E2 (@12:02:10) is correctly ignored, the rule result is basically correct, but the rule is fired much to late. (actually 2 minutes after $event2 and not as expected 2 minutes after $event1).
Could someone give me a hint what I did wrong?
Regards,
Alex
12 years, 5 months
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.
12 years, 5 months
Use System Variable when referring to Resources
by srikanthmalli
Hi,
Is it possible to use System variable when referring to Resources in
Drools-Spring integration?
<drools:kagent id="kAgent" kbase="kBase" new-instance="false">
<drools:resources>
<drools:resource type="PKG"
source="file:/C:/Guvnor-Repository/Sample_v1.PKG">
</drools:resource>
</drools:resources>
</drools:kagent>
<drools:kagent id="kAgent" kbase="kBase" new-instance="false">
<drools:resources>
<drools:resource type="PKG"
source="file:${SYS_VAR_RULE_PKG_DIR}/Sample_v1.PKG">
</drools:resource>
</drools:resources>
</drools:kagent>
Thanks,
-Sri
--
View this message in context: http://drools.46999.n3.nabble.com/Use-System-Variable-when-referring-to-R...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
Guvnor 5.5.0.Final Web decision table's advanced enum is not working.
by Soumya.plavaga
Hi,
We are trying to use the advanced enumeration with guvnor 5.5.0.Final. But
seems not working for us. We are doing this -
Having model cascadedModel. CascadedModel has following fields -
1. categoryField (Type Text)
2. departmentField. (Type Text)
Cascaded model has a fact called -
cascadedFact.
Created an enum called cascadedEnum having following -
Fact => 'cascadedFact'
Field => 'categoryField'
Context => '(new
com.ugamsolutions.projectname.guvnorhelper.CategoryListing()).getAttributeListByName("categoryName")'
Fact => 'cascadedFact'
Field => departmentField[categoryField]
Context => '(new
com.ugamsolutions.projectname.guvnorhelper.DepartmentListing()).getAttributeListByNameAndCategoryIdString("departmentName","@{categoryField}")'
And using these two enums in a web decision table's drop down. First drop
down suppose to display all the categories returned for 'categoryField' and
second dropdown will return the departments based upon category dropdown
selection.
Here my case Category drop down is listing properly, no issues. But upon
category selection department dropdown is not loading at all. Actually I can
see '{@categoryField} in enum is not replacing the primary drop down's
selected value. Can you please take a look and let me know if there is any
issue with the advanced dropdown with web decision table in guvnor
5.5.0.Final war?
Any help will be really appriciated.
Many Thanks,
Soumya
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-5-5-0-Final-Web-decision-table-s...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months