[rules-users] Call of a function in the definition of a rule template

2012-02-13 Thread freelance developpement
Hi every one,

I defined a function in Guvnor and I want to call it to define a rule
template. But I do not know how.

Have you any ideas?
Thank you in advance
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to get the Fact datatypes from the Guvnor

2012-02-13 Thread Wolfgang Laun
See inline!

On 13 February 2012 06:23, Veera veera...@gmail.com wrote:

 Hi All,

 Can anybody help to get the Field type(what datatype it is ).
 I have declared a Facts in Guvnor 5.3 and i can able to retreive all the
 package names  rules names  fact names , now i want to know what is the
 datatype of each fact , i don't know which api to use for this.

 Can any body help me pelase...

 below code to get the all package names  rules names  fact names...:
 CollectionKnowledgePackage kpackages =
 _kagent.getKnowledgeBase().getKnowledgePackages();

for(KnowledgePackage kpackage : kpackages)
{
   for(org.drools.definition.rule.Rule rule1 :kpackage.getRules())
   {
//printing package names  rule names.
   String packname= rule1.getPackageName();
   String rulename=rule1.getName();
   System.out.println(This is : +packname+ Packages and
 RuleName is  +rulename);

   //printing Fact names..
Field[] s=kpackage.getClass().getFields();


Method getClass() is inherited from java.lang.Object and returns the
object's java.lang.Class. Therefore, the Field[] s are the fields of
java.lang.Class().

There is no (stable) way of retrieving the declared fact names from a
KnowledgePackage.

If you are willing to use the *UNSTABLE* API, look at all (!) of

http://drools.46999.n3.nabble.com/Fact-Names-in-a-Model-td3572234.html

-W


System.out.println(s.toString());
   }
}


 Thanks,
 Veera

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/How-to-get-the-Fact-datatypes-from-the-Guvnor-tp3739223p3739223.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] make the Guvnor interface into French

2012-02-13 Thread freelance developpement
hi
Michael Anstis,
 Can you tell me in detail how to make the interface in French, it is
urgent and
I have not understood your answer.

Thanks in advance.

2012/2/12 Michael Anstis michael.ans...@gmail.com

 Translations are always welcome :)

 If you can ensure translations are up to date (there have been many more
 additions to master) I can push the file for you.

 Thanks,

 Mike

 sent on the move

 On 12 Feb 2012 20:59, Vincent LEGENDRE 
 vincent.legen...@eurodecision.com wrote:

 Yes, there is me !
 I even have a fresh newly updated french file (for 5.3.0.Final version),
 as the one in actual guvnor date from my last translation for 5.1 (parts
 are french, parts are english, which does not look very good).

 I was thinking of updating the former JIRA with the new file ?
 Should I create a new JIRA ?
 Can I simply post here and you make the git push ?
 Do I really need to fork the git repo for that ?


 --
 *De: *Michael Anstis michael.ans...@gmail.com
 *À: *Rules Users List rules-users@lists.jboss.org
 *Envoyé: *Dimanche 12 Février 2012 17:34:15
 *Objet: *Re: [rules-users] make the Guvnor interface into French

 Guvnor comes with a fr_FR locale translation.

 Provided your PC locale settings are fr_FR and you are using the WAR
 provided in the Guvnor distribution you should see French already.

 Alternatively, you can override your PC's locale by providing the locale
 in the URL; e.g. http://www.example.org/myapp.html?locale=fr_FR

 I know of one community user who has been using fr_FR for sometime.

 On 12 February 2012 15:08, Mauricio Salatino sala...@gmail.com wrote:

 You should provide a translated to french properties file and the
 compile it against that language. Some of the guvnor guys should point
 you to where that localization properties file is inside the drools
 guvnor source code.
 Cheers

 2012/2/12 freelance developpement developpement.freela...@gmail.com:
  Hi every one,
 
  For simplicity  I must make the interface Guvnor for administration of
  business rules, in French and not English under Internet Explorer or
  Firefox.
 
  Have you ant idea?
 
  thanx in advance
 
  ___
  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.jugargentina.org
  - 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



 ___
 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 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] Call of a function in the definition of a rule template

2012-02-13 Thread Wolfgang Laun
It is not so easy to create rules programmatically (if that's what you
mean).

You could use the experimental (unstable) fluent API (see 2.2.2.6. Rule
API in the Drools Introduction and General User Guide), but this is a
rather inconvenient way of accumulating strings to create a package. I'd
rather create a String and feed the DRL compiler with it, but YMMV.

-W



2012/2/13 freelance developpement developpement.freela...@gmail.com

 Hi every one,

 I defined a function in Guvnor and I want to call it to define a rule
 template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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] Call of a function in the definition of a rule template

2012-02-13 Thread freelance developpement
I have not understood your answer, what I meant was ,for example i had a
program function that returns me the max and I want to make it available to one
who will create the business rule .It goes like that when access to the
creation of a new rule template and not technical (he knows not to
programming) it will use this function already defined in the create new
Function.

please do you know how to make this call?

thanks in advance

2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 It is not so easy to create rules programmatically (if that's what you
 mean).

 You could use the experimental (unstable) fluent API (see 2.2.2.6. Rule
 API in the Drools Introduction and General User Guide), but this is a
 rather inconvenient way of accumulating strings to create a package. I'd
 rather create a String and feed the DRL compiler with it, but YMMV.

 -W



 2012/2/13 freelance developpement developpement.freela...@gmail.com

 Hi every one,

  I defined a function in Guvnor and I want to call it to define a rule
 template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Call of a function in the definition of a rule template

2012-02-13 Thread Wolfgang Laun
2012/2/13 freelance developpement developpement.freela...@gmail.com

 I have not understood your answer, what I meant was ,for example i had a
 program function


Do you mean a public static method in some Java Class?

You should be able to define an import function, even in Guvnor.

-W

utiliser une fonction dans une rule n'est pas appeler une fonction pour
d´efiner une rule





 that returns me the max and I want to make it available to one who will
 create the business rule .It goes like that when access to the creation of
 a new rule template and not technical (he knows not to programming) it
 will use this function already defined in the create new Function.

 please do you know how to make this call?

 thanks in advance


 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 It is not so easy to create rules programmatically (if that's what you
 mean).

 You could use the experimental (unstable) fluent API (see 2.2.2.6. Rule
 API in the Drools Introduction and General User Guide), but this is a
 rather inconvenient way of accumulating strings to create a package. I'd
 rather create a String and feed the DRL compiler with it, but YMMV.

 -W



 2012/2/13 freelance developpement developpement.freela...@gmail.com

 Hi every one,

  I defined a function in Guvnor and I want to call it to define a rule
 template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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 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] Call of a function in the definition of a rule template

2012-02-13 Thread freelance developpement
No it's not a method defined in a java class, but it is a function defined
in Guvnor using the Create new function.

I want to call this function  when I am trying to define a rule template.

2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 2012/2/13 freelance developpement developpement.freela...@gmail.com

 I have not understood your answer, what I meant was ,for example i had a
 program function


 Do you mean a public static method in some Java Class?

 You should be able to define an import function, even in Guvnor.

 -W

 utiliser une fonction dans une rule n'est pas appeler une fonction pour
 d´efiner une rule





 that returns me the max and I want to make it available to one who will
 create the business rule .It goes like that when access to the creation
 of a new rule template and not technical (he knows not to programming) it
 will use this function already defined in the create new Function.

 please do you know how to make this call?

 thanks in advance


 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 It is not so easy to create rules programmatically (if that's what you
 mean).

 You could use the experimental (unstable) fluent API (see 2.2.2.6. Rule
 API in the Drools Introduction and General User Guide), but this is a
 rather inconvenient way of accumulating strings to create a package. I'd
 rather create a String and feed the DRL compiler with it, but YMMV.

 -W



 2012/2/13 freelance developpement developpement.freela...@gmail.com

 Hi every one,

  I defined a function in Guvnor and I want to call it to define a rule
 template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] make the Guvnor interface into French

2012-02-13 Thread Michael Anstis
If your browser's locale is fr_FR and you are using the Guvnor WAR
from herehttp://www.jboss.org/drools/downloadsyou should already see
the French version.

If your browser locale is not fr_FR you can still access the French UI by
appending ?locale=fr_FR to your URL.

Your browser's locale should be inherited from your PC's settings.

2012/2/13 freelance developpement developpement.freela...@gmail.com

 hi
  Michael Anstis,
Can you tell me in detail how to make the interface in French, it is
 urgent and I have not understood your answer.

 Thanks in advance.

 2012/2/12 Michael Anstis michael.ans...@gmail.com

 Translations are always welcome :)

 If you can ensure translations are up to date (there have been many more
 additions to master) I can push the file for you.

 Thanks,

 Mike

 sent on the move

 On 12 Feb 2012 20:59, Vincent LEGENDRE 
 vincent.legen...@eurodecision.com wrote:

 Yes, there is me !
 I even have a fresh newly updated french file (for 5.3.0.Final version),
 as the one in actual guvnor date from my last translation for 5.1 (parts
 are french, parts are english, which does not look very good).

 I was thinking of updating the former JIRA with the new file ?
 Should I create a new JIRA ?
 Can I simply post here and you make the git push ?
 Do I really need to fork the git repo for that ?


 --
  *De: *Michael Anstis michael.ans...@gmail.com
 *À: *Rules Users List rules-users@lists.jboss.org
 *Envoyé: *Dimanche 12 Février 2012 17:34:15
 *Objet: *Re: [rules-users] make the Guvnor interface into French

 Guvnor comes with a fr_FR locale translation.

 Provided your PC locale settings are fr_FR and you are using the WAR
 provided in the Guvnor distribution you should see French already.

 Alternatively, you can override your PC's locale by providing the locale
 in the URL; e.g. http://www.example.org/myapp.html?locale=fr_FR

 I know of one community user who has been using fr_FR for sometime.

 On 12 February 2012 15:08, Mauricio Salatino sala...@gmail.com wrote:

 You should provide a translated to french properties file and the
 compile it against that language. Some of the guvnor guys should point
 you to where that localization properties file is inside the drools
 guvnor source code.
 Cheers

 2012/2/12 freelance developpement developpement.freela...@gmail.com:
  Hi every one,
 
  For simplicity  I must make the interface Guvnor for administration of
  business rules, in French and not English under Internet Explorer or
  Firefox.
 
  Have you ant idea?
 
  thanx in advance
 
  ___
  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.jugargentina.org
  - 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



 ___
 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 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] make the Guvnor interface into French

2012-02-13 Thread Esteban Aliverti
As Michael said, Guvnor already has French support. All you have to do is
to configure your browser to use French or to append
?locale=fr_FRhttp://www.example.org/myapp.html?locale=fr_FR
in Guvnor's URL.

@Vincent, if you don't want to do a clone-fork-pull-request you can post
the file here.

Best Regards,



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


2012/2/13 freelance developpement developpement.freela...@gmail.com

 hi
  Michael Anstis,
Can you tell me in detail how to make the interface in French, it is
 urgent and I have not understood your answer.

 Thanks in advance.

 2012/2/12 Michael Anstis michael.ans...@gmail.com

 Translations are always welcome :)

 If you can ensure translations are up to date (there have been many more
 additions to master) I can push the file for you.

 Thanks,

 Mike

 sent on the move

 On 12 Feb 2012 20:59, Vincent LEGENDRE 
 vincent.legen...@eurodecision.com wrote:

 Yes, there is me !
 I even have a fresh newly updated french file (for 5.3.0.Final version),
 as the one in actual guvnor date from my last translation for 5.1 (parts
 are french, parts are english, which does not look very good).

 I was thinking of updating the former JIRA with the new file ?
 Should I create a new JIRA ?
 Can I simply post here and you make the git push ?
 Do I really need to fork the git repo for that ?


 --
  *De: *Michael Anstis michael.ans...@gmail.com
 *À: *Rules Users List rules-users@lists.jboss.org
 *Envoyé: *Dimanche 12 Février 2012 17:34:15
 *Objet: *Re: [rules-users] make the Guvnor interface into French

 Guvnor comes with a fr_FR locale translation.

 Provided your PC locale settings are fr_FR and you are using the WAR
 provided in the Guvnor distribution you should see French already.

 Alternatively, you can override your PC's locale by providing the locale
 in the URL; e.g. http://www.example.org/myapp.html?locale=fr_FR

 I know of one community user who has been using fr_FR for sometime.

 On 12 February 2012 15:08, Mauricio Salatino sala...@gmail.com wrote:

 You should provide a translated to french properties file and the
 compile it against that language. Some of the guvnor guys should point
 you to where that localization properties file is inside the drools
 guvnor source code.
 Cheers

 2012/2/12 freelance developpement developpement.freela...@gmail.com:
  Hi every one,
 
  For simplicity  I must make the interface Guvnor for administration of
  business rules, in French and not English under Internet Explorer or
  Firefox.
 
  Have you ant idea?
 
  thanx in advance
 
  ___
  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.jugargentina.org
  - 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



 ___
 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 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Call of a function in the definition of a rule template

2012-02-13 Thread Michael Anstis
Your best bet would be to use a free-form DRL fragment in the Template UI
and call the function as you would using DRL.

Alternatively, feel free to look at
https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :)

2012/2/13 freelance developpement developpement.freela...@gmail.com

 No it's not a method defined in a java class, but it is a function defined
 in Guvnor using the Create new function.

 I want to call this function  when I am trying to define a rule template.

 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 2012/2/13 freelance developpement developpement.freela...@gmail.com

 I have not understood your answer, what I meant was ,for example i had a
 program function


 Do you mean a public static method in some Java Class?

 You should be able to define an import function, even in Guvnor.

 -W

 utiliser une fonction dans une rule n'est pas appeler une fonction
 pour d´efiner une rule





 that returns me the max and I want to make it available to one who will
 create the business rule .It goes like that when access to the creation
 of a new rule template and not technical (he knows not to programming) it
 will use this function already defined in the create new Function.

 please do you know how to make this call?

 thanks in advance


 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 It is not so easy to create rules programmatically (if that's what you
 mean).

 You could use the experimental (unstable) fluent API (see 2.2.2.6. Rule
 API in the Drools Introduction and General User Guide), but this is a
 rather inconvenient way of accumulating strings to create a package. I'd
 rather create a String and feed the DRL compiler with it, but YMMV.

 -W



 2012/2/13 freelance developpement developpement.freela...@gmail.com

 Hi every one,

  I defined a function in Guvnor and I want to call it to define a rule
 template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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 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 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] Call of a function in the definition of a rule template

2012-02-13 Thread Esteban Aliverti
If you are dealing with non-technical people, maybe you could also use a
DSL sentence to hide the function call.

Best Regards,



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


2012/2/13 Michael Anstis michael.ans...@gmail.com

 Your best bet would be to use a free-form DRL fragment in the Template UI
 and call the function as you would using DRL.

 Alternatively, feel free to look at
 https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :)


 2012/2/13 freelance developpement developpement.freela...@gmail.com

 No it's not a method defined in a java class, but it is a function
 defined in Guvnor using the Create new function.

 I want to call this function  when I am trying to define a rule template.

 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 2012/2/13 freelance developpement developpement.freela...@gmail.com

 I have not understood your answer, what I meant was ,for example i had
 a program function


 Do you mean a public static method in some Java Class?

 You should be able to define an import function, even in Guvnor.

 -W

 utiliser une fonction dans une rule n'est pas appeler une fonction
 pour d´efiner une rule





 that returns me the max and I want to make it available to one who will
 create the business rule .It goes like that when access to the
 creation of a new rule template and not technical (he knows not to
 programming) it will use this function already defined in the create new
 Function.

 please do you know how to make this call?

 thanks in advance


 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 It is not so easy to create rules programmatically (if that's what you
 mean).

 You could use the experimental (unstable) fluent API (see 2.2.2.6. Rule
 API in the Drools Introduction and General User Guide), but this is a
 rather inconvenient way of accumulating strings to create a package. I'd
 rather create a String and feed the DRL compiler with it, but YMMV.

 -W



 2012/2/13 freelance developpement developpement.freela...@gmail.com

 Hi every one,

  I defined a function in Guvnor and I want to call it to define a
 rule template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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 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 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] make the Guvnor interface into French

2012-02-13 Thread freelance developpement
thanks for your response.
But how can i know if my browser's locale is fr_FR ?

thanks in advance

2012/2/13 Michael Anstis michael.ans...@gmail.com

 If your browser's locale is fr_FR and you are using the Guvnor WAR from
 here http://www.jboss.org/drools/downloads you should already see the
 French version.

 If your browser locale is not fr_FR you can still access the French UI by
 appending ?locale=fr_FR to your URL.

 Your browser's locale should be inherited from your PC's settings.


 2012/2/13 freelance developpement developpement.freela...@gmail.com

 hi
  Michael Anstis,
Can you tell me in detail how to make the interface in French, it is
 urgent and I have not understood your answer.

 Thanks in advance.

 2012/2/12 Michael Anstis michael.ans...@gmail.com

 Translations are always welcome :)

 If you can ensure translations are up to date (there have been many more
 additions to master) I can push the file for you.

 Thanks,

 Mike

 sent on the move

 On 12 Feb 2012 20:59, Vincent LEGENDRE 
 vincent.legen...@eurodecision.com wrote:

 Yes, there is me !
 I even have a fresh newly updated french file (for 5.3.0.Final
 version), as the one in actual guvnor date from my last translation for 5.1
 (parts are french, parts are english, which does not look very good).

 I was thinking of updating the former JIRA with the new file ?
 Should I create a new JIRA ?
 Can I simply post here and you make the git push ?
 Do I really need to fork the git repo for that ?


 --
  *De: *Michael Anstis michael.ans...@gmail.com
 *À: *Rules Users List rules-users@lists.jboss.org
 *Envoyé: *Dimanche 12 Février 2012 17:34:15
 *Objet: *Re: [rules-users] make the Guvnor interface into French

 Guvnor comes with a fr_FR locale translation.

 Provided your PC locale settings are fr_FR and you are using the WAR
 provided in the Guvnor distribution you should see French already.

 Alternatively, you can override your PC's locale by providing the
 locale in the URL; e.g. http://www.example.org/myapp.html?locale=fr_FR

 I know of one community user who has been using fr_FR for sometime.

 On 12 February 2012 15:08, Mauricio Salatino sala...@gmail.com wrote:

 You should provide a translated to french properties file and the
 compile it against that language. Some of the guvnor guys should point
 you to where that localization properties file is inside the drools
 guvnor source code.
 Cheers

 2012/2/12 freelance developpement developpement.freela...@gmail.com:
  Hi every one,
 
  For simplicity  I must make the interface Guvnor for administration
 of
  business rules, in French and not English under Internet Explorer or
  Firefox.
 
  Have you ant idea?
 
  thanx in advance
 
  ___
  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.jugargentina.org
  - 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



 ___
 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 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 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] Call of a function in the definition of a rule template

2012-02-13 Thread Michael Anstis
DSL's don't support Template keys though...
https://issues.jboss.org/browse/GUVNOR-1799

But, if you don't need that, then +1 - DSLs can hide the function call.

2012/2/13 Esteban Aliverti esteban.alive...@gmail.com

 If you are dealing with non-technical people, maybe you could also use a
 DSL sentence to hide the function call.

 Best Regards,

 

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



 2012/2/13 Michael Anstis michael.ans...@gmail.com

 Your best bet would be to use a free-form DRL fragment in the Template UI
 and call the function as you would using DRL.

 Alternatively, feel free to look at
 https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :)


 2012/2/13 freelance developpement developpement.freela...@gmail.com

 No it's not a method defined in a java class, but it is a function
 defined in Guvnor using the Create new function.

 I want to call this function  when I am trying to define a rule
 template.

 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 2012/2/13 freelance developpement developpement.freela...@gmail.com

 I have not understood your answer, what I meant was ,for example i
 had a program function


 Do you mean a public static method in some Java Class?

 You should be able to define an import function, even in Guvnor.

 -W

 utiliser une fonction dans une rule n'est pas appeler une fonction
 pour d´efiner une rule





 that returns me the max and I want to make it available to one who will
 create the business rule .It goes like that when access to the
 creation of a new rule template and not technical (he knows not to
 programming) it will use this function already defined in the create new
 Function.

 please do you know how to make this call?

 thanks in advance


 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 It is not so easy to create rules programmatically (if that's what
 you mean).

 You could use the experimental (unstable) fluent API (see 2.2.2.6. Rule
 API in the Drools Introduction and General User Guide), but this is a
 rather inconvenient way of accumulating strings to create a package. I'd
 rather create a String and feed the DRL compiler with it, but YMMV.

 -W



 2012/2/13 freelance developpement developpement.freela...@gmail.com

 Hi every one,

  I defined a function in Guvnor and I want to call it to define a
 rule template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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 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 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 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] Call of a function in the definition of a rule template

2012-02-13 Thread freelance developpement
thanks for your help

Michael Anstis
 can you give me an example of calling a function in fragment drl?
 the link does not contain enough detail

thanks in advance
2012/2/13 Michael Anstis michael.ans...@gmail.com

 DSL's don't support Template keys though...
 https://issues.jboss.org/browse/GUVNOR-1799

 But, if you don't need that, then +1 - DSLs can hide the function call.


 2012/2/13 Esteban Aliverti esteban.alive...@gmail.com

 If you are dealing with non-technical people, maybe you could also use a
 DSL sentence to hide the function call.

 Best Regards,

 

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



 2012/2/13 Michael Anstis michael.ans...@gmail.com

 Your best bet would be to use a free-form DRL fragment in the Template
 UI and call the function as you would using DRL.

 Alternatively, feel free to look at
 https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :)


 2012/2/13 freelance developpement developpement.freela...@gmail.com

 No it's not a method defined in a java class, but it is a function
 defined in Guvnor using the Create new function.

 I want to call this function  when I am trying to define a rule
 template.

 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 2012/2/13 freelance developpement developpement.freela...@gmail.com

 I have not understood your answer, what I meant was ,for example i
 had a program function


 Do you mean a public static method in some Java Class?

 You should be able to define an import function, even in Guvnor.

 -W

 utiliser une fonction dans une rule n'est pas appeler une fonction
 pour d´efiner une rule





 that returns me the max and I want to make it available to one who will
 create the business rule .It goes like that when access to the
 creation of a new rule template and not technical (he knows not to
 programming) it will use this function already defined in the create new
 Function.

 please do you know how to make this call?

 thanks in advance


 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 It is not so easy to create rules programmatically (if that's what
 you mean).

 You could use the experimental (unstable) fluent API (see 2.2.2.6. 
 Rule
 API in the Drools Introduction and General User Guide), but this is a
 rather inconvenient way of accumulating strings to create a package. I'd
 rather create a String and feed the DRL compiler with it, but YMMV.

 -W



 2012/2/13 freelance developpement developpement.freela...@gmail.com
 

 Hi every one,

  I defined a function in Guvnor and I want to call it to define a
 rule template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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 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 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 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Call of a function in the definition of a rule template

2012-02-13 Thread Michael Anstis
The Drools Expert user-guide gives details (for calling from the RHS).

2012/2/13 freelance developpement developpement.freela...@gmail.com

 thanks for your help

  Michael Anstis
can you give me an example of calling a function in fragment drl?
the link does not contain enough detail

 thanks in advance
 2012/2/13 Michael Anstis michael.ans...@gmail.com

 DSL's don't support Template keys though...
 https://issues.jboss.org/browse/GUVNOR-1799

 But, if you don't need that, then +1 - DSLs can hide the function call.


 2012/2/13 Esteban Aliverti esteban.alive...@gmail.com

 If you are dealing with non-technical people, maybe you could also use a
 DSL sentence to hide the function call.

 Best Regards,

 

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



 2012/2/13 Michael Anstis michael.ans...@gmail.com

 Your best bet would be to use a free-form DRL fragment in the Template
 UI and call the function as you would using DRL.

 Alternatively, feel free to look at
 https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request
 :)


 2012/2/13 freelance developpement developpement.freela...@gmail.com

 No it's not a method defined in a java class, but it is a function
 defined in Guvnor using the Create new function.

 I want to call this function  when I am trying to define a rule
 template.

 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 2012/2/13 freelance developpement developpement.freela...@gmail.com

 I have not understood your answer, what I meant was ,for example i
 had a program function


 Do you mean a public static method in some Java Class?

 You should be able to define an import function, even in Guvnor.

 -W

 utiliser une fonction dans une rule n'est pas appeler une fonction
 pour d´efiner une rule





 that returns me the max and I want to make it available to one who will
 create the business rule .It goes like that when access to the
 creation of a new rule template and not technical (he knows not to
 programming) it will use this function already defined in the 
 create new Function.

 please do you know how to make this call?

 thanks in advance


 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 It is not so easy to create rules programmatically (if that's what
 you mean).

 You could use the experimental (unstable) fluent API (see 2.2.2.6. 
 Rule
 API in the Drools Introduction and General User Guide), but this is a
 rather inconvenient way of accumulating strings to create a package. 
 I'd
 rather create a String and feed the DRL compiler with it, but YMMV.

 -W



 2012/2/13 freelance developpement 
 developpement.freela...@gmail.com

 Hi every one,

  I defined a function in Guvnor and I want to call it to define a
 rule template. But I do not know how.

 Have you any ideas?
 Thank you in advance

 ___
 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 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 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 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 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] (no subject)

2012-02-13 Thread Alberto R. Galdo
According to the documentation:

Rule constraints do not have direct access to variables defined inside the
 process.
 It is however possible to refer to the current process instance inside a
 rule constraint,
 by adding the process instance to the Working Memory and matching for the
 process instance in your rule constraint.
 We have added special logic to make sure that a variable processInstance
 of type WorkflowProcessInstance
 will only match to the current process instance and not to other process
 instances in the Working Memory.
 Note that you are however responsible yourself to insert the process
 instance into the session and,
 possibly, to update it, for example, using Java code or an on-entry or
 on-exit or explicit action in your process.
 The following example of a rule constraint will search for a person with
 the same name as the value stored in the variable name of the process:



This however does not seem to be true.

The first rule is to receive a stream of objects of type MyObject.
This rule starts an associated process.

The second rule will be called by the process (from bpmn).

Within the process there a task that invokes an an asynchronous service, ie,
an implementation of WorkItemHandler that contains a Thread that will set
call
manager.completeWorkItem(workItemId,results);
when 30s have passed).

With this setup we can observe what happens when 2 MyObject instances come
into the first rule separated by a short period of time (say 5 seconds).

When the first object comes in a process is created and started (with
process id=1)
The process passes from the start node to the callMyTask node, which
invokes the slow WorkItemHandler references by MyTask
(which we have previously registered into session.getWorkItemManager() ).
Because the WorkItemHandler has a thread that waits 30s before completing
the work item, it just sits there doing nothing (so far everything is ok)
and allows the engine to process other events.

5 seconds later we insert another MyObject into the stream.
The first rule gets fired and created another process (with process id=2).
The process passes from the start node to the callMyTask node, which invoke
our slow service.

We have thus two processes running in parallel.

When the first callMyTask node completes, the next node completeTask is
invoked.

The rule process complete is matched as it belongs to the rule flow group
Complete task group.

At this point we observe that the rule is matched twice spitting out:

processInstance.id 2
processInstance.id 1
.
So the rule has matched both process instances that are in working memory
and not just the one (with process id 1)
that called the process complete rule.



The rule file
-

rule New case
when
$myobject : MyObject(processed==false) from entry-point myobject
stream
then
ProcessInstance
processInstance=kcontext.getKnowledgeRuntime().createProcessInstance(com.mycompany.process.MyProcess,
parameters);
insert(processInstance);

kcontext.getKnowledgeRuntime().startProcessInstance(processInstance.getId());
modify ($myobject){
setProcessed(true)
}
end

rule process complete
ruleflow-group Complete task group
no-loop true
when
$processInstance: WorkflowProcessInstance()
then
System.out.println(processInstance.id  +
$processInstance.getId());
end


The BPMN xml


?xml version=1.0 encoding=UTF-8?
definitions id=Definition
 targetNamespace=http://www.jboss.org/drools;
 typeLanguage=http://www.java.com/javaTypes;
 expressionLanguage=http://www.mvel.org/2.0;
 xmlns=http://www.omg.org/spec/BPMN/20100524/MODEL;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 
xsi:schemaLocation=http://www.omg.org/spec/BPMN/20100524/MODELBPMN20.xsd;
 xmlns:g=http://www.jboss.org/drools/flow/gpd;
 xmlns:bpmndi=http://www.omg.org/spec/BPMN/20100524/DI;
 xmlns:dc=http://www.omg.org/spec/DD/20100524/DC;
 xmlns:di=http://www.omg.org/spec/DD/20100524/DI;
 xmlns:tns=http://www.jboss.org/drools;

process processType=Private isExecutable=true
id=com.mycompany.process.MyProcess name=my process 

!-- process variables --

!-- nodes --
startEvent id=start name=StartProcess /

task id=callMyTask name=call my task tns:taskName=MyTask 
ioSpecification
/ioSpecification
/task


businessRuleTask id=completeTask name=Complete slow task
g:ruleFlowGroup=Complete task group 
/businessRuleTask

endEvent id=end name=EndProcess /

!-- connections --
sequenceFlow id=start-callMyTask sourceRef=start
targetRef=callMyTask /
sequenceFlow id=callMyTask-completeTask sourceRef=callMyTask
targetRef=completeTask /
sequenceFlow id=completeTask-end sourceRef=completeTask
targetRef=end /

Re: [rules-users] (no subject)

2012-02-13 Thread Esteban Aliverti
I had some tests working fine in jbpm 5.1 but failing in 5.3 because of
this same reason. I'm not sure if this is this is a regression bug or if
there is a deliberated change in the behavior.
Maybe someone in the jbpm dev team can shed some light here.

Best Regards,



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


2012/2/13 Alberto R. Galdo arga...@gmail.com


 According to the documentation:

 Rule constraints do not have direct access to variables defined inside
 the process.
 It is however possible to refer to the current process instance inside a
 rule constraint,
 by adding the process instance to the Working Memory and matching for the
 process instance in your rule constraint.
 We have added special logic to make sure that a variable processInstance
 of type WorkflowProcessInstance
 will only match to the current process instance and not to other process
 instances in the Working Memory.
 Note that you are however responsible yourself to insert the process
 instance into the session and,
 possibly, to update it, for example, using Java code or an on-entry or
 on-exit or explicit action in your process.
 The following example of a rule constraint will search for a person with
 the same name as the value stored in the variable name of the process:



 This however does not seem to be true.

 The first rule is to receive a stream of objects of type MyObject.
 This rule starts an associated process.

 The second rule will be called by the process (from bpmn).

 Within the process there a task that invokes an an asynchronous service,
 ie,
 an implementation of WorkItemHandler that contains a Thread that will set
 call
 manager.completeWorkItem(workItemId,results);
 when 30s have passed).

 With this setup we can observe what happens when 2 MyObject instances come
 into the first rule separated by a short period of time (say 5 seconds).

 When the first object comes in a process is created and started (with
 process id=1)
 The process passes from the start node to the callMyTask node, which
 invokes the slow WorkItemHandler references by MyTask
 (which we have previously registered into session.getWorkItemManager() ).
 Because the WorkItemHandler has a thread that waits 30s before completing
 the work item, it just sits there doing nothing (so far everything is ok)
 and allows the engine to process other events.

 5 seconds later we insert another MyObject into the stream.
 The first rule gets fired and created another process (with process id=2).
 The process passes from the start node to the callMyTask node, which
 invoke our slow service.

 We have thus two processes running in parallel.

 When the first callMyTask node completes, the next node completeTask is
 invoked.

 The rule process complete is matched as it belongs to the rule flow
 group Complete task group.

 At this point we observe that the rule is matched twice spitting out:

 processInstance.id 2
 processInstance.id 1
 .
 So the rule has matched both process instances that are in working memory
 and not just the one (with process id 1)
 that called the process complete rule.



 The rule file
 -

 rule New case
 when
 $myobject : MyObject(processed==false) from entry-point myobject
 stream
 then
 ProcessInstance
 processInstance=kcontext.getKnowledgeRuntime().createProcessInstance(com.mycompany.process.MyProcess,
 parameters);
 insert(processInstance);

 kcontext.getKnowledgeRuntime().startProcessInstance(processInstance.getId());
 modify ($myobject){
 setProcessed(true)
 }
 end

 rule process complete
 ruleflow-group Complete task group
 no-loop true
 when
 $processInstance: WorkflowProcessInstance()
 then
 System.out.println(processInstance.id  +
 $processInstance.getId());
 end


 The BPMN xml
 

 ?xml version=1.0 encoding=UTF-8?
 definitions id=Definition
  targetNamespace=http://www.jboss.org/drools;
  typeLanguage=http://www.java.com/javaTypes;
  expressionLanguage=http://www.mvel.org/2.0;
  xmlns=http://www.omg.org/spec/BPMN/20100524/MODEL;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=
 http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd
  xmlns:g=http://www.jboss.org/drools/flow/gpd;
  xmlns:bpmndi=http://www.omg.org/spec/BPMN/20100524/DI;
  xmlns:dc=http://www.omg.org/spec/DD/20100524/DC;
  xmlns:di=http://www.omg.org/spec/DD/20100524/DI;
  xmlns:tns=http://www.jboss.org/drools;

 process processType=Private isExecutable=true
 id=com.mycompany.process.MyProcess name=my process 

 !-- process variables --

 !-- nodes --
 startEvent id=start name=StartProcess /

 task id=callMyTask name=call my task 

Re: [rules-users] (no subject)

2012-02-13 Thread Alberto R. Galdo
We're using 5.2.0 final here.

What we are also observing is that whenever a process instance reaches a
businessruletask node the rule gets fired a number of times equal to the
number of instantiated processes even if any of those processes didn't
reach the bussinessruletask node.

Does this means that whenever a businessruletask is reached in any of the
current process instance, the rule gets fired for *all* the instances of
the process and subsequent businessruletask nodes won't fire anything?



2012/2/13 Esteban Aliverti esteban.alive...@gmail.com

 I had some tests working fine in jbpm 5.1 but failing in 5.3 because of
 this same reason. I'm not sure if this is this is a regression bug or if
 there is a deliberated change in the behavior.
 Maybe someone in the jbpm dev team can shed some light here.

 Best Regards,

 

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


 2012/2/13 Alberto R. Galdo arga...@gmail.com


 According to the documentation:

 Rule constraints do not have direct access to variables defined inside
 the process.
 It is however possible to refer to the current process instance inside a
 rule constraint,
 by adding the process instance to the Working Memory and matching for
 the process instance in your rule constraint.
 We have added special logic to make sure that a variable processInstance
 of type WorkflowProcessInstance
 will only match to the current process instance and not to other process
 instances in the Working Memory.
 Note that you are however responsible yourself to insert the process
 instance into the session and,
 possibly, to update it, for example, using Java code or an on-entry or
 on-exit or explicit action in your process.
 The following example of a rule constraint will search for a person with
 the same name as the value stored in the variable name of the process:



 This however does not seem to be true.

 The first rule is to receive a stream of objects of type MyObject.
 This rule starts an associated process.

 The second rule will be called by the process (from bpmn).

 Within the process there a task that invokes an an asynchronous service,
 ie,
 an implementation of WorkItemHandler that contains a Thread that will set
 call
 manager.completeWorkItem(workItemId,results);
 when 30s have passed).

 With this setup we can observe what happens when 2 MyObject instances
 come into the first rule separated by a short period of time (say 5
 seconds).

 When the first object comes in a process is created and started (with
 process id=1)
 The process passes from the start node to the callMyTask node, which
 invokes the slow WorkItemHandler references by MyTask
 (which we have previously registered into session.getWorkItemManager() ).
 Because the WorkItemHandler has a thread that waits 30s before completing
 the work item, it just sits there doing nothing (so far everything is ok)
 and allows the engine to process other events.

 5 seconds later we insert another MyObject into the stream.
 The first rule gets fired and created another process (with process id=2).
 The process passes from the start node to the callMyTask node, which
 invoke our slow service.

 We have thus two processes running in parallel.

 When the first callMyTask node completes, the next node completeTask is
 invoked.

 The rule process complete is matched as it belongs to the rule flow
 group Complete task group.

 At this point we observe that the rule is matched twice spitting out:

 processInstance.id 2
 processInstance.id 1
 .
 So the rule has matched both process instances that are in working memory
 and not just the one (with process id 1)
 that called the process complete rule.



 The rule file
 -

 rule New case
 when
 $myobject : MyObject(processed==false) from entry-point myobject
 stream
 then
 ProcessInstance
 processInstance=kcontext.getKnowledgeRuntime().createProcessInstance(com.mycompany.process.MyProcess,
 parameters);
 insert(processInstance);

 kcontext.getKnowledgeRuntime().startProcessInstance(processInstance.getId());
 modify ($myobject){
 setProcessed(true)
 }
 end

 rule process complete
 ruleflow-group Complete task group
 no-loop true
 when
 $processInstance: WorkflowProcessInstance()
 then
 System.out.println(processInstance.id  +
 $processInstance.getId());
 end


 The BPMN xml
 

 ?xml version=1.0 encoding=UTF-8?
 definitions id=Definition
  targetNamespace=http://www.jboss.org/drools;
  typeLanguage=http://www.java.com/javaTypes;
  expressionLanguage=http://www.mvel.org/2.0;
  xmlns=http://www.omg.org/spec/BPMN/20100524/MODEL;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=
 http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd

Re: [rules-users] (no subject)

2012-02-13 Thread Esteban Aliverti
The behavior you described is how it is working in 5.3 (and it seems 5.2
too). The rule is fired once per process instance you have in your working
memory no matter if the others instances are, are not yet or even has
already been in that Rule Task Node. Again, I'm not sure if this is a
deliberated feature or a bug, but according to the documentation, it is a
bug.
One workaround could be that the process inserts a control fact containing
its own id right before the Task Node is ejecuted (this could be done in  a
listener or in the on-entry action property of the node).
Your rule then will look like this:

rule process complete
ruleflow-group Complete task group
when
$ControlFact($id: processIntanceId)
$processInstance: WorkflowProcessInstance(instanceId == $id)
then
System.out.println(processInstance.id  +
$processInstance.getId());
retract ($id)
end

Best Regards,




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


2012/2/13 Alberto R. Galdo arga...@gmail.com

 We're using 5.2.0 final here.

 What we are also observing is that whenever a process instance reaches a
 businessruletask node the rule gets fired a number of times equal to the
 number of instantiated processes even if any of those processes didn't
 reach the bussinessruletask node.

 Does this means that whenever a businessruletask is reached in any of the
 current process instance, the rule gets fired for *all* the instances of
 the process and subsequent businessruletask nodes won't fire anything?




 2012/2/13 Esteban Aliverti esteban.alive...@gmail.com

 I had some tests working fine in jbpm 5.1 but failing in 5.3 because of
 this same reason. I'm not sure if this is this is a regression bug or if
 there is a deliberated change in the behavior.
 Maybe someone in the jbpm dev team can shed some light here.

 Best Regards,

 

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


 2012/2/13 Alberto R. Galdo arga...@gmail.com


 According to the documentation:

 Rule constraints do not have direct access to variables defined inside
 the process.
 It is however possible to refer to the current process instance inside
 a rule constraint,
 by adding the process instance to the Working Memory and matching for
 the process instance in your rule constraint.
 We have added special logic to make sure that a variable
 processInstance of type WorkflowProcessInstance
 will only match to the current process instance and not to other
 process instances in the Working Memory.
 Note that you are however responsible yourself to insert the process
 instance into the session and,
 possibly, to update it, for example, using Java code or an on-entry or
 on-exit or explicit action in your process.
 The following example of a rule constraint will search for a person
 with the same name as the value stored in the variable name of the
 process:



 This however does not seem to be true.

 The first rule is to receive a stream of objects of type MyObject.
 This rule starts an associated process.

 The second rule will be called by the process (from bpmn).

 Within the process there a task that invokes an an asynchronous service,
 ie,
 an implementation of WorkItemHandler that contains a Thread that will
 set call
 manager.completeWorkItem(workItemId,results);
 when 30s have passed).

 With this setup we can observe what happens when 2 MyObject instances
 come into the first rule separated by a short period of time (say 5
 seconds).

 When the first object comes in a process is created and started (with
 process id=1)
 The process passes from the start node to the callMyTask node, which
 invokes the slow WorkItemHandler references by MyTask
 (which we have previously registered into session.getWorkItemManager()
 ).
 Because the WorkItemHandler has a thread that waits 30s before
 completing the work item, it just sits there doing nothing (so far
 everything is ok)
 and allows the engine to process other events.

 5 seconds later we insert another MyObject into the stream.
 The first rule gets fired and created another process (with process
 id=2).
 The process passes from the start node to the callMyTask node, which
 invoke our slow service.

 We have thus two processes running in parallel.

 When the first callMyTask node completes, the next node completeTask is
 invoked.

 The rule process complete is matched as it belongs to the rule flow
 group Complete task group.

 At this point we observe that the rule is matched twice spitting out:

 processInstance.id 2
 processInstance.id 1
 .
 So the rule has matched both process instances that are in working
 memory and not just the one (with process id 1)
 that called the process complete rule.



 The rule file
 -

 rule New case
 when
 $myobject : MyObject(processed==false) from 

Re: [rules-users] Performance scaling with fact insertion

2012-02-13 Thread Wolfgang Laun
There's several things to be noted with the way you've set up these tests.

(1) You run all tests (Logical, Manual, Modify) with all three rules being
in the KnowledgeBase. This means that all insertions result in the creation
of activations for all three rules while firings are restricted using the
agenda filter.

(2) I suppose that you ran the tests, one after the other, as one usually
does using Eclipse/JUnit. It's cleaner to do one test in a single run,
preferably not inside Eclipse.

(3) You should be able to control -Xms and -Xmx from the command line, to
see how heap size increments affect execution times.

(4) Insert facts from Java: This lets you distinguish between the time
required for inserting (i.e., evaluating the conditions and creatign the
agenda) and firing.

Below are the times I've measured using -Xms2048M -Xmx2048M and three DRLs
containing just one rule each.

Test com/rules/PerfTestManual.drl
10 inserted = 0.245
10 fired= 0.282
Test com/rules/PerfTestManual.drl
20 inserted = 0.434
20 fired= 0.546
Test com/rules/PerfTestManual.drl
30 inserted = 0.607
30 fired= 0.863
Test com/rules/PerfTestManual.drl
40 inserted = 0.828
40 fired= 1.557
Test com/rules/PerfTestManual.drl
50 inserted = 1.017
50 fired= 1.838
Test com/rules/PerfTestLogical.drl
10 inserted = 0.229
10 fired= 0.300
Test com/rules/PerfTestLogical.drl
20 inserted = 0.435
20 fired= 0.558
Test com/rules/PerfTestLogical.drl
30 inserted = 0.560
30 fired= 0.716
Test com/rules/PerfTestLogical.drl
40 inserted = 0.835
40 fired= 1.699
Test com/rules/PerfTestLogical.drl
50 inserted = 0.950
50 fired= 1.985
Test com/rules/PerfTestModify.drl
10 inserted = 0.286
10 fired= 0.155
Test com/rules/PerfTestModify.drl
20 inserted = 0.512
20 fired= 0.291
Test com/rules/PerfTestModify.drl
30 inserted = 0.633
30 fired= 0.434
Test com/rules/PerfTestModify.drl
40 inserted = 0.926
40 fired= 0.562
Test com/rules/PerfTestModify.drl
50 inserted = 1.026
50 fired= 0.662

-W

On 10 February 2012 21:43, zstlaw zstla...@akamai.com wrote:

 I just made a simple self contained example to demonstrate the problem
 better.  It entirely depends on the two included files. This was run on
 5.3.1.Final.

 Results of test runs :
   Setup with 1 in 2524
   LogicalInsertPerformance with 1 in 17049
   ManualInsertPerformance with 1 in 17841
   ModifyPerformance with 1 in 9679
   Setup with 2 in 13156
   LogicalInsertPerformance with 2 in 84740
   ManualInsertPerformance with 2 in 100079
   ModifyPerformance with 2 in 25267

 You can see how doubling the number of objects increases time by a factor
 of
 4 in all but the modify example.

 //

 
 // START RULE FILE PerfTestRules.drl
 //

 
 package com.rules;
 dialect java

 declare SimpleDataPoint
value : int
id : int
alert : boolean// for modify and manualInsert tests
alertRule : String // for modify test only
 end

 declare SimpleAlert
datapoint : SimpleDataPoint
ruleName : String
 end

 rule SetUp
when
$amtData : Integer()
then
for (int x=0; x $amtData.intValue(); x++) {
   insert(new SimpleDataPoint(11, x, false, null));
}
 end


 rule LogicalInsertPerformance
when
$datapoint : SimpleDataPoint (
value  0
)
then
insertLogical(new SimpleAlert($datapoint,
 drools.getRule().getName()));
 end

 rule ManualInsertPerformance
no-loop
when
$datapoint : SimpleDataPoint (
value  0,
!alert
)
then
insert(new SimpleAlert($datapoint, drools.getRule().getName()));
modify($datapoint) {setAlert(true)};
 end

 rule ModifyPerformance
no-loop
when
$datapoint : SimpleDataPoint (
value  0,
!alert
)
then
modify($datapoint) {setAlert(true),
 setAlertRule(drools.getRule().getName())};
 end

 //

 
 // JUNIT file SimplePerfTest.java used to setup and run tests.
 //

 
 package com.rules;

 import org.drools.KnowledgeBase;
 import org.drools.KnowledgeBaseConfiguration;
 import org.drools.KnowledgeBaseFactory;
 import org.drools.builder.KnowledgeBuilder;
 import org.drools.builder.KnowledgeBuilderFactory;
 

Re: [rules-users] Problem deploying 5.3.0 drools server in Tomcat

2012-02-13 Thread kenburcham
Hi guys,

  I get this same error.  I'm deploying 5.3 into a newly downloaded tomcat
6.0.35 running jre 1.6.0_24-b07.  

  I tried removing the offending jar as Esteban suggested but to no avail. 
I also tried running drools 5.4b2 and with that I don't get the jar error,
but instead this is in the log:

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from class path resource
[META-INF/cxf/cxf-extension-jaxrs-binding.xml]; nested exception is
java.io.FileNotFoundException: class path resource
[META-INF/cxf/cxf-extension-jaxrs-binding.xml] cannot be opened because it
does not exist
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:174)
... 52 more
Caused by: java.io.FileNotFoundException: class path resource
[META-INF/cxf/cxf-extension-jaxrs-binding.xml] cannot be opened because it
does not exist
at
org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)


any ideas?

Thanks!

ken.

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Problem-deploying-5-3-0-drools-server-in-Tomcat-tp3722323p3740887.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] Error running Drools 5.0 HelloWorldExample on WebSphere 6.1

2012-02-13 Thread vinoth
This post has NOT been accepted by the mailing list yet. 
Hi, 
   I am facing the similar error. Is there any way to solve this issue
without changing the dialect. 
Thanks in advance. 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Error-running-Drools-5-0-HelloWorldExample-on-WebSphere-6-1-tp61922p374.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] Error running Drools 5.0 HelloWorldExample on WebSphere 6.1

2012-02-13 Thread vinoth
Hi,
  I am facing the similar error. Is there any way to solve this issue
without changing the dialect.
Thanks in advance.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Error-running-Drools-5-0-HelloWorldExample-on-WebSphere-6-1-tp61922p3741302.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] Performance of collect seems to be n-squared

2012-02-13 Thread Shur, Bob
I have a simple class Post { int id; ... }. I insert some number of them as 
facts and then call ksession.execute(facts);

The whole drl file (except for package and import statements) is:

rule collect
when
$a : ArrayList(size  0) from collect(Post());
then
System.out.println(Number of posts:  + $a.size());
System.out.println(DONE);
end

The time it takes to run is n-squared in the number of posts. For 4000, 8000, 
16000, 32000, 64000 posts the time is (in 1/10 seconds):

4, 14, 56, 220, 852

Is this expected? Is there a better way for me to do the collect?


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


Re: [rules-users] Performance of collect seems to be n-squared

2012-02-13 Thread Wolfgang Laun
Repeatedly creating this ArrayList is bound to be O(n2).

Why do you want the Post facts as a List? There may be better ways for
achieving your goal.

-W


On 13 February 2012 20:49, Shur, Bob robert.s...@hp.com wrote:

 I have a simple class Post { int id; ... }. I insert some number of them
 as facts and then call ksession.execute(facts);

 The whole drl file (except for package and import statements) is:

 rule collect
 when
$a : ArrayList(size  0) from collect(Post());
 then
System.out.println(Number of posts:  + $a.size());
System.out.println(DONE);
 end

 The time it takes to run is n-squared in the number of posts. For 4000,
 8000, 16000, 32000, 64000 posts the time is (in 1/10 seconds):

 4, 14, 56, 220, 852

 Is this expected? Is there a better way for me to do the collect?


 ___
 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] Performance of collect seems to be n-squared

2012-02-13 Thread Edson Tirelli
   Just FYI, the array list is created once and reused with incremental
addition/removal of elements.

   The problem is that the engine does not know when you are done inserting
all the Post facts, so each post inserted is propagated down the network
with the cancellation and reactivation of the rule.

   This is one of those situations where a use of a control fact might be
recommended, if you are inserting Post facts in batches. E.g.:

rule X
when
 exists( AllPostsInserted() )
 $a : ArrayList(size  0) from collect(Post());
then
...
end

   Edson


2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com

 Repeatedly creating this ArrayList is bound to be O(n2).

 Why do you want the Post facts as a List? There may be better ways for
 achieving your goal.

 -W



 On 13 February 2012 20:49, Shur, Bob robert.s...@hp.com wrote:

 I have a simple class Post { int id; ... }. I insert some number of them
 as facts and then call ksession.execute(facts);

 The whole drl file (except for package and import statements) is:

 rule collect
 when
$a : ArrayList(size  0) from collect(Post());
 then
System.out.println(Number of posts:  + $a.size());
System.out.println(DONE);
 end

 The time it takes to run is n-squared in the number of posts. For 4000,
 8000, 16000, 32000, 64000 posts the time is (in 1/10 seconds):

 4, 14, 56, 220, 852

 Is this expected? Is there a better way for me to do the collect?


 ___
 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




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fwd: Migrating repository data from Drools 5.0 to 5.3Final

2012-02-13 Thread Michael Anstis
This is fine.

5.2 onwards groups columns for the same pattern together - if you looked at
the DRL fo 5.0 you'd have seen the columns are effectively grouped together
too.

For example; given the following 5.0 configuration (taken from what you
describe you have done):-

Pattern $a : Column A - Condition 1
Pattern $b : Column B - Condition 1
Pattern $c : Column C - Condition 1
Pattern $d : Column D - Condition 1
Pattern $a : Column E - Condition 2
Pattern $b : Column F - Condition 2

5.0 DRL

$a : Pattern( Condition 1, Condition 2 )
$b : Pattern( Condition 1, Condition 2 )
$c : Pattern( Condition 1 )
$d : Pattern( Condition 1 )

Importing this into 5.3 groups the columns:-

Pattern $a : Column A - Condition 1
Pattern $a : Column B - Condition 2
Pattern $b : Column C - Condition 1
Pattern $b : Column D - Condition 2
Pattern $c : Column E - Condition 1
Pattern $d : Column F - Condition 1

5.2 DRL

$a : Pattern( Condition 1, Condition 2 )
$b : Pattern( Condition 1, Condition 2 )
$c : Pattern( Condition 1 )
$d : Pattern( Condition 1 )

Furthermore, at the request of the community, the behavior of default
values changed so that the are only the default value for a new row (5.2
onwards) and not the value used for an empty cell (5.0). I know this has
caused some re-work for people migrating a legacy decision table from 5.0
to 5.2 but since the impact, to date, has been small I do not plan on
making any programmatic changes.

With kind regards,

Mike

2012/2/13 jian zhi jianp...@yahoo.com

 Mike,

 Thanks for the detail explanation.

 I found that the order of the conditions were changed again after I added
 two more conditions to the same package I used last time.
 I added default value to the first two conditions. Added the fifth
 condition by using the binding name created for the first condition.Add the
 sixth condition by using the binding name created for the second condition.
 After I import the data to 5.3 the fifth condition became the second and
 the sixth condition became the fourth. Also the default value for the first
 and second conditions are not listed in the rule source in 5.3. Could you
 please take a look? I attach the modified repository in the email.

 Thanks a lot,
 Jian

   --
 *From:* Michael Anstis michael.ans...@gmail.com
 *To:* drools-user rules-users@lists.jboss.org
 *Sent:* Friday, February 10, 2012 12:59 PM
 *Subject:* [rules-users] Fwd: Migrating repository data from Drools 5.0
 to 5.3Final

 I suspect ConsumerAccountAssociationFact.hasAnyAccountClosed is a boolean.

 In 5.3 we handle data-types better than 5.0, so String, Numbers, Dates are
 Booleans have editors appropriate for the data-type and the resulting DRL
 only escapes values with quotation marks where needed (i.e. Strings and
 Dates). Boolean's in the table are now shown as Checkboxes. If the value is
 true it is ticked, if the value is false the checkbox is not ticked.

 I don't therefore believe there is any problem.

 On 10 February 2012 16:35, jian zhi jianp...@yahoo.com wrote:

 Mike,

 Thanks for the quick response. I downloaded the war and tested the fix.
 The order of the conditions are correct now. There is still a small problem
 in the last condition.

 In Drools 5.0 the source is consumerAccount :
 ConsumerAccountAssociationFact( hasAnyAccountClosed == false ).
 In Drools 5.3 the source is consumerAccount :
 ConsumerAccountAssociationFact( hasAnyAccountClosed == false ). It displays
 a square check box in the cell.

 Could you please take a look?
 Thanks,
 Jian

   --
 *From:* Michael Anstis michael.ans...@gmail.com
 *To:* jian zhi jianp...@yahoo.com; Rules Users List 
 rules-users@lists.jboss.org
 *Sent:* Thursday, February 9, 2012 4:55 AM

 *Subject:* Re: [rules-users] Migrating repository data from Drools 5.0 to
 5.3Final

 You can get a build containing the fix from Nexus:


 https://repository.jboss.org/nexus/index.html#nexus-search;gav~org.drools~guvnor-webapp~5.3.2-SNAPSHOT~~

 2012/2/8 jian zhi jianp...@yahoo.com

 Mike,

 Is it possible to release a patch of 5.3?

 Thanks,
 Jian

   --
 *From:* Michael Anstis michael.ans...@gmail.com
 *To:* Rules Users List rules-users@lists.jboss.org
 *Sent:* Wednesday, February 8, 2012 3:17 AM

 *Subject:* Re: [rules-users] Migrating repository data from Drools 5.0 to
 5.3Final

 The problem has existed since 5.2 and would potentially affect loading any
 earlier version.
 Prior to 5.2 the object model used by the guided decision table did not
 hold a Pattern to which individual condition columns are bound.
 The conversion code groups individual condition columns into the
 appropriate group and moves the underlying column data accordingly (as
 there was no guarantee columns with the same bound name were consecutive).
 There was a problem with the creation and insertion of the new Pattern
 objects that relied upon the order of entries in a HashMap being
 consistent. This has now 

[rules-users] MVEL strict-mode vs. performance

2012-02-13 Thread womuji
Hi,

We are upgrading from Drools 5.1 to 5.3 to improve the performance, but we
are hoping to keep our drl files intact. We were trying to use the old drl
files by setting drools.dialect.mvel.strict=false, but somehow with this
setting we still got  unable to resolve method using strict-mode .. error
from time to time. 

I'm wondering if there is any correlation between this strict-mode and the
performance gain, if in order to achieve the performance gain, we have to
set the strict-mode to true, then we will make changes to our drl files,
instead of spending time to figure out why the effect of
drools.dialect.mvel.strict=false is sporadic.

Thanks.  

--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-strict-mode-vs-performance-tp3741814p3741814.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] rules-users Digest, Vol 63, Issue 60

2012-02-13 Thread Shur, Bob
I don't understand either of these answers. All of the facts are in a list of 
facts passed into ksession.execute, like this:

final StatelessKnowledgeSession ksession = 
kbase.newStatelessKnowledgeSession();
ListObject facts = createPosts();  
if (facts.size() == 0) break;
long t0 = System.currentTimeMillis()/100;
ksession.execute(facts);   
long t1 = System.currentTimeMillis()/100;
System.out.println(Elapsed time:  + (t1 - t0));

There are no more facts getting created during rules processing. The whole drl 
file is:

rule collect
when
$a : ArrayList(size  0) from collect(Post());
then
System.out.println(Number of posts:  + $a.size());
System.out.println(DONE);
end

Why is the collect happening more than once? Actually I don't think it is, else 
I would be seeing more than one printout.

I agree that I could probably find a way to do without the list, but I would 
still like to understand why this is n-squared. I was actually planning to 
explore the performance of various ways to compute the minimum of a large 
number of objects. I was surprised to find that I was already up to n-squared 
just creating the list.

 --
 
 Message: 3
 Date: Mon, 13 Feb 2012 20:59:20 +0100
 From: Wolfgang Laun wolfgang.l...@gmail.com
 Subject: Re: [rules-users] Performance of collect seems to be
   n-squared
 To: Rules Users List rules-users@lists.jboss.org
 Message-ID:
   CANaj1LeAnD-
 kyngqqtzo1xooh4v8tnqo5a+9ckvr6xpmk4g...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1
 
 Repeatedly creating this ArrayList is bound to be O(n2).
 
 Why do you want the Post facts as a List? There may be better ways for
 achieving your goal.
 
 -W
 
 
 On 13 February 2012 20:49, Shur, Bob robert.s...@hp.com wrote:
 
  I have a simple class Post { int id; ... }. I insert some number of
 them
  as facts and then call ksession.execute(facts);
 
  The whole drl file (except for package and import statements) is:
 
  rule collect
  when
 $a : ArrayList(size  0) from collect(Post());
  then
 System.out.println(Number of posts:  + $a.size());
 System.out.println(DONE);
  end
 
  The time it takes to run is n-squared in the number of posts. For
 4000,
  8000, 16000, 32000, 64000 posts the time is (in 1/10 seconds):
 
  4, 14, 56, 220, 852
 
  Is this expected? Is there a better way for me to do the collect?
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 -- next part --
 An HTML attachment was scrubbed...
 URL: http://lists.jboss.org/pipermail/rules-
 users/attachments/20120213/323161b1/attachment-0001.html
 
 --
 
 Message: 4
 Date: Mon, 13 Feb 2012 15:12:12 -0500
 From: Edson Tirelli ed.tire...@gmail.com
 Subject: Re: [rules-users] Performance of collect seems to be
   n-squared
 To: Rules Users List rules-users@lists.jboss.org
 Message-ID:
   CAD7AJnf9mZcm77o3uf+EbigEVZzpgo5UJkKeyR0M0r1f3io1gw@mail.gmail.c
 om
 Content-Type: text/plain; charset=iso-8859-1
 
Just FYI, the array list is created once and reused with incremental
 addition/removal of elements.
 
The problem is that the engine does not know when you are done
 inserting
 all the Post facts, so each post inserted is propagated down the
 network
 with the cancellation and reactivation of the rule.
 
This is one of those situations where a use of a control fact might
 be
 recommended, if you are inserting Post facts in batches. E.g.:
 
 rule X
 when
  exists( AllPostsInserted() )
  $a : ArrayList(size  0) from collect(Post());
 then
 ...
 end
 
Edson
 
 
 2012/2/13 Wolfgang Laun wolfgang.l...@gmail.com
 
  Repeatedly creating this ArrayList is bound to be O(n2).
 
  Why do you want the Post facts as a List? There may be better ways
 for
  achieving your goal.
 
  -W
 
 
 
  On 13 February 2012 20:49, Shur, Bob robert.s...@hp.com wrote:
 
  I have a simple class Post { int id; ... }. I insert some number of
 them
  as facts and then call ksession.execute(facts);
 
  The whole drl file (except for package and import statements) is:
 
  rule collect
  when
 $a : ArrayList(size  0) from collect(Post());
  then
 System.out.println(Number of posts:  + $a.size());
 System.out.println(DONE);
  end
 
  The time it takes to run is n-squared in the number of posts. For
 4000,
  8000, 16000, 32000, 64000 posts the time is (in 1/10 seconds):
 
  4, 14, 56, 220, 852
 
  Is this expected? Is there a better way for me to do the collect?
 
 
**

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


[rules-users] Using Character typed properties in Drool 5.3

2012-02-13 Thread Welsh, Armand
Community,

In drools 5.2 I had the following LHS

when
BloombergColumn (columnName == CRNCY, $cur : stringValue != null)
Country (currency == $cur, emergingMkt == 'Y' || countryCode in 
(BH,HR,CZ,EE,HK,HU,IL,KR,KW,MO,OM,QA,SA,SG,SK,SI,TT))


I am switching to Drool 5.3, and Drools Guvnor reports the following error upon 
validate (or compile):

[bum_code_value.currency 01] Unable to Analyse Expression emergingMkt 
== 'Y' || countryCode == BH || countryCode == HR || countryCode == CZ || 
countryCode == EE || countryCode == HK || countryCode == HU || 
countryCode == IL || countryCode == KR || countryCode == KW || 
countryCode == MO || countryCode == OM || countryCode == QA || 
countryCode == SA || countryCode == SG || countryCode == SK || 
countryCode == SI || countryCode == TT: [Error: Comparison operation 
requires compatible types. Found class java.lang.Character and class 
java.lang.String] [Near : {... == SK || countryCode == SI || countryCode == 
TT }] ^ [Line: 7, Column: 28]

Looking at the emergingMkt in my data model, I see that it is defined as a 
Character.  If I change my LHS to:

BloombergColumn (columnName == CRNCY, $cur : stringValue != null)
Country (currency == $cur, emergingMkt == Character.valueOf('Y') || 
countryCode in 
(BH,HR,CZ,EE,HK,HU,IL,KR,KW,MO,OM,QA,SA,SG,SK,SI,TT))


Then the validate passes. 

Was this change in behavior intentional?  I don't see a reference to this 
change in the Drools 5.3 documentation, and this makes for a harder to read 
rule for our Drools analysts.

Thanks in advance,
Armand

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


Re: [rules-users] Using Character typed properties in Drool 5.3

2012-02-13 Thread Welsh, Armand
Correction:

Even using Character.valueOf('Y') does not work anymore in Drools 5.3.  The 
validate works, but the compile steps fails because Drools is treating 'Y' as a 
String.  However, in Drools 5.2 and prior, 'Y' was properly casted to a 
Character when the property it was being compared to was a property of type 
Character.

If anyone has any insight on where the documentation address this change in 
behavior, I would appreciate some guidance.  I am trying to re-standardize how 
our rules are coded for evaluating Character typed properties.

Armand

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Welsh, Armand
Sent: Monday, February 13, 2012 3:16 PM
To: Rules Users List
Subject: [rules-users] Using Character typed properties in Drool 5.3

Community,

In drools 5.2 I had the following LHS

when
BloombergColumn (columnName == CRNCY, $cur : stringValue != null)
Country (currency == $cur, emergingMkt == 'Y' || countryCode in 
(BH,HR,CZ,EE,HK,HU,IL,KR,KW,MO,OM,QA,SA,SG,SK,SI,TT))


I am switching to Drool 5.3, and Drools Guvnor reports the following error upon 
validate (or compile):

[bum_code_value.currency 01] Unable to Analyse Expression emergingMkt 
== 'Y' || countryCode == BH || countryCode == HR || countryCode == CZ || 
countryCode == EE || countryCode == HK || countryCode == HU || 
countryCode == IL || countryCode == KR || countryCode == KW || 
countryCode == MO || countryCode == OM || countryCode == QA || 
countryCode == SA || countryCode == SG || countryCode == SK || 
countryCode == SI || countryCode == TT: [Error: Comparison operation 
requires compatible types. Found class java.lang.Character and class 
java.lang.String] [Near : {... == SK || countryCode == SI || countryCode == 
TT }] ^ [Line: 7, Column: 28]

Looking at the emergingMkt in my data model, I see that it is defined as a 
Character.  If I change my LHS to:

BloombergColumn (columnName == CRNCY, $cur : stringValue != null)
Country (currency == $cur, emergingMkt == Character.valueOf('Y') || 
countryCode in 
(BH,HR,CZ,EE,HK,HU,IL,KR,KW,MO,OM,QA,SA,SG,SK,SI,TT))


Then the validate passes. 

Was this change in behavior intentional?  I don't see a reference to this 
change in the Drools 5.3 documentation, and this makes for a harder to read 
rule for our Drools analysts.

Thanks in advance,
Armand

___
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] Using Character typed properties in Drool 5.3

2012-02-13 Thread Edson Tirelli
   Which version of MVEL are you using? It looks like a regression. I will
ping Mario to take a look.

   Edson

On Mon, Feb 13, 2012 at 6:45 PM, Welsh, Armand awe...@statestreet.comwrote:

 Correction:

 Even using Character.valueOf('Y') does not work anymore in Drools 5.3.
  The validate works, but the compile steps fails because Drools is treating
 'Y' as a String.  However, in Drools 5.2 and prior, 'Y' was properly casted
 to a Character when the property it was being compared to was a property of
 type Character.

 If anyone has any insight on where the documentation address this change
 in behavior, I would appreciate some guidance.  I am trying to
 re-standardize how our rules are coded for evaluating Character typed
 properties.

 Armand

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] On Behalf Of Welsh, Armand
 Sent: Monday, February 13, 2012 3:16 PM
 To: Rules Users List
 Subject: [rules-users] Using Character typed properties in Drool 5.3

 Community,

 In drools 5.2 I had the following LHS

 when
BloombergColumn (columnName == CRNCY, $cur : stringValue != null)
Country (currency == $cur, emergingMkt == 'Y' || countryCode in
 (BH,HR,CZ,EE,HK,HU,IL,KR,KW,MO,OM,QA,SA,SG,SK,SI,TT))


 I am switching to Drool 5.3, and Drools Guvnor reports the following error
 upon validate (or compile):

[bum_code_value.currency 01] Unable to Analyse Expression
 emergingMkt == 'Y' || countryCode == BH || countryCode == HR ||
 countryCode == CZ || countryCode == EE || countryCode == HK ||
 countryCode == HU || countryCode == IL || countryCode == KR ||
 countryCode == KW || countryCode == MO || countryCode == OM ||
 countryCode == QA || countryCode == SA || countryCode == SG ||
 countryCode == SK || countryCode == SI || countryCode == TT: [Error:
 Comparison operation requires compatible types. Found class
 java.lang.Character and class java.lang.String] [Near : {... == SK ||
 countryCode == SI || countryCode == TT }] ^ [Line: 7, Column: 28]

 Looking at the emergingMkt in my data model, I see that it is defined as a
 Character.  If I change my LHS to:

BloombergColumn (columnName == CRNCY, $cur : stringValue != null)
Country (currency == $cur, emergingMkt == Character.valueOf('Y') ||
 countryCode in
 (BH,HR,CZ,EE,HK,HU,IL,KR,KW,MO,OM,QA,SA,SG,SK,SI,TT))


 Then the validate passes.

 Was this change in behavior intentional?  I don't see a reference to this
 change in the Drools 5.3 documentation, and this makes for a harder to read
 rule for our Drools analysts.

 Thanks in advance,
 Armand

 ___
 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




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] rules-users Digest, Vol 63, Issue 60

2012-02-13 Thread Welsh, Armand
It would almost seem as though the collection is a sort of sub rule that fires 
for every insert, and generates temporary fact collections based on the 
results, and so, even though you are inserting all the facts before calling the 
execute in the stateless session, each and every single fact is being evaluated 
for the collect sub-rule to build the new collections, and then those new 
collections are fed into the actual rule as temporary facts unique to that 
rule.  And that perhaps this is the source of the n-squared processes.  

Have you tried a more literal approach like this? (based on your comment that 
you are looking for the minimum)
(assuming there is a property called Value that you are looking to get the 
minimum of)

rule minimum
when
Post($v: value)
not Post(value = $v)
then
System.out.println(Minimum value:  + $v);
end

rule maximum
when
Post($v: value)
not Post(value = $v)
then
System.out.println(Maximum value:  + $v);
end


Of course, this has not direct ration to what you are trying to do, but rather, 
I am focusing on your comment that you trying to focus on computing the minimum 
of a large collection of objects.

I wonder if accumulate might do a better job in solving your original problem, 
since accumulate could allow you to calculate min, max, average, count, sum, 
return collections as List and Set of data..

Take a look at section 5.8.3.6.4.1 of the Drools Expert manual for details on 
use, and 5.8.3.6.4.2 for details on creating your own functions which could do 
all of these in one, which would greatly reduce the number of iterations 
through your source collection.

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Shur, Bob
Sent: Monday, February 13, 2012 3:06 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] rules-users Digest, Vol 63, Issue 60

I don't understand either of these answers. All of the facts are in a list of 
facts passed into ksession.execute, like this:

final StatelessKnowledgeSession ksession = 
kbase.newStatelessKnowledgeSession();
ListObject facts = createPosts();  
if (facts.size() == 0) break;
long t0 = System.currentTimeMillis()/100;
ksession.execute(facts);   
long t1 = System.currentTimeMillis()/100;
System.out.println(Elapsed time:  + (t1 - t0));

There are no more facts getting created during rules processing. The whole drl 
file is:

rule collect
when
$a : ArrayList(size  0) from collect(Post());
then
System.out.println(Number of posts:  + $a.size());
System.out.println(DONE);
end

Why is the collect happening more than once? Actually I don't think it is, else 
I would be seeing more than one printout.

I agree that I could probably find a way to do without the list, but I would 
still like to understand why this is n-squared. I was actually planning to 
explore the performance of various ways to compute the minimum of a large 
number of objects. I was surprised to find that I was already up to n-squared 
just creating the list.

 --
 
 Message: 3
 Date: Mon, 13 Feb 2012 20:59:20 +0100
 From: Wolfgang Laun wolfgang.l...@gmail.com
 Subject: Re: [rules-users] Performance of collect seems to be
   n-squared
 To: Rules Users List rules-users@lists.jboss.org
 Message-ID:
   CANaj1LeAnD-
 kyngqqtzo1xooh4v8tnqo5a+9ckvr6xpmk4g...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1
 
 Repeatedly creating this ArrayList is bound to be O(n2).
 
 Why do you want the Post facts as a List? There may be better ways for
 achieving your goal.
 
 -W
 
 
 On 13 February 2012 20:49, Shur, Bob robert.s...@hp.com wrote:
 
  I have a simple class Post { int id; ... }. I insert some number of
 them
  as facts and then call ksession.execute(facts);
 
  The whole drl file (except for package and import statements) is:
 
  rule collect
  when
 $a : ArrayList(size  0) from collect(Post());
  then
 System.out.println(Number of posts:  + $a.size());
 System.out.println(DONE);
  end
 
  The time it takes to run is n-squared in the number of posts. For
 4000,
  8000, 16000, 32000, 64000 posts the time is (in 1/10 seconds):
 
  4, 14, 56, 220, 852
 
  Is this expected? Is there a better way for me to do the collect?
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 -- next part --
 An HTML attachment was scrubbed...
 URL: http://lists.jboss.org/pipermail/rules-
 users/attachments/20120213/323161b1/attachment-0001.html
 
 --
 
 Message: 4
 Date: Mon, 13 Feb 2012 15:12:12 -0500
 From: Edson Tirelli ed.tire...@gmail.com
 Subject: Re: [rules-users] Performance of collect seems

Re: [rules-users] Multiple threading

2012-02-13 Thread Richard Calmbach
Sorry to burst your bubble, but stateful knowledge sessions are most
definitely not thread-safe. I have seen hard evidence to this effect in the
form of incorrect execution results and log statements that clearly show
that two threads were interacting in unexpected ways. In a nutshell: Rule
consequences are not executed atomically. This can cause unexpected working
memory changes (e.g., fact insertion) to happen on one thread in one rule
consequence before another thread has finished executing another rule
consequence. Note that I'm not talking about whatever threads Drools may be
creating internally. I'm talking about application threads.

I have found synchronizing on the session object to be a reliable safeguard
against unwanted thread interactions. Basically, this way all external fact
insertions and calls to fireAllRules() are serialized.

If this is not supposed to be necessary (synchronizing on the session),
then there is a thread-safety bug in Drools.

-Richard

2012/2/10 Mark Proctor mproc...@codehaus.org

  On 10/02/2012 03:36, Apache wrote:

 Hey,
 I am trying to get multiple threads to insert events and run rules against 
 the union of events inserted ( an as soon as they are inserted, a timer 
 drools thread kicking of fireallrules() is not an option because that would 
 introduce a delay ) and wanted some opinion on the following:

 1. Stateless session is basically a wrapper around statefulsession and since 
 per doc  statefulsession is not threadsafe is it  safe to assume 2 threads 
 cannot insert and run fireallrules to compare against a union of objects 
 inserted by multiple threads without some synchronication on event insertion 
 and ESP fireallrulesrules ? ( would the answer still hold despite a 
 drools-camel endpoint reading and storing exchanges from multiple threads ? )

  stateful sessions are thread safe, they just aren't multi-threaded. Each
 of the working memory actions hold a lock, so only one thread at a time can
 enter.

 2. If in the above point we simplify the case where the rule uses the from 
 keyword and reads from a cache or a Db ( is reading from
 A cache supported out of the box ? ) then will drools bhaviour will be bound 
 by the thread which invokes fireallrules() ?



 ___
 rules-users mailing 
 listrules-users@lists.jboss.orghttps://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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Using Character typed properties in Drool 5.3

2012-02-13 Thread Welsh, Armand
MVEL2-2.1.0.drools4.jar (packaged with Drools 5.3 final)

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Monday, February 13, 2012 5:48 PM
To: Rules Users List
Subject: Re: [rules-users] Using Character typed properties in Drool 5.3


   Which version of MVEL are you using? It looks like a regression. I will ping 
Mario to take a look.

   Edson
On Mon, Feb 13, 2012 at 6:45 PM, Welsh, Armand 
awe...@statestreet.commailto:awe...@statestreet.com wrote:
Correction:

Even using Character.valueOf('Y') does not work anymore in Drools 5.3.  The 
validate works, but the compile steps fails because Drools is treating 'Y' as a 
String.  However, in Drools 5.2 and prior, 'Y' was properly casted to a 
Character when the property it was being compared to was a property of type 
Character.

If anyone has any insight on where the documentation address this change in 
behavior, I would appreciate some guidance.  I am trying to re-standardize how 
our rules are coded for evaluating Character typed properties.

Armand

-Original Message-
From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Welsh, Armand
Sent: Monday, February 13, 2012 3:16 PM
To: Rules Users List
Subject: [rules-users] Using Character typed properties in Drool 5.3

Community,

In drools 5.2 I had the following LHS

when
   BloombergColumn (columnName == CRNCY, $cur : stringValue != null)
   Country (currency == $cur, emergingMkt == 'Y' || countryCode in 
(BH,HR,CZ,EE,HK,HU,IL,KR,KW,MO,OM,QA,SA,SG,SK,SI,TT))


I am switching to Drool 5.3, and Drools Guvnor reports the following error upon 
validate (or compile):

   [bum_code_value.currency 01] Unable to Analyse Expression emergingMkt == 
'Y' || countryCode == BH || countryCode == HR || countryCode == CZ || 
countryCode == EE || countryCode == HK || countryCode == HU || 
countryCode == IL || countryCode == KR || countryCode == KW || 
countryCode == MO || countryCode == OM || countryCode == QA || 
countryCode == SA || countryCode == SG || countryCode == SK || 
countryCode == SI || countryCode == TT: [Error: Comparison operation 
requires compatible types. Found class java.lang.Character and class 
java.lang.String] [Near : {... == SK || countryCode == SI || countryCode == 
TT }] ^ [Line: 7, Column: 28]

Looking at the emergingMkt in my data model, I see that it is defined as a 
Character.  If I change my LHS to:

   BloombergColumn (columnName == CRNCY, $cur : stringValue != null)
   Country (currency == $cur, emergingMkt == Character.valueOf('Y') || 
countryCode in 
(BH,HR,CZ,EE,HK,HU,IL,KR,KW,MO,OM,QA,SA,SG,SK,SI,TT))


Then the validate passes.

Was this change in behavior intentional?  I don't see a reference to this 
change in the Drools 5.3 documentation, and this makes for a harder to read 
rule for our Drools analysts.

Thanks in advance,
Armand

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

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



--
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.comhttp://www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] MVEL strict-mode vs. performance

2012-02-13 Thread Mark Proctor
Have a read of the release notes around type safety. There are some 
situations where Drools was not correctly enforcing type safety, which 
have since been corrected. So probably a badly written rule is now 
getting picked up. As a work around you can force some patterns to 
evaluate dynamically using @typesafe.

Mark
On 13/02/2012 22:12, womuji wrote:
 Hi,

 We are upgrading from Drools 5.1 to 5.3 to improve the performance, but we
 are hoping to keep our drl files intact. We were trying to use the old drl
 files by setting drools.dialect.mvel.strict=false, but somehow with this
 setting we still got  unable to resolve method using strict-mode .. error
 from time to time.

 I'm wondering if there is any correlation between this strict-mode and the
 performance gain, if in order to achieve the performance gain, we have to
 set the strict-mode to true, then we will make changes to our drl files,
 instead of spending time to figure out why the effect of
 drools.dialect.mvel.strict=false is sporadic.

 Thanks.

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/MVEL-strict-mode-vs-performance-tp3741814p3741814.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] Multiple threading

2012-02-13 Thread Mark Proctor

On 14/02/2012 02:01, Richard Calmbach wrote:
Sorry to burst your bubble, but stateful knowledge sessions are most 
definitely not thread-safe. I have seen hard evidence to this effect 
in the form of incorrect execution results and log statements that 
clearly show that two threads were interacting in unexpected ways. In 
a nutshell: Rule consequences are not executed atomically. This can 
cause unexpected working memory changes (e.g., fact insertion) to 
happen on one thread in one rule consequence before another thread has 
finished executing another rule consequence. Note that I'm not talking 
about whatever threads Drools may be creating internally. I'm talking 
about application threads.


I have found synchronizing on the session object to be a reliable 
safeguard against unwanted thread interactions. Basically, this way 
all external fact insertions and calls to fireAllRules() are serialized.


If this is not supposed to be necessary (synchronizing on the 
session), then there is a thread-safety bug in Drools.
Over various releases we have tried to catch any areas that might bypass 
these locks. If you have found one, please provide us with a unit test 
and we'll fix.


Mark


-Richard

2012/2/10 Mark Proctor mproc...@codehaus.org 
mailto:mproc...@codehaus.org


On 10/02/2012 03:36, Apache wrote:

Hey,
I am trying to get multiple threads to insert events and run rules against 
the union of events inserted ( an as soon as they are inserted, a timer drools 
thread kicking of fireallrules() is not an option because that would introduce 
a delay ) and wanted some opinion on the following:

1. Stateless session is basically a wrapper around statefulsession and 
since per doc  statefulsession is not threadsafe is it  safe to assume 2 
threads cannot insert and run fireallrules to compare against a union of 
objects inserted by multiple threads without some synchronication on event 
insertion and ESP fireallrulesrules ? ( would the answer still hold despite a 
drools-camel endpoint reading and storing exchanges from multiple threads ? )

stateful sessions are thread safe, they just aren't
multi-threaded. Each of the working memory actions hold a lock, so
only one thread at a time can enter.

2. If in the above point we simplify the case where the rule uses the 
from keyword and reads from a cache or a Db ( is reading from
A cache supported out of the box ? ) then will drools bhaviour will be 
bound by the thread which invokes fireallrules() ?


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



___
rules-users mailing list
rules-users@lists.jboss.org mailto: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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Multiple threading

2012-02-13 Thread Mark Proctor

On 10/02/2012 22:46, apache wrote:

Mark
  the first link in my previous post says something contradictory to what you
mentioned. I understand that one thread at a time can use the session just
not 2 or more threads at the same time . Is that what you meant too ?
I think you are referring to the javadoc of one particular method, let 
me know if there are others.



 getStatefulKnowledgeSessions

Collection  
http://download.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=trueStatefulKnowledgeSession
  
http://docs.jboss.org/jbpm/v5.2/javadocs/org/drools/runtime/StatefulKnowledgeSession.html
  *getStatefulKnowledgeSessions*()

Return a collection of the StatefulKnowledgeSessions that exist in this 
KnowledgeBase. Be careful as sessions are not thread-safe and could be 
in use elsewhere.


That is incorrect and we'll get it corrected for next release.

Mark


--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Multiple-threading-tp3731592p3733915.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] 5.3.0 NoClassDefFound due to nested property access

2012-02-13 Thread Mark Proctor

On 10/02/2012 11:40, Wolfgang Laun wrote:

Yes? No? Don't know? None of the previous?

What is bar is it a String or something else? Where did Monitor come from?

Mark


On 8 February 2012 11:43, Wolfgang Laun wolfgang.l...@gmail.com 
mailto:wolfgang.l...@gmail.com wrote:


Is this already known and fixed in 5.4.0? The problem occurs when you
have, e.g.,

  Fact( foo.bar == baz )

Stack dump:

Exception in thread main java.lang.NoClassDefFoundError:
monitor/Monitor
   at ASMAccessorImpl_114212541328697624590.getValue(Unknown
Source)
   at

org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)
   at
org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:106)
   at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
   at org.mvel2.MVEL.executeExpression(MVEL.java:954)
   at

org.drools.base.extractors.MVELClassFieldReader.getValue(MVELClassFieldReader.java:100)
   at

org.drools.base.extractors.BaseObjectClassFieldReader.isNullValue(BaseObjectClassFieldReader.java:179)
   at

org.drools.rule.VariableRestriction$ObjectVariableContextEntry.updateFromFactHandle(VariableRestriction.java:338)
   at

org.drools.common.SingleBetaConstraints.updateFromFactHandle(SingleBetaConstraints.java:118)
   at org.drools.reteoo.NotNode.modifyRightTuple(NotNode.java:339)
   at org.drools.reteoo.BetaNode.modifyObject(BetaNode.java:431)
   at

org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:468)
   at

org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:436)
   at
org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:288)
   at
org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:271)
   at
org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:459)
   at
org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:363)
   at

org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:298)
   at
monitor.Rule_stop_monitoring.defaultConsequence(Rule_stop_monitoring.java:8)
   at
monitor.Rule_stop_monitoringDefaultConsequenceInvoker.evaluate(Unknown
Source)
   at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
   at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
   at
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
   at

org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:708)
   at

org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:672)
   at
org.drools.common.Scheduler$ActivationTimerJob.execute(Scheduler.java:90)
   at

org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:46)
   at

org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:13)
   at

org.drools.time.impl.PseudoClockScheduler.runCallBacks(PseudoClockScheduler.java:203)
   at

org.drools.time.impl.PseudoClockScheduler.advanceTime(PseudoClockScheduler.java:156)




___
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] What is the use of Annotation in DeclarativeModel

2012-02-13 Thread Veera
Hi All,

 

anybody give me some idea on annotations which are there in Fact Declarative
Model in Guvnor..
If it possible give me one example

Thanks in advance..


Regards,
Veera

--
View this message in context: 
http://drools.46999.n3.nabble.com/What-is-the-use-of-Annotation-in-DeclarativeModel-tp3742852p3742852.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] 5.3.0 NoClassDefFound due to nested property access

2012-02-13 Thread Wolfgang Laun
  Fact( foo.bar == baz )

with pojos
   class Fact { Foo foo; ... }
   class Foo { String bar; ... }

-W


On 14/02/2012, Mark Proctor mproc...@codehaus.org wrote:
 On 10/02/2012 11:40, Wolfgang Laun wrote:
 Yes? No? Don't know? None of the previous?
 What is bar is it a String or something else? Where did Monitor come from?

 Mark

 On 8 February 2012 11:43, Wolfgang Laun wolfgang.l...@gmail.com
 mailto:wolfgang.l...@gmail.com wrote:

 Is this already known and fixed in 5.4.0? The problem occurs when you
 have, e.g.,

   Fact( foo.bar == baz )

 Stack dump:

 Exception in thread main java.lang.NoClassDefFoundError:
 monitor/Monitor
at ASMAccessorImpl_114212541328697624590.getValue(Unknown
 Source)
at

 org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)
at
 org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:106)
at

 org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
at org.mvel2.MVEL.executeExpression(MVEL.java:954)
at

 org.drools.base.extractors.MVELClassFieldReader.getValue(MVELClassFieldReader.java:100)
at

 org.drools.base.extractors.BaseObjectClassFieldReader.isNullValue(BaseObjectClassFieldReader.java:179)
at

 org.drools.rule.VariableRestriction$ObjectVariableContextEntry.updateFromFactHandle(VariableRestriction.java:338)
at

 org.drools.common.SingleBetaConstraints.updateFromFactHandle(SingleBetaConstraints.java:118)
at org.drools.reteoo.NotNode.modifyRightTuple(NotNode.java:339)
at org.drools.reteoo.BetaNode.modifyObject(BetaNode.java:431)
at

 org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:468)
at

 org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:436)
at
 org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:288)
at
 org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:271)
at
 org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:459)
at
 org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:363)
at

 org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:298)
at

 monitor.Rule_stop_monitoring.defaultConsequence(Rule_stop_monitoring.java:8)
at
 monitor.Rule_stop_monitoringDefaultConsequenceInvoker.evaluate(Unknown
 Source)
at

 org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
at
 org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at
 org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
at

 org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:708)
at

 org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:672)
at

 org.drools.common.Scheduler$ActivationTimerJob.execute(Scheduler.java:90)
at

 org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:46)
at

 org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:13)
at

 org.drools.time.impl.PseudoClockScheduler.runCallBacks(PseudoClockScheduler.java:203)
at

 org.drools.time.impl.PseudoClockScheduler.advanceTime(PseudoClockScheduler.java:156)




 ___
 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