Knowledge base in cache
by apache
Hi,
Usually when fireallrules() is called then then the drools engine matches
current facts in the jvm memory ( knowledge base ) with the rules in the
rule engine. Is there a way where we can put the facts in a cache like
mamecache or something where when fireallrules() is called the jvm matches
all the facts in the cache also rather than just in the jvm memory.
--
View this message in context: http://drools.46999.n3.nabble.com/Knowledge-base-in-cache-tp3664908p36649...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Rules for generating calendar events
by sverker
Hi
I have an application where I want to generate calendar events. Each event
will have an attached resource and people will be able to book themselves to
this event. The events are re-occuring in that they are on fixed time each
day/weekday etc, like "every friday 07:00 -12:00 unless holiday" or
something like that. The events shall be batch generated at beginning of
each month and put into a database. I want the rules that generate the
events to have some kind of DSL to be easily readable also for
non-technishians.
My question, would drools be a suitable tool for this task? I've been trying
to find examples on the above but couldn't find any.
/Sverker
--
View this message in context: http://drools.46999.n3.nabble.com/Rules-for-generating-calendar-events-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
agenda group fires multiple times
by srinivasasanda
i created 3 agenda groups 101,102,103, and in each group i created some
rules, and i want to fire only one group .
i fired the rules in loop , at first iteration 101 agenda group is fired,
and 2nd iteration 102 group fired and also 101 is also firing. i want to
fire only 102 agenda group in second iteration and third iteration 103
group. i have even given no-loop true . but it not working , please give me
some solution how to solve it.
1. |package pricing
2. |
3. |
4. | declare person
5. | age: Integer
6. | income: Integer
7. | cpv: Integer
8. | end
9. |
10. | declare specification
11. | databandwidth: Integer
12. | smsusage: Integer
13. | voiceusage: Integer
14. | videousage: Integer
15. | end
16. |
17. | declare results
18. | result: String
19. | end
20. |
21. | declare policy
22. | policyid: Integer
23. | end
24. |
25. |
26. |
27. | rule "ageprice"
28. | agenda-group "101"
29. | no-loop true
30. | dialect "mvel"
31. | when
32. | person( age < 99 && > 1 )
33. | r : results( )
34. | then
35. | r.setResult("199");
36. | System.out.println("age price fired =result= ");
37. | System.out.println(r.getResult());
38. | end
39. |
40. |
41. | rule "incomeprice"
42. | agenda-group "102"
43. | no-loop true
44. | dialect "mvel"
45. | when
46. | person( income < 99999 && > 1 )
47. | r : results( )
48. | then
49. | r.setResult("599");
50. | System.out.println("income price fired result=");
51. | System.out.println(r.getResult());
52. | end
53. |
54. |
55. | rule "cpvprice"
56. | agenda-group "103"
57. | no-loop true
58. | dialect "mvel"
59. | when
60. | person( cpv < 6 && > 1 )
61. | r : results( )
62. | then
63. | r.setResult("999");
64. | System.out.println("cpv price fired =result=");
65. | System.out.println(r.getResult());
66. | end
67. |
68. |
69. |
70. |
71. | rule "policy"
72. | dialect "mvel"
73. | when
74. | policy( policyid == 101 )
75. | then
76. | System.out.println("policy filred");
77. | drools.setFocus("101");
78. | end
79. |
80. |
81. | rule "policy2"
82. | dialect "mvel"
83. | when
84. | policy( policyid == 102 )
85. | then
86. | System.out.println("102 policy fired");
87. | drools.setFocus("102");
88. | end
89. |
90. |
91. | rule "policy3"
92. | dialect "mvel"
93. | when
94. | policy( policyid == 103 )
95. | then
96. | System.out.println("103 policy is focused");
97. | drools.setFocus("103");
98. | end
--
View this message in context: http://drools.46999.n3.nabble.com/agenda-group-fires-multiple-times-tp366...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Calling POJO class get Method in BRL
by srinivasasanda
Hi,
I've a BRL with Person as a fact containing field name age(in sample
package).
Now,I've a POJO class named PersonDetails with fields age,name with its
getters,setters methods.Now I uploaded that POJO model in that sample
package.
Now,I need to check in When condition of brl whether age in Person fact is
equal to the value obtained from getAge() method of PersonDetails POJO
class.
When I used guided editor it is giving as age is equal to 1.Literal
Value,2.Expression editor,3.Formulae.
How can i achieve that ??I should create new instance of PersonDetails p in
When condition and i should call p.getAge() and that value must be compared
to age in Person Fact.
Can you please suggest me how to achieve this..
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Calling-POJO-class-get-Method-in-BRL-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Drools Java/EJB Deployment
by swaroop
Hi,
I want to deploy the .DRL,.DRT and Decision tables on to some app
server(Tomcat/JBoss) and access the decision entities using an exposed
business method. Please suggest some approaches and samples. I am using
change-set for loading rules, decisiontables, ruleflows .I Have my object
model converted to a jar. Iam using stateful session.
Thanks
Swaroop
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Java-EJB-Deployment-tp3662685p36...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
using CE accumulate
by bobbi_80
Hi,
I have the following bean and trying to run "accumulate" to get the average
of CPU usage from a cluster.
public static class cpuTracker{
private String machinename;
private String averageCPU;
}
My rule is as follows.
rule check
when
$aggr : Number() from accumulate(cpuTracker($avg :
Integer.parseInt(averageCPU.split("\\.")[0])), average($avg))
then
System.out.println(" Average value : " + $aggr);
end
If the averageCPU is an integer type then accumulate works fine but my
problem is that it is string type and I am trying to convert it to integer
from a rule file and it throws a bunch of compile time errors.
any help in resolving it or some workaround is highly appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/using-CE-accumulate-tp3662339p3662339.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
ProcessEventListener event order
by Carlos Villegas
Hi,
I'm testing the ProcessEventListener on a simple process and I get the
"after" events in reverse order.
For example,
Process completed : 1283915643204
Node left: 5: 1283915643268
Node triggered: 5: 1283915643268
Node left: 4: 1283915643268
Node triggered: 4: 1283915643269
Node left: 3: 1283915643269
Node triggered: 3: 1283915643270
Node left: 2: 1283915643270
Node triggered: 2: 1283915643270
Node left: 1: 1283915643270
Node triggered: 1: 1283915643271
Node left: 0: 1283915643271
Node triggered: 0: 1283915643271
Process started : 1283915643271
I'm just printing the node id and the time in milliseconds.
Is this the way is supposed to be?
I guess technically "after" could be anytime after, but if I use the
afterProcessStarted event, I get it after the whole process has
completed!, which it's not useful at all.
The "before" events work as expected I think.
I'm using Drools Flow 5.1.0.
Thanks,
Carlos
14 years, 3 months