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
15 years, 6 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
15 years, 6 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
**************************************************************************************
15 years, 6 months
Nested access to process variables
by marton.bokor
Hi,
I have some process variabless passed via map in startProcess. AFAIU these
represent the current state of my process instance so what I would like to
do is compare these in a condition of a wait state node against an inserted
fact, which would be the dynamic (changing) part (Because I imagined that
this is what wait nodes are mostly good for, hope I'm right...). AFAIK this
node accepts only rule syntax (no mvel or java) so ATM I managed to do it
with eval, see code below, but it is ugly:
transaction : TransactionDAO( ) #this is the changing part
processInstance : WorkflowProcessInstance() #this is the process level
eval(
((APSSender)((BaseForm)processInstance.getVariable("form")).getDao()).getTransactionId().equals(transaction.getTransactionId())
)
As you can see the left side in eval is a nested object. In java it would
look like simply form.getDao().getTransactionId(). My question is how can I
do it with rule syntax without eval? Is it possible? I was experimenting
like a whole day with no success. Please help!
Thanks
Marton
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Nested-access-to-proc...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
error while running a dsl
by Kripa Nathwani
Hello,
I have written the following simple DSL in Drools:
[when]employee belongs to a particular state{state}=$employee:employee (statename=="{state}");
[then]Greet Employee=System.out.println("Hello");
I have also created the corresponding model with a field named "state".
When I try to create business rule for the same and when I validate the rule I get the following error:
Unable to create Field Extractor for 'statename' of '[ClassObjectType class=dslDemoPackage.employee]' in rule 'testdsl'
Let me know how I can resolve.
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.
______________________________________________________________________
15 years, 6 months
Drools 5.1 framework codebase
by Swapnil Sawant
Hi,
I have my application built on some framework. I am using drools 5.1 in my
app as a rule engine
and would be using drools for implementing workflow too.
I am thinking of integrating my app's framework with framework for drools
Drools is an open-source package. Hence, I would want to get the drools 5.1
framework codebase which can be setup,studied,customized and run when
needed. Also, if there is any documentation related to framework , please
share that too.
Thanks,
Swapnil Sawant
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-1-framework-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
How to modify changeset.xml in guvnor
by rtowler1
I apologize now if this is the wrong forum, I'm a Drools noobie.
I'm trying to get the mortgage example working using jboss 5.0.1GA server
running drools 5.1.1 guvnor.
I get the 401 unauthorized http response, which is due to the 5.1 using
authentication.
I've read the posts about modifying the changeset.xml to include
authentication.
But I cannot see how to change the changeset.xml file from within Guvnor and
although the URL is given to the ChangeSet.xml file, I believe that it's
probably generated on the fly as I cannot find it in the server's
directories.
If someone could point me in the right direction for this I'd appreciate it.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-modify-changes...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
drools-5.1.1-examples.zip out of date?
by rtowler1
Is the drools-5.1.1-examples.zip from the 5.1 downloads page to be out of
date?
I've tried importing the drools-examples into eclipse but I get the
following error
If anyone knows how to fix this it would be really appreciated.
Project build error: Non-resolvable parent POM org.drools:drools:5.1.1 for
org.drools:drools-examples-fusion:5.1.1: Failed to resolve POM for
org.drools:drools:5.1.1 due to Missing:
----------
1) org.drools:drools:pom:5.1.1
----------
1 required artifact is missing.
for artifact:
org.drools:drools:pom:5.1.1
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-5-1-1-examples...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months