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
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
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
Drools Flow Trigger process by ruleset
by Garrett Conaty
I've seen in the latest docs on trunk that it's possible to set some
constraints on a start node so that a process would execute when the
appropriate rules matched.
However I can't see an example of this, nor can I edit the properties
through the Eclipse UI.
Is it possible to define a condition under which the process will
execute and then have the process start when the rule matches. Is
this done external to the rule file or can it be done on the rulefile
itself? I could see a few ways of doing this and am looking for some
guidance towards the correct (read as easiest for biz users) method.
1) Kick off a process that the first node after the start is a
ruleflow group (serving basically as a gate)
2) Deploy a rule that when it matches starts up the process (separate
rule file and separate ruleflow file)
3) Define a start condition in the rule file and deploy the process.
Then whenever the rule matches, a process instance is started.
Personally I like #3 and the docs seem to imply it's possible, but I
can't see how.
Thanks,
Garrett
15 years, 6 months
CEP functionality
by David Boaz
Dear all,
We posted this question two weeks ago, but with no replies. please forgive
me for posting it again.
In our business, most of the facts have time-stamp attributes. For example,
each laboratory test (a fact) has the time stamp when the sample was taken,
and when the machine produced the result value. In our business-logic, we
often analyze the relation between facts using these attributes.
For example:
1) finding two adjacent labResults with an increasing value
2) checking whether 3 facts are consecutive
3) counting the number of facts fulfilling a specific constraint within a
specific time window.
We were happy to read (in the blog) about the new CEP feature which is about
to be added to drools 5.0.
* Where can we find a more detailed description of CEP functionality in
drools?
* Is it a good idea to use CEP for analyzing historic data (retrieved from
the database)? or is it best for online data.
* Can we use CEP in a stateless session?
* As we understand, CEP attaches to each fact a temporal attribute of the
assertion time. Can we define that a particular attribute (e.g.,
LabResult.samplingDate) will be used as the time stamp? Or, should we assert
the facts by their temporal order, and advance the session-clock
appropriately?
* Can we use CEP to analyze the data in the examples above?
Many thanks for the help, David
--
View this message in context: http://www.nabble.com/CEP-functionality-tp19020709p19020709.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 7 months
Stateless session and rule flows
by Yoni Mazar
Hi Guys,
We are trying to work with drools with stateless session (Sequential) and to
apply rule flows.
we use the following code:
//define diagnosis and patient here
...
StatelessSession session = ruleBase.newStatelessSession();
//Here we would like to use: session.startProcess("ruleflow id") but this is
a method which belongs to
//StatefullSession only.
session.execute(new Object[] {diagnosis, patient});
How can we do that in steteless mode?
Thanks,
Yoni
--
View this message in context: http://www.nabble.com/Stateless-session-and-rule-flows-tp17863849p1786384...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 7 months
problem escaping quote in eval
by samlotti
Hello,
I'm trying to construct a rule in drool V4 that contains and eval and a
literal string that may contain quotes. I've tried escaping the quote but
get the error below. The \" works outside an eval.
rule "evalList2"
when
Var( eval( "tt".equals("t\"t")))
then
System.out.println( "evalList2" );
end
Error:
java.lang.NullPointerException:
at
org.drools.rule.PredicateConstraint.createContextEntry(PredicateConstraint.java:201)
at org.drools.reteoo.AlphaNode.createMemory(AlphaNode.java:230)
...
It looks like a change was made to V3 to fix this but doesnt appear to work
in V4, does anyone know how to construct this type of rule?
Thanks
Sam
--
View this message in context: http://www.nabble.com/problem-escaping-quote-in-eval-tp19186015p19186015....
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 7 months
Drools 4.0.7 - Rules not fired
by Benoit VILLAUMIE
Hello,
I am using Drools engine 4.0.7 and Eclipse 3.3 drools plugin.
I have a very basic/dumb problem but I do not understand where my error is :
I have 2 rules
---------------------------------
package poc
import poc.FlashFact;
*rule "HP one"*
when
FlashFact( homepage == "one");
then
System.out.println("*** HP one");
end
*rule "HP commons"*
when
FlashFact();
then
System.out.println("*** HP commons ");
end
----------------------------------
I insert a FlashFact which homepage is set with "one" value.
In my understanding, both rules "HP one" and "HP commons" should be
fired. Instead, only "HP commons" is launched. I have compared with the
Drools State example (which works fine), but I do not notice nothing.
Thanks for your help.
The code of the FlashFact class
---------------------------------
package poc;
public class FlashFact {
public FlashFact() {
this(null);
}
public FlashFact(String homepage) {
this.setHomepage(homepage);
}
private String homepage;
/**
* @return the homepage
*/
public final String getHomepage() {
return this.homepage;
}
/**
* @param homepage the homepage to set
*/
public final void setHomepage(String homepage) {
this.homepage = homepage;
}
}
---------------------------------
The code of the launcher
---------------------------------
package poc;
import java.io.InputStreamReader;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.StatefulSession;
import org.drools.audit.WorkingMemoryFileLogger;
import org.drools.compiler.PackageBuilder;
public class FlashUndeployedRulesMain {
public static void main(String[] args) throws Exception {
StatefulSession session = null;
WorkingMemoryFileLogger logger = null;
try {
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(new InputStreamReader(
FlashUndeployedRulesMain.class.getClassLoader()
.getResourceAsStream(RULE)));
final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());
session = ruleBase.newStatefulSession();
logger = new WorkingMemoryFileLogger(
session);
logger.setFileName("log/flash");
// inserting facts
FlashFact HPFrance = new FlashFact("one");
session.insert(HPFrance);
session.fireAllRules();
} finally {
if(session != null) {session.dispose();}
if(logger != null) {logger.writeToDisk();}
}
}
private static final String RULE = "poc/Flash.drl";
---------------------------------
15 years, 7 months