Conversion from Normal Decision Tables to Web-Based Tables and vice-versa
by Vikrant Yagnick
Hi All,
I am wondering if anyone has had a requirement where they would need to convert their normal decision tables into web-based decision tables(or vice-versa).
If someone has already done this, can they share either some code or pointers to how this can be done? (I guess it will involving parsing the Excel and creating the XML for the decision table).
Will this be a useful feature to have?
Cheers,
Vikrant
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 years, 1 month
loading rules dynamically
by techy
Hi,
If the rules,conditions,consequences have to loaded from the database. I
can think of following two approach. what would be right approach( I will
have upto 1200 rules in the db)
1. Programmatically inject the rules into rule engine using drools API.
2. Read the rules from the database and create drl or dsl file for them and
inject into rule engine.
Thanks
--
View this message in context: http://www.nabble.com/loading-rules-dynamically-tp20274919p20274919.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 2 months
OSGI, classloading, and imports in KnowledgeBuilder
by msully
So I'm playing with Drools in Equinox OSGi, and so far it's behaving quite
nicely - one bit of weirdness though.
What I'm trying to do:
I have a bundle with a 'flow manager' that listens for instances of
WorkItemHandler in the service broker (well, really my own subinterface that
has a getName method). It also listens for new bundles with a
META-INF/drools directory with *.rf files in them, and parses the .rf files
it finds there.
The Flow Manager is itself published as an OSGI Service with a 'perform'
method. It encapsulates all of its Drools calls within the perform method
though - they aren't exposed to clients.
My test involves a simple start->work item->end workflow.
I pass in an instance of a class "Tablex" that can be saved to hibernate. I
also pass in a String that has the table name, and an empty List to get the
results.
My .rf file tries to import Tablex. It declares the three values I mention
above, and maps them to the work item in the work item definition.
<p>
<imports>
<import name="my.pkg.Tablex" />
</imports>
...
<variable name="my.pkg.newrecord" >
<type
name="org.drools.process.core.datatype.impl.type.ObjectDataType"
className="my.pkg.Tablex"/>
</variable>
...
<workItem id="2" name="DBWorkItem" x="165" y="374" width="80"
height="40" >
<work name="DBWorkItem" >
</work>
<mapping type="in" from="my.pkg.tablename" to="my.pkg.tablename" />
<mapping type="in" from="my.pkg.newrecord" to="my.pkg.newrecord"/>
<mapping type="in" from="my.pkg.outlist" to="my.pkg.outlist"/>
</workItem>
</p>
In my manifest for my .rf file and for the flow manager (where the parsing
occurs) I Import-Package Tablex's package.
When my flow manager tries parsing the rule, it gives an error saying the
the import failed. BUT, everything still works, and my WorkItemHandler works
correctly (the WorkItemHandler imports Tablex itself, since it needs to
manipulate it).
If I declare my Tablex variable as a java.util.Object in the ruleflow then I
don't get the error and things also still work.
If I declare my Tablex as Tablex in the rule flow AND import it in the class
that does the parsing (it's already 'OSGI' imported to the parsing bundle,
but now I'm doing a plain old Java import on it) then everything works fine
with no error message.
Kind of a hybrid question but I figured I'd start with the Drools folks.
Any ideas would be appreciated.
Thanks,
Mike
--
View this message in context: http://www.nabble.com/OSGI%2C-classloading%2C-and-imports-in-KnowledgeBui...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 2 months
questions on guvnor and drools 5.0
by Garner, Shawn
I was wondering if somebody can help me with some questions:
1) Is there any more detail on how to setup Guvnor with a database?
2) How do you use the test scenarios with complex object structures?
-eg Create a fact in working memory that has another Object in it which in turn has a list of Objects in it.
-Seems like any Fact in working memory is assumed to only have only primitive values like Strings or numbers.
-We would like a more depth of objects where objects have a deep relationship to other objects at least 2-4 levels deep.
3) Why add ruleflow-group to the rule definition instead of adding the rule to a ruleflow-group? If the ruleflow-group is part of the rule then you can't use the same rule in multiple ruleflow-groups and leads to copy and maintaining the rule in two different spots.
4) DSL seems to be very inconvenient to edit in a text box especially when it wraps. Why not a table where you can add rows and each row is a translation. Also there are no examples how to do translation into Drools syntax that is multiple lines long and not just a single line.
5) Is Java 5 Type Enumerations supported? I was assuming I'd get a list of values if a field was an Enumeration.
6) There seems to be a vast functionality difference between the Guvnor decision tables and examples that use spreadsheets.
7) Guvnor lost the ability to select variables for use in other statements. Functionality was in BRMS of drools 4.0.7
8) I was not able to insert a fact using a constructor that needed parameter values. Seems like it assumes everything is a bean but I couldn't find this requirement stated in the documentation anywhere. Examples in documentation show inserting facts with constructor parameters.
9) It would be nice when you upload a domain model jar that you could explore the objects and fields somehow.
10) When you write a rule using one particular editor it would be nice if you could switch to another editor. Switch between Guided, DSL, Technical, etc.
11) It seems hard to reorder the statements in a when or then block. If I put them in the wrong order I have to delete them all. Would be nice if a statement could be moved up or down.
12) When calling a method on an object the choices only showed me public methods that take in one parameter. I had a method with two parameters and it wouldn't show me the method. I had to do a DSL or custom drools statement to get around it.
13) Guvnor seems to limit the drools syntax. I couldn't do a "from $collection" statement without a custom drools statement line.
14) It would be nice if I could declare a global dialect "java" for all the rules.
15) It would be nice to define an existing agenda-group as part of a ruleflow-group without adding the ruleflow-group on the rules in that agenda-group.
Thanks,
SG
-----Message Disclaimer-----
This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to Connect(a)principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.
Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.
While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.
15 years, 3 months
Why is a flat object recommended?
by Christie, Blair
In the documents this is dicussed briefly:
"). Object models can often have complex relationships and hierarchies
in them - for rules you will want to simplify and flatten the model
where possible, and let the rule engine infer relationships (as it
provides future flexibility."
What does it mean that the rule engine can infer relationships?
Are there performance reasons for having a flat model?
Cheers,
Blair
15 years, 3 months
impossible to dispose tomcat devloader when i reload context (drools keep reference)...
by Emmanuel GREFFET (France)
Hello
I'm Emmanuel from France. (sorry for my English)
We use drools 4.0.7 in a hospital application.
We load drools and our programs (services) with tomcat Devloader (5.5.9)
We use drools in statefullsession (retract and insert facts by rules in a
ruleFlow).
everything is perfect for us, except a little problem of "dispose" with
tomcat due to drools.
Through the Tomcat console when we try to restart our webapp, tomcat can't
dispose the old Devloader
(in Eclipse we can see that many drools class use class attribute
ClassLoader without any dispose ???)
In production, we used different webapps in a Tomcat, so we can't easely
stop Tomcat, so until we stop tomcat, the reload of the webapps is longer
and longer ... (many devloader(s) can't dispose)...
anyone has had this problem ?
Thank you.
Emmanuel
--
View this message in context: http://www.nabble.com/impossible-to-dispose-tomcat-devloader-when-i-reloa...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 3 months
Problems with ruleflow
by Femke De Backere
Hi,
I have a problem with an easy Rule flow project (source code included
in this mail). The only thing that should happen is the execution of a
rule flowgroup, but my application ends before executing the group...
Does anybody see the problems? I tried every possible adaptation and
based this problem on a similar, working feverapplication... But is
still doesn't work and I really can't find the problem.
Thx,
Femke
15 years, 3 months
Problems setting MySQL for the human task process server....
by Cristiano Gavião
Hi,
I was trying to change the persistence settings for human task process
server for using MySQL instead of H2DB.
I was following the Drools Flows Documentation on chapter 5.1.3.:
Configuring Persistence.(https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBui...
#d0e1157)
I read on docs that I should override the persistence.xml of the
drools-process-enterprise.jar, create the drools.session.conf with
some contents (i don`t undestand` what it is...) and put them on my
project META-INF directory... ok?
I created the files as stated on docs but it didn't work... My
example runned ok, but using the H2DB and not my MYSQL.
// Use persistence.xml configuration
emf =
Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
taskService = new TaskService(emf);
taskSession = taskService.createSession();
server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
Thread.sleep(500);
System.out.println("Server started ...");
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5Dialect" />
<property name="hibernate.connection.driver_class"
value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://
localhost/drools" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="" />
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
</properties>
After some investigation I could see that the example recommended by
Mark Proctor (TaskLifeCycleTest.java, and others that use
MinaTaskServer) use <persistence-unit name = "org.drools.task"> that
is setting on drools-process-task.jar and not the
"org.drools.persistence.jpa" on drools-process-enterprise.jar as
stated on documentation...
First question, which one should I use for use the Drools Flows Server
and Client?
emf =
Persistence.createEntityManagerFactory( "org.drools.task" );
emf =
Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
I test the first option. I changed the persistence.xml file and use
the code below:
// Use persistence.xml configuration
emf = Persistence.createEntityManagerFactory("org.drools.task");
taskService = new TaskService(emf);
taskSession = taskService.createSession();
server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
Thread.sleep(500);
System.out.println("Server started ...");
Hummm.... It runs and connect well to my MySQL. but now it brings me a
error...
java.lang.IllegalArgumentException: Named query not found:
UnescalatedDeadlines
at
org
.hibernate
.ejb
.AbstractEntityManagerImpl
.createNamedQuery(AbstractEntityManagerImpl.java:108)
at org.drools.task.service.TaskService.<init>(TaskService.java:84)
at org.drools.task.service.TaskService.<init>(TaskService.java:68)
It sounds like it was not possible to find orm.xml that is on META-INF
of drools-process-task.jar.
But when I copy the orm.xml file to my project META-INF it works ok....
Could someone give some ideas how can I solve this problem..
Thanks a lot
Cristiano
15 years, 4 months
Customize the UI
by Rads2029
Hi,
Can anyone give me an example of what exactly needs to be done if I need to
use my own custom UI for rule creation etc. ( In this case my UI is Flex)
As per the rules documentation , we need to to use the ServiceImplementation
class which implements the RepositoryService. ( both of these are in the
package structure org.drools.guvnor.server)
However I could not find any jar where these classes are readily available.
:-((
It would be great if i can get pointers to the jar location and also a small
end to end example of how to plug in custom UI to call the drools guvnor (
brms) service.
Thanks,
Radha
--
View this message in context: http://www.nabble.com/Customize-the-UI-tp23132164p23132164.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
Validation in Guvnor fails due to unrecognized method of implemented interface
by Brody bach
Hi,
I have a class which implementes several interfaces
class MyClass implements interA, interB, interC {
private String nameA;
private String nameB;
private String ownString;
public String getNameA(){ ---impl of method from interface interA
return nameA;
}
public String getNameB(){ ---- impl method from interface interB
return nameB;
}
public String getOwnString{ ---- own method
return ownString;
}
}
Another class, MyBiggerClass has MyClass as its attribute:
class MyBiggerClass {
private MyClass myClass;
public MyClass getMyClass(){
return myClass;
}
}
In a rule, I use MyBiggerClass as follows:
$mybig : MyBiggerClass()
eval($mybig.getMyClass().getNameB().equals("HelloWorld"))
The evaluation fails, and it said
unable to resolve method using strict-mode: interA.getNameB()
As you can see, the validator checks as if the getNameB was a method of
interA (the first interface).
I'm wondering whether this is a bug, or do I have to somehow change the
structure of my class.
But the question is, why does it check the interfaces not the class itself?
Thanks for advices
Regard
bb
--
View this message in context: http://www.nabble.com/Validation-in-Guvnor-fails-due-to-unrecognized-meth...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months