Guvnor connection Drolls API.
by tom ska
Hi,
what I want to do, is to initialise knowledgeBase with package created in
Guvnor. But I don't want to use changeSet.xml. I have my own configuration
file (apache commons configuration), and I want to load all connection's
data from this file. So I have in my config file: Guvnor's URL, and login
and password. I want to load my knowledgeBase in JAVA using this file. Is
this possible? To avoid using changeSet.xml?
Thanks,
tom.
14 years, 2 months
if else implementation in one rule
by Kripa Nathwani
Hello,
I need to implement a functionality as follows:
If an employee belongs to a particular state(MH) for a particular month(Feb) then take an action.
If an employee belongs to the same state(MH) but for different month (non Feb) then take another action.
I can implement it using two different rules(Feb rule and nonFeb rule). BUT if I want to implement it using a single rule is there any provision for the same in Drools?
Similar to an if-then-else statement in java.
Best Regards,
Kripa
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
14 years, 2 months
Keeping track of sessions and their process instances
by Gustavo Tenrreiro
Hi,
I am working on a flow that uses flow events.
I send the event from a rule, and the only way I know to send an event
requires that I know the processId as well as the sessionId. Which
means I need to be able to keep track of both those two values so that
I can later use them to send the event.
So the question is what is the best strategy to keep track of the
sessions and the processes ?
The following is what I do; please comment on it, and feel free to
suggest a better way.
I ve created a class called WorkflowInfo that has two members (
processId, and sessionId )
When I start the process I create a WorkflowInfo, I set the processId,
and the sessionId then I insert it into the working memory:
WorkflowInfo info = new WorkflowInfo();
info.setProcessId(instance.getId());
info.setSessionId(ksession.getId());
ksession.insert(info);
In one of the rules I check for a condition, and when it is met I send
the flow event:
rule "sendEvent"
when
$info : WorkflowInfo()
<something is true>
then
DroolsEventsManager.getInstance().sendEvent($info.getProcessId(),
$info.getSessionId(), "someEvent");
end
Now to send the event this is what I do ( from a java class ):
public void sendEvent(long processId, int sessionId, String eventType)
{
StatefulKnowledgeSession session =
JPAKnowledgeSessionLookup.getInstance().loadSession(sessionId);
try {
SignalEventCommand command = new SignalEventCommand();
command.setProcessInstanceId(processId);
command.setEventType(eventType);
command.setEvent(true);
session.execute(command);
} catch (Exception e) {
Logger.getInstance().error(this.getClass(), e.getMessage());
e.printStackTrace();
}
finally{
session.dispose();
}
}
Does this approach make sense ?
Thanks
14 years, 2 months
Fwd: Artificial Intelligence: Expanding & Broadening Your Skills
by Edson Tirelli
Hey all,
Don't forget to register for Rules Fest 2010. As usual, we are holding a
bootcamp there where we can share experiences between Drools users and
developers. Last year the room was packed full, and we had a great meeting.
Hope to meet you there in October. More details on the e-mail bellow and
on the Drools blog:
http://blog.athico.com/2010/08/dont-forget-rulefest-october-2010.html
Cheers,
Edson
---------- Forwarded message ----------
From: Rules Fest Association <Rules_Fest_Association(a)mail.vresp.com>
Date: 2010/9/8
Subject: Artificial Intelligence: Expanding & Broadening Your Skills
To: tirelli(a)post.com
[image: advertising_3_header1.jpg]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/6e260b...>
September 8, 2010
*Do you want to broaden & sharpen your AI programming skills?*
Join other software programmers, developers, engineers and architects at
Rules Fest 2010
[image: grey_box_top.gif]
Artificial Intelligence is undergoing a quiet renaissance across all
industries, powered by reasoning technologies like rule-engines, inference
engines, and constraint-solvers. Get a practical immersion in these topics
at this year’s Rules Fest conference, to be held in San Jose, CA from
October 11-14, 2010.
Key topics during the 17-session, 3-day conference include:
Reasoning *in Action* Reasoning Methodologies
& Best-Practices Reasoning and Management Reasoning Trends
AI-specific sessions include:
- *Keynote*: The Role of Production Rules in a General Cognitive
Architecture, Professor John Laird, the John L. Tishman Professor of
Engineering at the Artificial Intelligence Laboratory at the University of
Michigan
- Integrating Classic Rule Systems With Modern Scalable
Architectures, Chandra
Mouleeswaran
- Learning by Demonstration Technology for the Masses, Karen Myers
In addition to artificial intelligence, Rules Fest 2010 will address
reasoning, inferencing, and pattern matching technologies that are at the
heart of many solutions to modern, complex computing problems.
For complete conference agenda, abstracts and speakers bios, visit our
website<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/762526...>
[image: grey_box_bottom.gif] *Fee*: * $399.* Register before September
15 and save $50:* $349 early bird special.*
*Discounts for groups and students. *
*[image: RulesFest]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/01f8d5...>Conference
package
*
- 4 nights and 3 days at the historic Dolce Hayes Mansion
Resort<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/d8cb13...>
- A boot cam<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/226b04...>p
of choice
- Continental breakfast and lunch each day
- Discount off from the Rules Fest 2011 conference
- *$999 ($225 savings)*
*Info:*
www.rulesfest.org<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/5c3420...>
[image: RegisterNow]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/232895...>
*Join the Dialog:*
*[image: twitter_logo
2]*<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/2cf336...>
[image: linkedin-in-button
2]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/988010...>
[image: facebook]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/79f519...>
Email: info(a)company.com <info(a)rulesfest.org>
------------------------------
Click to view this email in a
browser<http://hosted.verticalresponse.com/756695/29b07023ea/1343038631/4dadcb8b59/>
If you no longer wish to receive these emails, please reply to this message
with "Unsubscribe" in the subject line or simply click on the following
link: Unsubscribe <http://cts.vresp.com/u?29b07023ea/4dadcb8b59/mlpftw>
Click here<http://oi.vresp.com/f2af/v4/send_to_friend.html?ch=29b07023ea&lid=1343038...>to
forward this email to a friend
Rules Fest Association, Inc.
6655 W. Sahara Avenue Suite E-102
Las Vegas, Nevada 89146
Read <http://www.verticalresponse.com/content/pm_policy.html> the
VerticalResponse marketing policy.
[image: Try Email Marketing with VerticalResponse!]
<http://www.verticalresponse.com/landing/ef/?mm//29b07023ea>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
14 years, 2 months
Re: [rules-users] Loading facts and memory size limits
by Greg Barton
Considering that just an Object array of 10 million Objects consumes 115MB of memory, I think loading 1 billion facts will be stretching the limits of the VM all by itself. (and that's java.lang.Object with no fields...)
GreG
On Sep 8, 2010, at 10:31, bellios <carfid(a)gmail.com> wrote:
Hi all,
i have read the Documentation and the Drools book. I am developping an
application but i don't understand in my case how i can loading a
1,000,000,000 facts (approx).
At present I load all facts into a StatefulKnowledgeSession with a for-
cycle and I insert them into ksession ("ksession.insert(customer);")
The problem is the out of memory exception due the high memory
requirements of facts.
How i can resolve it? There is another approach to
facts loading into session? Can i integrate the loading with JPA/Hibernate
frameworks?
Thanks in advance for any suggestion,
David
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Loading-facts-and-mem...
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
14 years, 2 months
JMS Messenger
by Tina Vießmann
Hi,
I'm using JMS (especially Apache ActiveMQ) in my application. Right
now, I'm manually establishing the JMS connection, extracting my Java
objects from the JMS messages and inserting the objects into the
knowledge base. It's simple without any hype.
Until now, I've always missed the chapter about the JMS Messenger in the
Expert User Guide somehow. Now I've read about it, I'm asking myself if
it can be helpful to me. But based on the short description I can't make
really head or tail of it.
Could someone explain its functionality more detailed to me, please?
Thank you for any help! :)
Tina
14 years, 2 months
What's the use of the RemoveIdentitiesOption?
by Wolfgang Laun
I do understand both ways of the AssertBehaviorOption, but what's the
function of the RemoveIdentitiesOption? (This one's not in Drools Expert,
and Javadoc doesn't explain.)
-W
14 years, 2 months
Persistence.createEntityManagerFactory NullPointerException
by 亮亮
hi:
in my webapp, I use JPA to store the runtime state,i use this code in
VdcService.java which is a sample java class:
EntityManagerFactory emf =Persistence.createEntityManagerFactory(
"org.drools.persistence.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
// create a new knowledge session that uses JPA to store the runtime state
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
I put persistence.xml to webRoot/META-INF/ , persistence.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence
version="1.0"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.drools.persistence.jpa"
transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:comp/env/jdbc/mysql</jta-data-source>
<class>org.drools.persistence.session.SessionInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceEventInfo</class>
<class>org.drools.persistence.processinstance.WorkItemInfo</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>
I use resin 3.1.10, $resin-home/conf/resin.conf:
<database>
<jndi-name>jdbc/mysql</jndi-name>
<driver type="org.gjt.mm.mysql.Driver">
<url>jdbc:mysql://127.0.0.1:3306/test</url>
<user>root</user>
<password></password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
when i run this webapp , i got this exception:
java.lang.NullPointerException
at
com.caucho.amber.manager.AmberPersistenceProvider.createEntityManagerFactory(AmberPersistenceProvider.java:65)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at com.abc.abc.service.VdcService.exec(VdcService.java:32)
at com.abc.abc.resources.Apply.apply(Apply.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:156)
at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
at
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:208)
at
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:75)
at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:115)
at
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:67)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:724)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:689)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:680)
at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:324)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:604)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
at java.lang.Thread.run(Thread.java:619)
i can't solve it.How to solve it?help me ,THS
14 years, 2 months
Drools FLow Persistence and Sessions
by Chrystall, Greg
Hi,
When using persistence what is the best approach to creating sessions?
I can resume a session if the service was shutdown based on the session ID, but how often should I be creating new sessions?
Can I have multiple sessions writing to the same database?
Any guidance appreciated.
Greg
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
14 years, 2 months