It's useless posting rules in agenda groups and the code that
changes the current agenda group without giving any indication
of the facts you insert and the results on standard output.
-W
On 16/01/2012, srinivasasanda <srinivasasanda(a)gmail.com> wrote:
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.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users