[rules-users] Test Scenario

2011-04-20 Thread Boban Abraham
Hello,

Please share some documentation to create test scenarios in drools guvnor.

How to initialize the java objects, on which the test scenarios have to be
executed?

Do drools allow rule testing where the input is nested objects?

Thanks,
Boban

--
View this message in context: 
http://drools.46999.n3.nabble.com/Test-Scenario-tp2841833p2841833.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Encrypt password in repository.xml

2011-04-20 Thread David Faulkner
Boban,

Instead of using an explicit JDBC connection string, you can instead find
your MySQL connection via a JNDI lookup, externalizing your database
connection information to your application server. You'll have to Google
the exact details, but I believe you set the driver class to
javax.naming.InitialContext and then the driver url to the JNDI name of
your datasource. 

Kind regards,

David

On 4/20/11 6:39 AM, Boban Abraham boban_abra...@mindtree.com wrote:

We use mysql to store the data, hence mysql db credentials are mentioned
in
repository.xml

The DB user password in repository.xml is not encrypted currently.

What are the options available to place encrypted password in
repository.xml?

--
View this message in context:
http://drools.46999.n3.nabble.com/Encrypt-password-in-repository-xml-tp284
1654p2841654.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] First Order Logic - METHODS in Drools

2011-04-20 Thread Swindells, Thomas
I thought wrapping a method in a eval statement is effectively allowing you to 
use methods directly, it is syntactic sugar to say this is a method call, 
evaluate it and then use the result in the rete graph.

From what I understand the problem with methods is drools has to assume that 
the method always returns the same result given the same set of inputs and has 
no side effects as it is non-deterministic how many (or few) times the method 
is called and if the return value changes on different calls then it can 
really screw things up. When writing beans getters normally follow this rule 
by convention and necessity, however this is much less likely for arbitrary 
methods hence why it is good (IMHO) to force the user to consider what they 
are doing explicitly.

Thomas

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of Arjun Dhar
 Sent: 20 April 2011 05:29
 To: rules-users@lists.jboss.org
 Subject: [rules-users] First Order Logic - METHODS in Drools

 According to First order Logic, (from a rule perspective), one can
 represent
 their statements using:
 PREDICATES, METHODS, CONNECTORS (including existential quantifiers)

 ..while PREDICATES can be synonymous with Object and Object
 expressions; the
 only way of using methods  has been via eval (AFAIK, as per my
 outdated
 knowledge); and this is discouraged for the fact that evals perhaps
 dont fit
 in the RETE-OO scheme of things.
 Please note: By methods I dont bean Bean getter/setters; but work horse
 service layer methods.

 ..however, to be true to FOL, using methods directly should be
 supported.
 Q1) If it is, can one show or state an example?
 Q2) If not, for METHODS that return a specific type of Object, cant
 they be
 useful in RETE-OO evaluation?
 Q3) I've used from for DAO's , conceptually does from address this
 fully? In FOL (imo) PREDICATES  METHODS can be exchanged freely, not
 sure
 if from gives that freedom.

 thanks




 --
 View this message in context: http://drools.46999.n3.nabble.com/First-
 Order-Logic-METHODS-in-Drools-tp2841531p2841531.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@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
**

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] First Order Logic - METHODS in Drools

2011-04-20 Thread Arjun Dhar
I believe eval() solves that purpose functionally but is not optimal; not
sure how evals() tie in with Rete-OO
Specially since the return type of eval() is not known, I can seriously
doubt it being optimal as using Objects directly in conditions.

-
Software documentation is like sex: If its good its really really good, if not 
then its still better than nothing!
--
View this message in context: 
http://drools.46999.n3.nabble.com/First-Order-Logic-METHODS-in-Drools-tp2841531p2842085.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] First Order Logic - METHODS in Drools

2011-04-20 Thread Wolfgang Laun
It would help if you read the documentation which explains that eval() must
return a boolean.

Predicate is a mathematical concept; how it is implemented in some system
is a technical issue. That said, predicates can be expressed in Drools one
way or other, and some predicates may be more efficient than other,
depending
on the computational details.

Again, the documentation contains many examples showing predicate
implementations, and usage of from is documented as well.

-W


On 20 April 2011 10:48, Arjun Dhar dhar...@yahoo.com wrote:

 I believe eval() solves that purpose functionally but is not optimal; not
 sure how evals() tie in with Rete-OO
 Specially since the return type of eval() is not known, I can seriously
 doubt it being optimal as using Objects directly in conditions.

 -
 Software documentation is like sex: If its good its really really good, if
 not then its still better than nothing!
 --
 View this message in context:
 http://drools.46999.n3.nabble.com/First-Order-Logic-METHODS-in-Drools-tp2841531p2842085.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] First Order Logic - METHODS in Drools

2011-04-20 Thread Arjun Dhar
ok thanks, i think i confused my notion of eval() with also its ability to
return int on calculations in some other framework.

The reason why i started this thread was to ensure in the process of Rule
engineering, I could write optimal rules in mathematical notion and not have
to worry about technical differences in how a Predicate is translated while
translation to drools. (ideally)

thanks everyone.


-
Software documentation is like sex: If its good its really really good, if not 
then its still better than nothing!
--
View this message in context: 
http://drools.46999.n3.nabble.com/First-Order-Logic-METHODS-in-Drools-tp2841531p2842153.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] First Order Logic - METHODS in Drools

2011-04-20 Thread Wolfgang Laun
On 20 April 2011 11:17, Arjun Dhar dhar...@yahoo.com wrote:


 The reason why i started this thread was to ensure in the process of Rule
 engineering, I could write optimal rules in mathematical notion and not
 have
 to worry about technical differences in how a Predicate is translated while
 translation to drools. (ideally)


:)

This idea is not new. You may want to look up Konrad
Zuse'shttp://en.wikipedia.org/wiki/Konrad_Zuseidea of
Plankalkül http://en.wikipedia.org/wiki/Plankalk%C3%BCl.

Mathematics is abstract, computers aren't.

-W



 thanks everyone.


 -
 Software documentation is like sex: If its good its really really good, if
 not then its still better than nothing!
 --
 View this message in context:
 http://drools.46999.n3.nabble.com/First-Order-Logic-METHODS-in-Drools-tp2841531p2842153.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] compilation error - Import statements are colliding

2011-04-20 Thread Boban Abraham
Hi,

We have scenario in which the imported java classes have same name but
different package. 

The drools guvnor is throwing compilation error stating that import
statements are colliding, even though the java class packages are different.

Please let me know if there are any solutions for this issue.

Thanks,
Boban



--
View this message in context: 
http://drools.46999.n3.nabble.com/compilation-error-Import-statements-are-colliding-tp2842283p2842283.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] compilation error - Import statements are colliding

2011-04-20 Thread David Faulkner
I believe that you can only import one class with the same name,
regardless of package. To access the other class within your code, you
will need to refer to it every time with the fully qualified class name.
This conforms to the behavior of Java source files.

On 4/20/11 11:38 AM, Boban Abraham boban_abra...@mindtree.com wrote:

Hi,

We have scenario in which the imported java classes have same name but
different package.

The drools guvnor is throwing compilation error stating that import
statements are colliding, even though the java class packages are
different.

Please let me know if there are any solutions for this issue.

Thanks,
Boban



--
View this message in context:
http://drools.46999.n3.nabble.com/compilation-error-Import-statements-are-
colliding-tp2842283p2842283.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] [guvnor] How to use a rule in a java application

2011-04-20 Thread Mario Viertel
Hi all,

I am new in Guvnor and have a lot of questions.
I have created a decision table with the Guvnor web app. I have also 
created some test. All seems to be fine.

Now I want to use the rules in a web application. Unfortunately Guvnor 
doesn't provide a web service interface so I must develop an own web 
service to deal with the rules. But thats not so easy ...

In the Guvnor documentation I can see how to create KnowledgeBases and 
builders and how to fire rules. But I cannot see how to receive rule 
results.

Example:

The decision table looks similar like this:

rule 1 under age
if person.age  18 then under age

rule 2 pensioner female
if person.age  64 and person.gender == female then pensioner

rule 3 pensioner male
if person.age  67 and person.gender == male then pensioner

rule 4 full age
* then full age


In my java application I create a person object:

Person p = new Person();
p.setBirthday(...);
p.setGender(...);

Now I miss a method in the Guvnor api to exectute the rules and receive 
the result like this:

Person result = (Person) rules.execute(p);

Can somebody explain how to execute a rule and receive the result.

Thanks in Advance
Mario Viertel
Germany
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [guvnor] How to use a rule in a java application

2011-04-20 Thread Michael Anstis
Hi,

Guvnor is an authoring and repository environment not a runtime environment.

Please read about KnowledgeBuilder and its related addResource methods
together with the ResourceType.PKG. You can also look at using
KnowledgeAgent but for now an understanding of KnowledgeBuilder will
suffice. I also recommend you read about rule invocation, as your example of
how you expect operation rules.execute suggests you have not read the
Expert documentation.

With kind regards,

Mike

On 20 April 2011 12:39, Mario Viertel mario.vier...@medav.de wrote:

 Hi all,

 I am new in Guvnor and have a lot of questions.
 I have created a decision table with the Guvnor web app. I have also
 created some test. All seems to be fine.

 Now I want to use the rules in a web application. Unfortunately Guvnor
 doesn't provide a web service interface so I must develop an own web
 service to deal with the rules. But thats not so easy ...

 In the Guvnor documentation I can see how to create KnowledgeBases and
 builders and how to fire rules. But I cannot see how to receive rule
 results.

 Example:

 The decision table looks similar like this:

 rule 1 under age
 if person.age  18 then under age

 rule 2 pensioner female
 if person.age  64 and person.gender == female then pensioner

 rule 3 pensioner male
 if person.age  67 and person.gender == male then pensioner

 rule 4 full age
 * then full age


 In my java application I create a person object:

 Person p = new Person();
 p.setBirthday(...);
 p.setGender(...);

 Now I miss a method in the Guvnor api to exectute the rules and receive
 the result like this:

 Person result = (Person) rules.execute(p);

 Can somebody explain how to execute a rule and receive the result.

 Thanks in Advance
 Mario Viertel
 Germany
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Dynamic updates of stateful sessions

2011-04-20 Thread maav
...I forgot the mention that I've made sure that all files are on the
classpath. If I go directly for the drl file without using KnowledgeAgent
and ChangeSet.xml it works.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Dynamic-updates-of-stateful-sessions-tp2834623p2842915.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] drools flow persistence doesn't work with spring jta - bug/TODO code in SingleSessionCommandService#initTransactionManager

2011-04-20 Thread gs76pl
hi,

i've been trying to setup my drools flow persistence layer to use spring
transaction management (JTA) but it looks like some parts of the code are
missing in 5.1.1 rendering the whole idea impossible.

Whats happening is that when my transaction manager calls commit it gets
NullPointerException because jpm variable in SingleSessionCommandService has
never been set. It looks like it should be set in initTransactionManager
method in line 233 but all that this line is a comment that reads:
...else{
// configure spring for JPA and distributed transactions 
}

So is there any way to have spring managing JTA transactions? 
Sorry but it's been over a week for me trying to have drools persistence
working and after all the problems so far i'm considering jbpm5 as something
in a more production ready state

i've found similar thread here
http://drools.46999.n3.nabble.com/Drools-Spring-JPA-JTA-td2024942.html but
till now nobody replied to it with any explanation

below my spring config

bean id=droolsFlowEntityManagerFactory

class=org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
p:dataSource-ref=droolsFlowDataSource
p:persistenceUnitName=org.drools.persistence.jpa

p:persistenceXmlLocation=classpath:/config/droolsflow/jpa/persistence.xml
property name=jpaVendorAdapter
bean 
class=org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
p:showSql=true p:generateDdl=false /
/property
/bean 

bean id=bitronixTransactionManagerConfig
factory-method=getConfiguration
class=bitronix.tm.TransactionManagerServices
property name=serverId value=spring-btm /
property name=warnAboutZeroResourceTransaction 
value=true/property
/bean 

bean id=bitronixTransactionManager factory-method=getTransactionManager
class=bitronix.tm.TransactionManagerServices
depends-on=bitronixTransactionManagerConfig destroy-method=shutdown /  

bean id=droolsFlowTransactionManager
class=org.springframework.transaction.jta.JtaTransactionManager
property name=transactionManager ref=bitronixTransactionManager /
property name=userTransaction ref=bitronixTransactionManager /
/bean 

--
View this message in context: 
http://drools.46999.n3.nabble.com/drools-flow-persistence-doesn-t-work-with-spring-jta-bug-TODO-code-in-SingleSessionCommandService-inr-tp2843098p2843098.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Dynamic updates of stateful sessions

2011-04-20 Thread Esteban Aliverti
@Wolfgang: if you are using drools.agent.newInstance=true (the default
configuration), then whenever a change-set is applied, either because you
explicitly force the agent to  do so, or because a monitored resource
changes, the kbase inside the agent is thrown away an a new kbase is
created. So you need to get the kbase from the agent and retrieve a fresh
session from it.
You can confirm this behavior in this set of tests:
https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java

But, if you are using drools.agent.newInstance=false the internal kbase (and
each stateful session you got from it) is refreshed when a change-set is
applied.

@maav: could you please post the output log? When you say it doesn't work
are you saying that it fails when the agent tries to apply the change-set
for the first time? Or it fails if you modify the package when the agent is
running?

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Wed, Apr 20, 2011 at 11:08 AM, maav mattias.ave...@netlight.se wrote:

 ...I forgot the mention that I've made sure that all files are on the
 classpath. If I go directly for the drl file without using KnowledgeAgent
 and ChangeSet.xml it works.

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Dynamic-updates-of-stateful-sessions-tp2834623p2842915.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools flow persistence doesn't work with spring jta - bug/TODO code in SingleSessionCommandService#initTransactionManager

2011-04-20 Thread Mauricio Salatino
As far as I remember, there was a problem with spring and JTA XA
implementation.
Can you provide us a simple test case that fails? we can create a jira issue
and work on it easily if we have that.
Greetings.

On Wed, Apr 20, 2011 at 11:57 AM, gs76pl gstas...@pacemetrics.com wrote:

 hi,

 i've been trying to setup my drools flow persistence layer to use spring
 transaction management (JTA) but it looks like some parts of the code are
 missing in 5.1.1 rendering the whole idea impossible.

 Whats happening is that when my transaction manager calls commit it gets
 NullPointerException because jpm variable in SingleSessionCommandService
 has
 never been set. It looks like it should be set in initTransactionManager
 method in line 233 but all that this line is a comment that reads:
 ...else{
 // configure spring for JPA and distributed transactions
 }

 So is there any way to have spring managing JTA transactions?
 Sorry but it's been over a week for me trying to have drools persistence
 working and after all the problems so far i'm considering jbpm5 as
 something
 in a more production ready state

 i've found similar thread here
 http://drools.46999.n3.nabble.com/Drools-Spring-JPA-JTA-td2024942.html but
 till now nobody replied to it with any explanation

 below my spring config

 bean id=droolsFlowEntityManagerFactory

  class=org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
p:dataSource-ref=droolsFlowDataSource
 p:persistenceUnitName=org.drools.persistence.jpa


 p:persistenceXmlLocation=classpath:/config/droolsflow/jpa/persistence.xml
property name=jpaVendorAdapter
bean
 class=org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
p:showSql=true p:generateDdl=false /
/property
 /bean

 bean id=bitronixTransactionManagerConfig
 factory-method=getConfiguration
 class=bitronix.tm.TransactionManagerServices
property name=serverId value=spring-btm /
property name=warnAboutZeroResourceTransaction
 value=true/property
 /bean

 bean id=bitronixTransactionManager
 factory-method=getTransactionManager
class=bitronix.tm.TransactionManagerServices
 depends-on=bitronixTransactionManagerConfig destroy-method=shutdown /

 bean id=droolsFlowTransactionManager
 class=org.springframework.transaction.jta.JtaTransactionManager
property name=transactionManager ref=bitronixTransactionManager
 /
property name=userTransaction ref=bitronixTransactionManager /
 /bean

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/drools-flow-persistence-doesn-t-work-with-spring-jta-bug-TODO-code-in-SingleSessionCommandService-inr-tp2843098p2843098.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [guvnor] How to use a rule in a java application

2011-04-20 Thread Mario Viertel
Hi Mike,

thanks for the information. No, I didn't know the Expert documentation.

Regards,
Mario


Am 20.04.2011 14:09, schrieb Michael Anstis:
 Hi,

 Guvnor is an authoring and repository environment not a runtime environment.

 Please read about KnowledgeBuilder and its related addResource methods
 together with the ResourceType.PKG. You can also look at using
 KnowledgeAgent but for now an understanding of KnowledgeBuilder will
 suffice. I also recommend you read about rule invocation, as your example of
 how you expect operation rules.execute suggests you have not read the
 Expert documentation.

 With kind regards,

 Mike

 On 20 April 2011 12:39, Mario Viertelmario.vier...@medav.de  wrote:

 Hi all,

 I am new in Guvnor and have a lot of questions.
 I have created a decision table with the Guvnor web app. I have also
 created some test. All seems to be fine.

 Now I want to use the rules in a web application. Unfortunately Guvnor
 doesn't provide a web service interface so I must develop an own web
 service to deal with the rules. But thats not so easy ...

 In the Guvnor documentation I can see how to create KnowledgeBases and
 builders and how to fire rules. But I cannot see how to receive rule
 results.

 Example:

 The decision table looks similar like this:

 rule 1 under age
 if person.age  18 then under age

 rule 2 pensioner female
 if person.age  64 and person.gender == female then pensioner

 rule 3 pensioner male
 if person.age  67 and person.gender == male then pensioner

 rule 4 full age
 * then full age


 In my java application I create a person object:

 Person p = new Person();
 p.setBirthday(...);
 p.setGender(...);

 Now I miss a method in the Guvnor api to exectute the rules and receive
 the result like this:

 Person result = (Person) rules.execute(p);

 Can somebody explain how to execute a rule and receive the result.

 Thanks in Advance
 Mario Viertel
 Germany
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


-- 

Mit freundlichen Gruessen

Mario Viertel
RMS - Radio Monitoring and Surveillance Solutions
BIS - Business and Intelligence Solutions

Tel:  +49 9131 583 510
Fax:  +49 9131 583 11
Mail: mario.vier...@medav.de
Skype: mavi-medav

Betriebsstaette Ilmenau
Homburger Platz 3
98693 Ilmenau
_

MEDAV GmbH
Graefenberger Str. 32-34
D-91080 Uttenreuth

Geschaeftsfuehrer Dr.-Ing. Hans-Joachim Kolb
Handelsregister Fuerth HRB 2311

Bankverbindung
Stadt- und Kreissparkasse Erlangen
BLZ 763 500 00, KtNr. 10 - 000 344

Internet http://www.medav.de

Angaben gemaess EHUG vom 10.11.2006


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Dynamic updates of stateful sessions

2011-04-20 Thread Wolfgang Laun
2011/4/20 Esteban Aliverti esteban.alive...@gmail.com

 @Wolfgang: if you are using drools.agent.newInstance=true (the default
 configuration), then whenever a change-set is applied, either because you
 explicitly force the agent to  do so, or because a monitored resource
 changes, the kbase inside the agent is thrown away an a new kbase is
 created. So you need to get the kbase from the agent and retrieve a fresh
 session from it.
 You can confirm this behavior in this set of tests:
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java

 But, if you are using drools.agent.newInstance=false the internal kbase
 (and each stateful session you got from it) is refreshed when a change-set
 is applied.


Would you please point me to the doc where it says and each stateful
session ... is refreshed?

If true, this were an extremely risky operation. Consider a stateful session
whizzing along and - smack! - rules change right in the middle of a sequence
of firings. Shudder.

-W
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Dynamic updates of stateful sessions

2011-04-20 Thread Esteban Aliverti
@Wolfgang, maybe I need to update the documentation to explicitly inform
about this behavior :). The agent doesn't make anything special to sync the
sessions with the kbase. If you add a rule by hand to an existing kbase, all
the session from this kbase will automatically detect the changes.
Now I'm working in a helper class to create and apply change-set in a
programatic way. So if you don't want kbases to be automatically modified
when a resource chages, you can use this helper class.

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2011/4/20 Wolfgang Laun wolfgang.l...@gmail.com

 2011/4/20 Esteban Aliverti esteban.alive...@gmail.com

 @Wolfgang: if you are using drools.agent.newInstance=true (the default
 configuration), then whenever a change-set is applied, either because you
 explicitly force the agent to  do so, or because a monitored resource
 changes, the kbase inside the agent is thrown away an a new kbase is
 created. So you need to get the kbase from the agent and retrieve a fresh
 session from it.
 You can confirm this behavior in this set of tests:
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java

 But, if you are using drools.agent.newInstance=false the internal kbase
 (and each stateful session you got from it) is refreshed when a change-set
 is applied.


 Would you please point me to the doc where it says and each stateful
 session ... is refreshed?

 If true, this were an extremely risky operation. Consider a stateful
 session whizzing along and - smack! - rules change right in the middle of a
 sequence of firings. Shudder.

 -W




 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Strange intermittent problem with Drools Flow

2011-04-20 Thread Dan Nathanson
Bump

Regards,

Dan Nathanson




On Mon, Apr 11, 2011 at 4:37 PM, Dan Nathanson d...@ddnconsulting.com wrote:
 Hi Mauricio,

 This is now happening intermittently for another user and a couple of
 times on our build machine.  I have never seen it happen on my
 machine.  This will be a show-stopper for us if we cannot figure out
 the cause.  Our business processes will stall after one user completes
 their task and the next user is never notified that they have a task,
 and no errors will be reported.

 Regards,

 Dan Nathanson




 On Mon, Apr 4, 2011 at 9:27 PM, Dan Nathanson d...@ddnconsulting.com wrote:
 Hi Mauricio,

 Were you able to make determine anything from the info I sent you?

 Regards,

 Dan Nathanson

 On Fri, Apr 1, 2011 at 11:03 AM, Dan Nathanson d...@ddnconsulting.com 
 wrote:
 Hi Mauricio,

 Thanks for looking into this. These are the types of errors that scare
 me.  They only happen in one environment and I cannot reproduce them.
 How will I know if it happens in production?

 We generate our rule flow's dynamically from our own concept of a
 process flow.  I don't have a custom work item implementation, but I
 do have a custom WorkItemHandler registered against work items of type
 Step called StepWorkItemHandler. StepWorkItemHandler has uses and
 injected CallbackHandler to do actual processing.  In test code, the
 injected callback handler just records what steps (work items) have
 been activated.  In production code, the injected handler sends JMS
 messages to notify assigned users that work needs to be completed.

 Below is an example of a simple generated flow that fails
 intermittently for one developer here.  I captured it using the
 XmlRuleFlowProcessDumper.

 ?xml version=1.0 encoding=UTF-8?
 process xmlns=http://drools.org/drools-5.0/process;
         xmlns:xs=http://www.w3.org/2001/XMLSchema-instance;
         xs:schemaLocation=http://drools.org/drools-5.0/process
 drools-processes-5.0.xsd
         type=RuleFlow name=flow-1
 id=bd5556f7_581d_422f_a382_3bb3ac041c4f
 package-name=com.xxx.process.manager 

  header
    imports
      import name=org.drools.ruleflow.instance.RuleFlowProcessInstance /
    /imports
  /header

  nodes
    start id=1 name=flow-1 Start /
    join id=2 name=step-1 Reject Join type=2 /
    workItem id=3 name=step-1 Step 
      work name=Step 
      /work
    /workItem
    workItem id=4 name=step-1 Approval 
      work name=Step 
      /work
    /workItem
    split id=5 name=step-1 Approval Split type=2 
      constraints
        constraint toNodeId=2 toType=DROOLS_DEFAULT
 name=rejected priority=110 type=code dialect=java return
 true;/constraint
        constraint toNodeId=6 toType=DROOLS_DEFAULT
 name=approved priority=100 type=rule dialect=mvel
StepApproval( approved == true, sliceValue == NO_SLICE,
 approvalStepNodeId == 1a8a5a64-1e32-46a9-8b04-806c1706a97a
 )/constraint
      /constraints
    /split
    state id=6 name=null Wait 
      onEntry
        action type=expression dialect=java
Terminator.terminateFlow(context);/action
      /onEntry
      constraints
        constraint toNodeId=7 Terminator()/constraint
      /constraints
    /state
    end id=7 name=null End /
  /nodes

  connections
    connection from=1 to=2 /
    connection from=5 to=2 /
    connection from=2 to=3 /
    connection from=3 to=4 /
    connection from=4 to=5 /
    connection from=5 to=6 /
    connection from=6 to=7 /
  /connections

 /process



 I'm attaching the log at trace level (there are no WARN level messages
 at all) that shows this flow failing to complete.  Lines of interest:
 631: Generating the flow from our internal model
 634: starting the flow
 785: Process event listener shows that flow has started and proceeded
 to work item 1 (step-1 Step)
 802: StepWorkItemHandler called for work item 1 step-1 Step
 803: Process event listener shows unwindingof activations
 904: Work item 1 step-1 Step completed
 921: work item loaded
 939: process instance loaded
 956: Process event listener shows leaving step-1 Step, activating
 work item 2 step-1 Approval
 969: StepWorkItemHandler called forwork item 2 step-1 Approval
 970: Process event listener shows unwindingof activations
 1024: work item 1 deleted
 1032: Work item 2 step-1 Approval completed
 1049: work item loaded
 1067: process instance loaded
 ---Should now see leaving step-1 Approval and completing flow, but
 don't see any further progress in the flow.---
 1141: work item 2 deleted

 The execution thread is part of the log output and it seems that
 everything is done in one thread.

 I've also attached a log file (without verbose hibernate output) for a
 successful test run.

 Regards,

 Dan Nathanson




 On Fri, Apr 1, 2011 at 2:42 AM, Mauricio Salatino sala...@gmail.com wrote:
 Hi Dan,
 That's strange, it could be related to a non updated version of the fluent
 API.
 Send us the logs with warn verbosity and we will definitely take a look on
 it.
 If the workflow don't continue after a work item completion 

Re: [rules-users] Strange intermittent problem with Drools Flow

2011-04-20 Thread Mauricio Salatino
Hi Dan, did you manage to get it working?
I didn't have time to look at your problem yet. I'm having very complicated
times, but I'm looking forward to have at least one day to fix that issue.
Can you update me your situation right now?

On Wed, Apr 20, 2011 at 1:26 PM, Dan Nathanson d...@ddnconsulting.comwrote:

 Bump

 Regards,

 Dan Nathanson




 On Mon, Apr 11, 2011 at 4:37 PM, Dan Nathanson d...@ddnconsulting.com
 wrote:
  Hi Mauricio,
 
  This is now happening intermittently for another user and a couple of
  times on our build machine.  I have never seen it happen on my
  machine.  This will be a show-stopper for us if we cannot figure out
  the cause.  Our business processes will stall after one user completes
  their task and the next user is never notified that they have a task,
  and no errors will be reported.
 
  Regards,
 
  Dan Nathanson
 
 
 
 
  On Mon, Apr 4, 2011 at 9:27 PM, Dan Nathanson d...@ddnconsulting.com
 wrote:
  Hi Mauricio,
 
  Were you able to make determine anything from the info I sent you?
 
  Regards,
 
  Dan Nathanson
 
  On Fri, Apr 1, 2011 at 11:03 AM, Dan Nathanson d...@ddnconsulting.com
 wrote:
  Hi Mauricio,
 
  Thanks for looking into this. These are the types of errors that scare
  me.  They only happen in one environment and I cannot reproduce them.
  How will I know if it happens in production?
 
  We generate our rule flow's dynamically from our own concept of a
  process flow.  I don't have a custom work item implementation, but I
  do have a custom WorkItemHandler registered against work items of type
  Step called StepWorkItemHandler. StepWorkItemHandler has uses and
  injected CallbackHandler to do actual processing.  In test code, the
  injected callback handler just records what steps (work items) have
  been activated.  In production code, the injected handler sends JMS
  messages to notify assigned users that work needs to be completed.
 
  Below is an example of a simple generated flow that fails
  intermittently for one developer here.  I captured it using the
  XmlRuleFlowProcessDumper.
 
  ?xml version=1.0 encoding=UTF-8?
  process xmlns=http://drools.org/drools-5.0/process;
  xmlns:xs=http://www.w3.org/2001/XMLSchema-instance;
  xs:schemaLocation=http://drools.org/drools-5.0/process
  drools-processes-5.0.xsd
  type=RuleFlow name=flow-1
  id=bd5556f7_581d_422f_a382_3bb3ac041c4f
  package-name=com.xxx.process.manager 
 
   header
 imports
   import
 name=org.drools.ruleflow.instance.RuleFlowProcessInstance /
 /imports
   /header
 
   nodes
 start id=1 name=flow-1 Start /
 join id=2 name=step-1 Reject Join type=2 /
 workItem id=3 name=step-1 Step 
   work name=Step 
   /work
 /workItem
 workItem id=4 name=step-1 Approval 
   work name=Step 
   /work
 /workItem
 split id=5 name=step-1 Approval Split type=2 
   constraints
 constraint toNodeId=2 toType=DROOLS_DEFAULT
  name=rejected priority=110 type=code dialect=java return
  true;/constraint
 constraint toNodeId=6 toType=DROOLS_DEFAULT
  name=approved priority=100 type=rule dialect=mvel
 StepApproval( approved == true, sliceValue == NO_SLICE,
  approvalStepNodeId == 1a8a5a64-1e32-46a9-8b04-806c1706a97a
  )/constraint
   /constraints
 /split
 state id=6 name=null Wait 
   onEntry
 action type=expression dialect=java
 Terminator.terminateFlow(context);/action
   /onEntry
   constraints
 constraint toNodeId=7 Terminator()/constraint
   /constraints
 /state
 end id=7 name=null End /
   /nodes
 
   connections
 connection from=1 to=2 /
 connection from=5 to=2 /
 connection from=2 to=3 /
 connection from=3 to=4 /
 connection from=4 to=5 /
 connection from=5 to=6 /
 connection from=6 to=7 /
   /connections
 
  /process
 
 
 
  I'm attaching the log at trace level (there are no WARN level messages
  at all) that shows this flow failing to complete.  Lines of interest:
  631: Generating the flow from our internal model
  634: starting the flow
  785: Process event listener shows that flow has started and proceeded
  to work item 1 (step-1 Step)
  802: StepWorkItemHandler called for work item 1 step-1 Step
  803: Process event listener shows unwindingof activations
  904: Work item 1 step-1 Step completed
  921: work item loaded
  939: process instance loaded
  956: Process event listener shows leaving step-1 Step, activating
  work item 2 step-1 Approval
  969: StepWorkItemHandler called forwork item 2 step-1 Approval
  970: Process event listener shows unwindingof activations
  1024: work item 1 deleted
  1032: Work item 2 step-1 Approval completed
  1049: work item loaded
  1067: process instance loaded
  ---Should now see leaving step-1 Approval and completing flow, but
  don't see any further progress in the flow.---
  1141: work item 2 deleted
 
  The execution thread is part of the log output and it seems that
  everything is 

Re: [rules-users] drools flow persistence doesn't work with spring jta - bug/TODO code in SingleSessionCommandService#initTransactionManager

2011-04-20 Thread gs76pl
hi,

i've created a simple project that fails/succeeds base on the passed
transaction manager. See my comments in the test.
http://drools.46999.n3.nabble.com/file/n2843407/droolsflow-bugs.zip
droolsflow-bugs.zip 

i'd appreciate if anyone had a look on this issue

--
View this message in context: 
http://drools.46999.n3.nabble.com/drools-flow-persistence-doesn-t-work-with-spring-jta-bug-TODO-code-in-SingleSessionCommandService-inr-tp2843098p2843407.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users