Enumeration list from DB in BRMS
by sreenivas555
Hi All,
I would like to display the enumeration list from DB.
I followed the following process.
Step 1. Write all the necessary classes
Example: class DataEnum {
ArrayList loadData() {
}
}
Step2: Upload all the classes to BRMS using create model option
Step3: Update this in Enumeration List
Unfortunatly above steps are not working. Instead of step2, I copied my jar
to drools-guvnor/WEB-INF/lib then it started working.
But I dont want to edit the drools-guvnor.war.
Thaks in advance!!!!
-- Sreenivas
Thanks,
Sreenivas.
--
View this message in context: http://www.nabble.com/Enumeration-list-from-DB-in-BRMS-tp23499029p2349902...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months
CFP - 3rd East European Workshop on Rule-Based Applications - RuleApps 2009
by Emilian Pascalau
-----------------------------------------------------------------------
Our apologies if you receive duplicates of this posting.
Please feel free to distribute it to those who might be interested.
-----------------------------------------------------------------------
*****************************************************************************
* CALL FOR
PAPERS *
*
*
* RuleApps
2009 *
*
*
* 3rd East European Workshop on Rule-Based
Applications *
* Cottbus, Germany, September 21,
2009 *
*
http://hydrogen.informatik.tu-cottbus.de/wiki/index.php/RuleApps2009 *
*
*
*
*
* Paper submission deadline: June 30,
2009 *
*****************************************************************************
Aims and Audience
==================
The workshop aims to to be a common space where those with experience or
interest
in rule modeling, rule languages and rule engines meet researchers with
expertise
in other areas such as: Artificial Intelligence, Business Process
Modeling,
Cloud Computing, Intelligent Agents, Model-Driven Architecture, and
Semantic Web.
Attending this workshop will give researchers the possibility to
identify new
trends and challenges in rule-based applications, and it will provide a
forum for
potential users of innovative AI techniques.
Topics of Interest
==================
The workshop seeks contributions addressing,
but not limited to, the following topics:
* Artificial Intelligence Rules and Rule Systems
* Best Practices in Business Rules
* Combining rules and ontologies
* Rules in Enterprise Modeling
* Implemented tools and systems
* Rules and Web Services Integration
* Rules Modeling and Business Processes (including Production Rules
and ECA Rules)
* Rule base Visualization, Verbalization, Validation, Verification and
Exception Handling.
* Rule-based agents modeling and simulation
* Rule-based modeling of mechanisms, policies, strategies and contracts.
* Rule Engines Architectures
* Rules in Web 2.0 and Enterprise 2.0
Past Events
===========
* 2nd East European Workshop on Rule-Based Applications RuleApps'2008
Collocated with the 18th biennial European Conference on Artificial
Intelligence
ECAI'2008, July 21-25, 2008, Patras, Greece
* 1st East European Workshop on Rule-Based Applications RuleApps'2007
Collocated with the 9th International Symposium on Symbolic and
Numeric Algorithms
for Scientific Computing SYNASC'2007 September 26-29, 2007,
Timisoara, Romania
Submission Details
==================
RuleApps2009 looks for three categories of submissions:
regular, short, and application papers:
* Regular papers - max. 12 pages (including figures) LNCS format
describing completed research.
* Short papers and application papers - max. 6 pages (including
figures) LNCS format
describing early results and novel ideas. Software described in
application papers
should be available online during the review process.
The submission web site is:
http://www.easychair.org/conferences/?conf=ruleapp2009
For any additional questions regarding the submission of papers ask
organizers by email(please include /RuleApps'2009/ in the subject).
Publication
===========
The accepted papers will be published as CEUR-WS Proceedings.
The copyright for the individual items (subsuming any type of
computer-represented files containing articles, software demos,
videos, etc.) within the proceedings volume is owned by default by
their respective authors. Copying of items, in particular papers, and
proceedings volumes is permitted only for private and academic
purposes. Copying or use for commercial purposes is forbidden unless
an explicit permission is acquired from the copyright owners (i.e. authors).
Extended versions of the best regular papers of the workshop will be
invited for publication in an indexed scientific journal.
Important dates
===============
Submissions due: June 30, 2009
Notification of acceptance: July 30, 2009
Camera ready copy due: September 1, 2009
Workshop date: September 21, 2009
Organization
============
Workshop Organizers
* Adrian Giurca, Brandenburg University of Technology, Germany
* Grzegorz J. Nalepa, AGH University of Science and Technology, Poland
* Gerd Wagner, Brandenburg University of Technology, Germany
Program Committee (tentative)
* Grigoris Antoniou, FORTH, Greece
* Costin Badica, University of Craiova, Romania
* Nick Bassiliades, Aristotle University of Thessaloniki, Greece
* Aicha-Nabila Benharkat, Institut National des Sciences Appliquees de
Lyon, France
* Jens Dietrich, Massey University, New Zealand
* Dragan Gasevic, Athabasca University, Canada
* Adrian Giurca, Brandenburg University of Technology, Germany
* Isambo Karali, University of Athens, Greece
* Ion Iancu, University of Craiova, Romania
* Antoni Ligeza, AGH University of Science and Technology, Poland
* Grzegorz J. Nalepa, AGH University of Science and Technology, Poland
* Viorel Negru, West University of Timisoara, Romania
* Paula Lavinia Patranjan, SKYTEC AG, Germany
* Mark Proctor, Drools, Redhat
* Dave Reynolds, Hewlett-Packard Semantic Web Research, England
* Kuldar Taveter, Tallinn University of Technology, Estonia
* Gerd Wagner, Brandenburg University of Technology, Germany
15 years, 6 months
How to import DRL into Business Rule Assets section?
by jant79
Hello,
We are trying to develop a system based on Drools and want to have a
repository based on JBoss and manage it from the Guvnor website. Now, we
have a few questions:
1) Can we import DRL files into the Business rules section, so that later we
can view/modify them using the graphical interface (text boxes, drop down
menus, etc)? This will be very useful for production use.
What we tried so far, imports them as text in the Technical rules section
which is not user friendly at all.
2) Can we at all import .dslr files ? And where from in the Guvnor GUI ?
Thanks a lot,
John
--
View this message in context: http://www.nabble.com/How-to-import-DRL-into-Business-Rule-Assets-section...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months
Drools : usage as appointment booking engine ?
by Damien Raude-Morvan
Hi,
I'm evaluating use of Drools 5 as an appointment booking engine.
My input data are :
- some time slots, defined with a start and end time.
- some appointment constraints (only monday, only morning, appointment
theorical duration)
I've looked at Drools 5 Fusion without finding a way to go with this.
Can someone give me some pointer / start URL about how to solve this kind
of problems ?
Thanks
Regards,
--
Damien Raude-Morvan / www.drazzib.com
15 years, 6 months
drools solver for 2d knapsack problem
by Olaf Raether
Hey , i would like to use drools solver for a 2d knapsack problem.
Has anyone expirience with that ?
Is drools solver made for such a task ?
Thank for hints
Olaf Raether
15 years, 6 months
Avoid unnecessary rule activation when object is retracted
by lsilva
Hi, I'll appreciate any help in this issue
I'm going to explain my problem, using the next rules as example:
####################BEGIN RULE FILE (pricing.drl)##########################
#created on: 04/05/2009
package com.mycompany.pricing
import com.company.FeatureQuoteRequest;
import com.company.Account;
import com.company.EstimatedElectricUsage;
import com.company.AuxDecimal
global AuxDecimal auxDecimal1;
#first rule group to calculate the Capacity Factor
rule "Start capacity factor calculation"
salience 20
when
featureQuoteRequest: FeatureQuoteRequest(feature == 'CAPACITY_FACTOR',
priceAmount == null);
account: Account();
usageItem: EstimatedElectricUsage() from
account.getElectricUsageEstimation(1,6);
then
insert (usageItem);
drools.setFocus("monthly_capacity_factor");
end
rule "Get monthly Capacity factor"
agenda-group 'monthly_capacity_factor'
when
featureQuoteRequest: FeatureQuoteRequest(feature == 'CAPACITY_FACTOR',
priceAmount == null);
account: Account();
usage: EstimatedElectricUsage();
then
auxDecimal1.add(usage.getValue() * 2 + 1);
retract(usage);
end
rule "Get total Capacity factor"
salience 10
when
featureQuoteRequest: FeatureQuoteRequest(feature == 'CAPACITY_FACTOR',
priceAmount == null);
account: Account();
totalEstimatedElectricUsage: Double() from
accumulate(EstimatedElectricUsage (value: value) from
account.getElectricUsageEstimation(1,6), sum(value));
then
featureQuoteRequest.setPriceAmount(auxDecimal1.getValue()/totalEstimatedElectricUsage);
end
#second rule group to calculate the Transmision Factor
rule "Start transmision factor calculation"
salience 20
when
featureQuoteRequest: FeatureQuoteRequest(feature == 'TRANSMISION_FACTOR',
priceAmount == null);
account: Account();
usageItem: EstimatedElectricUsage() from
account.getElectricUsageEstimation(1,6);
then
insert (usageItem);
drools.setFocus("monthly_transmision_factor");
end
rule "Get monthly Transmision factor"
agenda-group 'monthly_transmision_factor'
when
featureQuoteRequest: FeatureQuoteRequest(feature == 'TRANSMISION_FACTOR',
priceAmount == null);
account: Account();
usage: EstimatedElectricUsage();
then
auxDecimal1.add(usage.getValue() * 2 + 1);
retract(usage);
end
rule "Get total Transmision factor"
salience 10
when
featureQuoteRequest: FeatureQuoteRequest(feature == 'TRANSMISION_FACTOR',
priceAmount == null);
account: Account();
totalEstimatedElectricUsage: Double() from
accumulate(EstimatedElectricUsage (value: value) from
account.getElectricUsageEstimation(1,6), sum(value));
then
featureQuoteRequest.setPriceAmount(auxDecimal1.getValue()/totalEstimatedElectricUsage);
end
####################END RULE FILE (pricing.drl)##########################
And I have the nex class to process the rules:
####################BEGIN JAVA CLASS FILE ##########################
1. package com.company;
2.
3. import java.io.InputStreamReader;
4. import java.io.Reader;
5. import java.util.ArrayList;
6. import java.util.List;
7.
8. import org.drools.FactHandle;
9. import org.drools.RuleBase;
10. import org.drools.RuleBaseFactory;
11. import org.drools.WorkingMemory;
12. import org.drools.audit.WorkingMemoryFileLogger;
13. import org.drools.compiler.PackageBuilder;
14. import org.drools.rule.Package;
15.
16. public class PricingCalc {
17.
18. FactHandle handleQuoteRequest = null;
19. FactHandle handleAccount = null;
20.
21. public PricingCalc() {
22. }
23.
24. public static final void main(String[] args) {
25. PricingCalc pricingCalc = new PricingCalc();
26. pricingCalc.runPricingCalc();
27. }
28.
29. private void runPricingCalc(){
30. try {
31.
32. //load up the rulebase
33. RuleBase ruleBase = readRule();
34. WorkingMemory workingMemory = ruleBase.newStatefulSession();
35.
36. WorkingMemoryFileLogger logger = new
WorkingMemoryFileLogger(workingMemory);
37. logger.setFileName("log/event");
38.
39. workingMemory.setGlobal("auxDecimal1", new AuxDecimal(new
Double(0)));
40. //go to calculate capacity Factor!
41. setWorkingMemoryCapacity(workingMemory);
42.
43. workingMemory.fireAllRules();
44.
45. workingMemory.retract(handleQuoteRequest);
46. workingMemory.retract(handleAccount);
47.
48 //go to calculate Transmision Factor!
49 setWorkingMemoryTransmision(workingMemory);
50
51 workingMemory.fireAllRules();
52
53 workingMemory.retract(handleQuoteRequest);
54 workingMemory.retract(handleAccount);
55
56
57 // stop logging
58 logger.writeToDisk();
59
60 } catch (Throwable t) {
61 t.printStackTrace();
62 }
63 }
64
65 private static RuleBase readRule() throws Exception {
66 //read in the source
67 Reader source = new InputStreamReader(
PricingCalc.class.getResourceAsStream( "/Pricing.drl" ) );
68
69 PackageBuilder builder = new PackageBuilder();
70
71 //this wil parse and compile in one step
72 //NOTE: There are 2 methods here, the one argument one is for normal
DRL.
73 builder.addPackageFromDrl( source );
74
75 //get the compiled package (which is serializable)
76 Package pkg = builder.getPackage();
77
78 //add the package to a rulebase (deploy the rule package).
79 RuleBase ruleBase = RuleBaseFactory.newRuleBase();
80 ruleBase.addPackage( pkg );
81 return ruleBase;
82 }
83
84
85 private void setWorkingMemoryCapacity(WorkingMemory workingMemory){
86 //Setting FeatureQuoteRequest
87 FeatureQuoteRequest featureQuoteRequest = new FeatureQuoteRequest();
88 featureQuoteRequest.setFeature("CAPACITY_FACTOR");
89
90 //Setting Account Estimated Electric Usage
91 Account account = new Account();
92 List<EstimatedElectricUsage> electricUsageEstimation = new
ArrayList<EstimatedElectricUsage>();
93
94 EstimatedElectricUsage estimatedElectricUsage1 = new
EstimatedElectricUsage();
95 estimatedElectricUsage1.setMes(1);
96 estimatedElectricUsage1.setValue(new Double(10));
97 electricUsageEstimation.add(estimatedElectricUsage1);
98
99 EstimatedElectricUsage estimatedElectricUsage2 = new
EstimatedElectricUsage();
100 estimatedElectricUsage2.setMes(2);
101 estimatedElectricUsage2.setValue(new Double(20));
102 electricUsageEstimation.add(estimatedElectricUsage2);
103
104 EstimatedElectricUsage estimatedElectricUsage3 = new
EstimatedElectricUsage();
105 estimatedElectricUsage3.setMes(3);
106 estimatedElectricUsage3.setValue(new Double(30));
107 electricUsageEstimation.add(estimatedElectricUsage3);
108
109 EstimatedElectricUsage estimatedElectricUsage4 = new
EstimatedElectricUsage();
110 estimatedElectricUsage4.setMes(4);
111 estimatedElectricUsage4.setValue(new Double(40));
112 electricUsageEstimation.add(estimatedElectricUsage4);
113
114 EstimatedElectricUsage estimatedElectricUsage5 = new
EstimatedElectricUsage();
115 estimatedElectricUsage5.setMes(5);
116 estimatedElectricUsage5.setValue(new Double(50));
117 electricUsageEstimation.add(estimatedElectricUsage5);
118
119 EstimatedElectricUsage estimatedElectricUsage6 = new
EstimatedElectricUsage();
120 estimatedElectricUsage6.setMes(6);
121 estimatedElectricUsage6.setValue(new Double(60));
122 electricUsageEstimation.add(estimatedElectricUsage6);
123
124 EstimatedElectricUsage estimatedElectricUsage7 = new
EstimatedElectricUsage();
125 estimatedElectricUsage7.setMes(7);
126 estimatedElectricUsage7.setValue(new Double(70));
127 electricUsageEstimation.add(estimatedElectricUsage7);
128
129 account.setElectricUsageEstimation(electricUsageEstimation);
130
131 handleQuoteRequest = workingMemory.insert(featureQuoteRequest);
132 handleAccount = workingMemory.insert(account);
133 }
134
135 private void setWorkingMemoryTransmision(WorkingMemory workingMemory){
136 //Setting FeatureQuoteRequest
137 FeatureQuoteRequest featureQuoteRequest = new FeatureQuoteRequest();
138 featureQuoteRequest.setFeature("TRANSMISION_FACTOR");
139
140 //Setting Account Estimated Electric Usage
141 Account account = new Account();
142 List<EstimatedElectricUsage> electricUsageEstimation = new
ArrayList<EstimatedElectricUsage>();
143
144 EstimatedElectricUsage estimatedElectricUsage1 = new
EstimatedElectricUsage();
145 estimatedElectricUsage1.setMes(1);
146 estimatedElectricUsage1.setValue(new Double(110));
147 electricUsageEstimation.add(estimatedElectricUsage1);
148
149 EstimatedElectricUsage estimatedElectricUsage2 = new
EstimatedElectricUsage();
150 estimatedElectricUsage2.setMes(2);
151 estimatedElectricUsage2.setValue(new Double(120));
152 electricUsageEstimation.add(estimatedElectricUsage2);
153
154 EstimatedElectricUsage estimatedElectricUsage3 = new
EstimatedElectricUsage();
155 estimatedElectricUsage3.setMes(3);
156 estimatedElectricUsage3.setValue(new Double(130));
157 electricUsageEstimation.add(estimatedElectricUsage3);
158
159 EstimatedElectricUsage estimatedElectricUsage4 = new
EstimatedElectricUsage();
160 estimatedElectricUsage4.setMes(4);
161 estimatedElectricUsage4.setValue(new Double(140));
162 electricUsageEstimation.add(estimatedElectricUsage4);
163
164 EstimatedElectricUsage estimatedElectricUsage5 = new
EstimatedElectricUsage();
165 estimatedElectricUsage5.setMes(5);
166 estimatedElectricUsage5.setValue(new Double(150));
167 electricUsageEstimation.add(estimatedElectricUsage5);
168
169 EstimatedElectricUsage estimatedElectricUsage6 = new
EstimatedElectricUsage();
170 estimatedElectricUsage6.setMes(6);
171 estimatedElectricUsage6.setValue(new Double(160));
172 electricUsageEstimation.add(estimatedElectricUsage6);
173
174 EstimatedElectricUsage estimatedElectricUsage7 = new
EstimatedElectricUsage();
175 estimatedElectricUsage7.setMes(7);
176 estimatedElectricUsage7.setValue(new Double(170));
177 electricUsageEstimation.add(estimatedElectricUsage7);
178
179 account.setElectricUsageEstimation(electricUsageEstimation);
180
181 handleQuoteRequest = workingMemory.insert(featureQuoteRequest);
182 handleAccount = workingMemory.insert(account);
183 }
184
185 }
####################END JAVA CLASS FILE ##########################
I'm using Drools 4.0.7
The problem is, that many activations are create (one for every
EstimatedElectricUsage) everytime I retract the first object from the
working memory (lines 45 and 53) You can see the activations created, and
immediately cancelled, in the file event.log attached to this post.
http://www.nabble.com/file/p23381763/event.log event.log (open this file in
the Audit View of Eclipse Plugin for a better read)
If I put the "lock-on-active true" for rule "Get total Capacity factor" then
activations are not created when corresponding objects are retracted (line
45, 46) but It doesn't work for rule "Get total Transmision factor". See
event2.log file for detail. http://www.nabble.com/file/p23381763/event2.log
event2.log
Adding "lock-on-active true" for rule "Get total Transmision factor" doesn't
resolve the activations for lines 53 and 54.
When the objects are retracted none of the rules should get activate,
becaouse the rules depend on the existance of the objects retracted.
finally, sorry if my English is not so good, Ask me, If you have any
question to clarify mi problem.
This is my example project if you want to reproduce the case.
http://www.nabble.com/file/p23381763/drools.zip drools.zip
Thanks,
--
View this message in context: http://www.nabble.com/Avoid-unnecessary-rule-activation-when-object-is-re...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months
trying to retrieve facts from WorkingMemory
by Kevin Alonso
I´m trying to retrieve the information of the Working memory inside an
action element of the ruleflow.
I have already writed a query in to .drl file
query "Random Word"
rw : RandomWord()
end
And part of the code in the action element is the next:
QueryResults results = workingMemory.getQueryResults("Random Word" );
System.out.println( "we have " + results.size() + " random words" );
I have obtained this code from documentation, but I don´t know how to
get the workingMemory object.
Regards,
Kevin
15 years, 6 months
Drools and OpenJPA
by Earnest Dyke
Greetings all,
I am trying to use Drools 4.0.7 with objects that are retrieved via OpenJPA. So I have a Person entity which is in the package com.my.company.entity. When I retrieve it via OpenJPA what I get, and subsequently insert into working memory, is a org.apache.openjpa.enhance.com$my$company$entity$Person$pcsubclass. I have tried casting before inserting into working memory but that does not change things. Drools is throwing java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/com$my$company$entity$Person$pcsubclass exception.
Any ideas of how to get around this? I really don't want to have to declare the concrete (OpenJPA) classes in my rules if I can help it.
Thanks in advance for any and all help!
Earnie!
15 years, 6 months
Enumeration in BRMS
by sreenivas555
hi All,
I am loading the dropdown values from a DB / Bean. I want to even control
the values it is internally using.
For Example:
['3=Good','4=Very Good'] . It will display 'Good' for us but internally, it
uses the value 3 and display 'Very Good' for us but internally uses 4.
Same way I want to use when it is loading from DB.
Java method.
public List getDataFromDb(){
ArrayList al=new ArrayList();
al.add("verygood");
al.add("good");
al.add("bad");
return al;
}
Above method is not giving me any control over the ids internally refered.
I tried the following But it is not working. Not sure whether the following
is correct. It is just a guess.
public Map getDataFromDb(){
Map m=new HashMap();
m.put(1, "very good");
m.put(3, "good");
m.put(5, "bad");
return m;
}
Any help on this highly appreciable!!!!
--
View this message in context: http://www.nabble.com/Enumeration-in-BRMS-tp23421669p23421669.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months
Can Drools be Used for this application?
by cyphr
Hi,
I have a scenario where i have:
- A listener that listens to a port and collects datapackets(Logs of
Events) as they come and dumps to a DB.
- consider the data that goes into my table is parsed, processed
(meaningful, not raw anymore).
Can Drools sit in between this listener and my DataBase to achieve the
following :
1. Monitor the frequency of occurrence? Say if/when event 'X' occurs 'n'
times in a 'z' time window?
2. ignore event 'X' until it occurs n times.
3. track a sequence of events - event X followed by event y within a fixed
time window.
(the RHS for any of these is, at the moment, not very consequential. i might
just raise a flag or something to indicate something has happened...)
My query is primarily to understand if this can be achieved.
i may have around a million logs a day, but - only one event at a time is
passed from the listener to Drools. Can drools hold the knowledge of
previous facts(like count) into its working session? or does it require to
store all these facts also?
Should i be firing the rules whenever each log/event enters my system? or
should i accumulate the day's facts ? (but i might have rules that need to
catch conditions spreading over a few days ...)
Some pointers or suggestions on this would be great!
Thanks!
--
View this message in context: http://www.nabble.com/Can-Drools-be-Used-for-this-application--tp23170278...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months