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
Drools 5.0 dependancies
by Chris Richmond
Hello,
I notice there is a license file with the drools 5.0 binary distribution,
and the /lib directory contains all the dependancy libraries for drools, but
I have no idea who owns these or what the license is on the numerous third
party libraries in there. Does anyone have any idea what licenses apply
to all of the dependancy .jars for Drools 5.0?
Thanks,
Chris
15 years, 6 months
Dependencies readme file
by Chris Richmond
I notice that all of the drools 5.0 dependency jars are in the .lib folder,
but many of the versions are wrong according to the README_DEPENDENCIES.txt
file.
For instance API:
Jaxb-impl 2.1.9
However version 2.0.3 is the one included in the jar. Can someone explain
what is going on here or what I'm missing?
Thanks,
Chris
15 years, 6 months
ClassCastException for Hibernate entity when rule is fired
by Sobhana Richard
hi, we are using Drools 4.0.7
and have a rule which uses a Hibernate entity (SaleEventItem) and its related
entity (Inventory). Some times, the SaleEventItem passed as the fact has the
Inventory lazy loaded and hence its type is the Hibernate proxy -
Inventory_$$_javassist_93. In this case, the rule runs fine.
But at times, the SaleEventItem which is passed has the Inventory attribute set
explicitly and hence its type is Inventory itself. When the rule fires in this
case, it tries to assign the Inventory into Inventory_$$_javassist_93 which
causes this ClassCastException. java.lang.ClassCastException: com.crom.data.pojo.Inventory incompatible with
com.crom.data.pojo.Inventory_$$_javassist_93
at
ASMAccessorImpl_14985690421242774005070.getValue(Unknown Source)
at
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
at
org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
at org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
at
org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
at
org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)
How do we prevent this? Is it possible to somehow enforce that the type of the variable
in the rule should be Inventory and not Inventory_$$_javassist_93?
The rule is as follows.
dialect "java"
when
$sale:SaleEventItem(inventory != null,
$leaseInfo:inventory.leaseInformation != null,
$saleEventPrize:inventory.leaseInformation.residualPayAmount != null)
then
$sale.setStartPrice((Double)$sale.getInventory().getLeaseInformation().getResidualPayAmount());
Thanks,Sobha
Bollywood news, movie reviews, film trailers and more! Go to http://in.movies.yahoo.com/
15 years, 6 months
RuleBase.removeRule leads to NoClassDefFoundError
by Steinar Haugen
Hi,
We're having a problem with runtime rule administration; i.e. using
RuleBase.addRule and RuleBase.removeRule.
We're using Drools 4.0.7 on Sun JDK 1.4.2_11 and inside Weblogic 8.1 sp 6.
Typically we remove a few rules followed by adding a few rules. In some
cases, we receive a NoClassDefFoundError. Stacktrace is provided in attached
file.
http://www.nabble.com/file/p23657476/stacktrace.txt stacktrace.txt
The class referenced (i.e. the one not found) is the removed rule.
Has anyone else seen this behaviour?
This seems like such a basic error that we're wondering if we're doing
something wrong here. We have been unable to find anything about this
To make matters worse, this actually leads to a deadlock. This is because
lock / unlock in version 4.0.7 is not encapsuled in a try / finally block in
AbstractRuleBase.removeRule(), so whenever an error occurs, the lock is not
released.
I found a Jira issue regarding this, where this issue is addressed and
apparently fixed in an earlier version:
https://jira.jboss.org:8443/jira/browse/JBRULES-603
This fix has been rolled back, however, so this issue is present in version
4.0.7.
We found a workaround for the deadlock by performing lock / unlock
ourselves, since drools will not lock if it has been performed already.
In addition, we encapsulate rulebase access with a read/write lock to ensure
that whenever the rulebase is updated, no other operation towards it is
performed.
Regards,
Steinar Haugen
--
View this message in context: http://www.nabble.com/RuleBase.removeRule-leads-to-NoClassDefFoundError-t...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months
Is Drools suitable for this scenario?
by Zevenbergen, Alex
Hi all,
I am wondering if Drools is suitable for a task I have to achieve.
I have an application that assigns values to objects - in some
circumstances an object's value may have to be mapped onto another
object. The circumstances that this might happen in don't have many
common characteristics so I have cant really put this logic into a db.
So my question is whether Drools is the better option to put this logic
into?
Also this app relies on speed and is Drools fast enough to facilitate
this? (<= .005 sec preferably)
Thanks,
Alex
________________________________________________________________________
Privileged, confidential and/or copyright information may be contained in this communication. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, you may not copy, forward, disclose or otherwise use this e-mail or any part of it in any way whatsoever. To do so is prohibited and may be unlawful. If you have received this email in error
please notify the sender immediately.
Paddy Power PLC may monitor the content of e-mail sent and received for the purpose of ensuring compliance with its policies and procedures.
Paddy Power plc, Airton House, Airton Road, Tallaght, Dublin 24 Registered in Ireland: 16956
________________________________________________________________________
15 years, 6 months
Re: [rules-users] Is Drools suitable for this scenario?
by Greg Barton
If this assigning of values between objects does not require further action, then you can use stateless sessions in sequential mode. (By "further action" I mean no rules need to fire in reaction to object changes.) That's how you'll get maximum speed. Also, the setup is generally what takes the most time, so it's best to keep an engine (or pool of engines) initialized and ready to go for incoming requests.
--- On Thu, 5/28/09, Zevenbergen, Alex <azevenbergen(a)paddypower.com> wrote:
> I am wondering
> if Drools is suitable for a task I have to
> achieve.
>
> I have an
> application that assigns values to objects –
> in some circumstances an object’s value may have to
> be mapped onto
> another object. The circumstances that this might happen in
> don’t have many
> common characteristics so I have cant really put this logic
> into a db.
>
>
>
>
> So my question
> is whether Drools is the better option to put
> this logic into?
>
>
>
>
> Also this app
> relies on speed and is Drools fast enough to
> facilitate this? (<= .005 sec
> preferably)
>
>
>
>
> Thanks,
>
>
>
>
>
> Alex
>
>
>
>
>
>
>
> ________________________________________________________________________
>
> Privileged, confidential and/or copyright information may
> be contained in this communication. This e-mail and any
> files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they
> are addressed. If you are not the intended addressee, you
> may not copy, forward, disclose or otherwise use this e-mail
> or any part of it in any way whatsoever. To do so is
> prohibited and may be unlawful. If you have received this
> email in error
>
> please notify the sender immediately.
>
>
>
> Paddy Power PLC may monitor the content of e-mail sent and
> received for the purpose of ensuring compliance with its
> policies and procedures.
>
>
>
> Paddy Power plc, Airton House, Airton Road, Tallaght,
> Dublin 24 Registered in Ireland: 16956
>
> ________________________________________________________________________
>
>
>
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
15 years, 6 months
Re[rules-users] sult Lists from Decision Tables
by wasabifan
I have worked directly with DRLs previously, but my new company would like to
store their rules in decision tables.
Basically, in the past, we would insert a custom object to maintain a list
of results from the rules, which was pretty easy to do in a DRL. However,
in decision tables, I have not found a good way to create a named parameter
for that controlled list without making up a bogus condition (that really
doesn't matter).
Is there an easy way to pass an object to really only be used in the actions
columns?
Thanks,
Bryan
--
View this message in context: http://www.nabble.com/Result-Lists-from-Decision-Tables-tp23749077p237490...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months