Re: [rules-users] Distributed Drools

2014-04-24 Thread Esteban Aliverti
Matthew, regarding drools-mas, I would use this other repo:
 
https://github.com/SocraticGrid/drools-mashttps://github.com/SocraticGrid/drools-mas.
I did some changes there that are not present in droolsjbpm's one (I
have
to merge them back).
I do think, though, that drools-mas is (currently) more suitable for a
multi-agent scenario where each of the agents has a private and local
working memory that is not shared among the others. drools-mas uses FIPA
messages to handle the communication between the agents, but no real shared
working memory is never used. Previous implementation of drools-mas used
drools-grid to try to do something like this (distributed working
memories), but this implementation was discarded after drools-grid was
discontinued (it actually never passed the incubation period).

Regards,




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


On Thu, Apr 24, 2014 at 4:39 AM, Daniel Souza danieldsouz...@gmail.comwrote:

 Hi Matt,

 This is the paper url available free from google:  Rule-based Distributed
 and Agent Systems
 
 http://vsis-www.informatik.uni-hamburg.de/getDoc.php/publications/431/intro.pdf
 
 It's around 27 pages.

 Daniel



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Distributed-Drools-tp4029338p4029342.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] Identical Facts over rules, results being cached?

2014-04-09 Thread Esteban Aliverti
The question here is: what is the result of fireAllRules()? Caching the
result of this method is trivial: it's just a number! I think that what you
need to build is your own ad-hoc cache that knows how to extract a 'result'
out of the session an keep it handy. Implementing this mechanism shouldn't
be that hard (at least for simple - no nested- Facts) and once you have it
you can validate the benefits.

Regards,




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


On Wed, Apr 9, 2014 at 11:02 AM, Leonard93 leonardlinde...@hotmail.comwrote:

 Wouldn't that depend on how long the data is being kept and how often
 identical rules are being fired?

 Or would you say the rule engine is faster than all the actions in between
 that it wouldnt matter?



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Identical-Facts-over-rules-results-being-cached-tp4029169p4029172.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] Buggy query behavior in drools 5.6 and 6.1-SNAPSHOT ??

2014-01-23 Thread Esteban Aliverti
Let me see what I can do.




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


On Thu, Jan 23, 2014 at 12:18 AM, Davide Sottara dso...@gmail.com wrote:

  Esteban, I have created a ticket for this with
 an explanation of the weird behavior.

 https://issues.jboss.org/browse/DROOLS-414

 The problem is in QueryElementBuilder line#343.
 It's an easy fix but I don't have time for it right now,
 could someone look into it?

 Thanks
 Davide



 On 01/22/2014 06:00 PM, Esteban Aliverti wrote:

 Good catch Davide. I can confirm that not using nested accessors the query
 works as expected.

  Regards,


 

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


 On Wed, Jan 22, 2014 at 6:57 PM, Davide Sottara dso...@gmail.com wrote:

  Indeed, the use case can be simplified further:

 package org.drools.test.bc;

 declare Parent
 attribute2 : String
 end

 declare Child
 parentId : String
 end

 query getChildWithName( String $parentId, Child $child )
 $child:= Child( parentId == $parentId )

 end

 rule Insert Children
 when
  then
 Parent p1 = new Parent( a1 );
 Child c1p1 = new Child( 1 );

 insert( c1p1 );
 insert( p1 );

 end

 rule Rule A
 when
  $p: Parent( $a2 : attribute2 )
 ?getChildWithName( $p.attribute2, $child;)
 then
 System.out.println(FOUND: + $child ++ $child.getParentId()
 +  ==  + $p.getAttribute2() +  ?? );
 end

 It has nothing to do with nested objects, @PR or modifications.
 It seems that the culprit is the chained property accessor.


 Davide



 On 01/22/2014 02:22 PM, Esteban Aliverti wrote:

  Hi guys,
 I was writing some rules using backward chaining and found a strange
 behavior.
 I managed to isolate the error in the test project I'm attaching.

  In the project I have 2 classes: Parent and Child

  Parent:
 * String id
 * String attribute1
 * String attribute2
 * ListChild children

  Child:
 * String parentId;
 * String name;
 * String value;


  In the test I'm creating 1 Parent object with just 1 child and then
 inserting the Parent object into a drools session:

  Parent p1 = new Parent();
 p1.setId(1);
 p1.setAttribute1(a1);
 p1.setAttribute2(null);

  Child c1p1 = new Child();
 c1p1.setName(n1);
 c1p1.setParentId(p1.getId());
 c1p1.setValue(v1.1);
 p1.addChild(c1p1);

 kSession.insert(p1);
 kSession.fireAllRules();


  So far so good.
 The rules I have in my session are the following:

  declare Parent
 @propertyReactive
 end

  query getChildWithName(String $parentId, String $name, Child $child)
 $child:= Child(parentId == $parentId, name == $name)
 end

  rule Insert Children
 when
 $p: Parent()@watch(!*)
 $c: Child() from $p.children
 then
 System.out.println(Inserting child +$c);
 insert($c);
 end

  rule Rule A
 when
 $p: Parent(attribute2 != null)
 ?getChildWithName($p.attribute2, n1, $child;)
 then
 System.out.println(FOUND: +$child+. The attribute 'parentId' of
 this object must have the value '+$p.getAttribute2()+'. Does it?
 +$child.getParentId()+ == +$p.getAttribute2()+ ??);
 globalList.add($child);
 end


  rule Copy Attribute1 into Attribute2
 when
 $p: Parent(attribute1 != null, attribute2 == null)
 then
 modify($p){
 setAttribute2($p.getAttribute1())
 }
 end

  The important part here is 'Rule A' and 'Copy Attribute1 into
 Attribute2'. The latter copies the value of attribute1 to attribute2 for
 any Parent object present in the session. (Note that the parent I'm
 inserting has attribute2 = null). 'Rule A' is then using a query to get a
 Child object that has a parent with id = $p.attribute2 (where $p is a
 previously matched Parent).
 Given that I only have 1 Parent in my session and that its id is '1' I
 don't expect 'Rule A' to be activated/executed. When I modify
 parent.attribute2 in 'Copy Attribute1 into Attribute2' I'm setting its
 value to 'a1'. 'Rule A' (via the query) should then look for a Child with
 parentid = 'a1' and It shouldn't find anything.
 Funny thing is that 'Rule A' activates and fires. The child object that
 is 'returned' by the query has a parentId of '1' so I don't know how this
 behavior is possible. If you take a look at the System.out output you will
 see that the activation makes no sense at all.

  Am I doing something wrong in my project? Is this a bug? Is this the
 expected behavior?

  Regards,



 

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


   ___
 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

Re: [rules-users] Buggy query behavior in drools 5.6 and 6.1-SNAPSHOT ??

2014-01-22 Thread Esteban Aliverti
Good catch Davide. I can confirm that not using nested accessors the query
works as expected.

Regards,




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


On Wed, Jan 22, 2014 at 6:57 PM, Davide Sottara dso...@gmail.com wrote:

  Indeed, the use case can be simplified further:

 package org.drools.test.bc;

 declare Parent
 attribute2 : String
 end

 declare Child
 parentId : String
 end

 query getChildWithName( String $parentId, Child $child )
 $child:= Child( parentId == $parentId )

 end

 rule Insert Children
 when
 then
 Parent p1 = new Parent( a1 );
 Child c1p1 = new Child( 1 );

 insert( c1p1 );
 insert( p1 );

 end

 rule Rule A
 when
 $p: Parent( $a2 : attribute2 )
 ?getChildWithName( $p.attribute2, $child;)
 then
 System.out.println(FOUND: + $child ++ $child.getParentId() +
  ==  + $p.getAttribute2() +  ?? );
 end

 It has nothing to do with nested objects, @PR or modifications.
 It seems that the culprit is the chained property accessor.


 Davide



 On 01/22/2014 02:22 PM, Esteban Aliverti wrote:

 Hi guys,
 I was writing some rules using backward chaining and found a strange
 behavior.
 I managed to isolate the error in the test project I'm attaching.

  In the project I have 2 classes: Parent and Child

  Parent:
 * String id
 * String attribute1
 * String attribute2
 * ListChild children

  Child:
 * String parentId;
 * String name;
 * String value;


  In the test I'm creating 1 Parent object with just 1 child and then
 inserting the Parent object into a drools session:

  Parent p1 = new Parent();
 p1.setId(1);
 p1.setAttribute1(a1);
 p1.setAttribute2(null);

  Child c1p1 = new Child();
 c1p1.setName(n1);
 c1p1.setParentId(p1.getId());
 c1p1.setValue(v1.1);
 p1.addChild(c1p1);

 kSession.insert(p1);
 kSession.fireAllRules();


  So far so good.
 The rules I have in my session are the following:

  declare Parent
 @propertyReactive
 end

  query getChildWithName(String $parentId, String $name, Child $child)
 $child:= Child(parentId == $parentId, name == $name)
 end

  rule Insert Children
 when
 $p: Parent()@watch(!*)
 $c: Child() from $p.children
 then
 System.out.println(Inserting child +$c);
 insert($c);
 end

  rule Rule A
 when
 $p: Parent(attribute2 != null)
 ?getChildWithName($p.attribute2, n1, $child;)
 then
 System.out.println(FOUND: +$child+. The attribute 'parentId' of
 this object must have the value '+$p.getAttribute2()+'. Does it?
 +$child.getParentId()+ == +$p.getAttribute2()+ ??);
 globalList.add($child);
 end


  rule Copy Attribute1 into Attribute2
 when
 $p: Parent(attribute1 != null, attribute2 == null)
 then
 modify($p){
 setAttribute2($p.getAttribute1())
 }
 end

  The important part here is 'Rule A' and 'Copy Attribute1 into
 Attribute2'. The latter copies the value of attribute1 to attribute2 for
 any Parent object present in the session. (Note that the parent I'm
 inserting has attribute2 = null). 'Rule A' is then using a query to get a
 Child object that has a parent with id = $p.attribute2 (where $p is a
 previously matched Parent).
 Given that I only have 1 Parent in my session and that its id is '1' I
 don't expect 'Rule A' to be activated/executed. When I modify
 parent.attribute2 in 'Copy Attribute1 into Attribute2' I'm setting its
 value to 'a1'. 'Rule A' (via the query) should then look for a Child with
 parentid = 'a1' and It shouldn't find anything.
 Funny thing is that 'Rule A' activates and fires. The child object that is
 'returned' by the query has a parentId of '1' so I don't know how this
 behavior is possible. If you take a look at the System.out output you will
 see that the activation makes no sense at all.

  Am I doing something wrong in my project? Is this a bug? Is this the
 expected behavior?

  Regards,



 

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


 ___
 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] bound variable scope

2013-11-06 Thread Esteban Aliverti
Variable e scope is the accumulate. You can't use it outside. But think
about it for a second, when your rule is activated, variable e (if it would
be possible to access it from the RHS) will have at least 6 different
values. Which value do you want to use?
One possible (of many) solution could be to 'collect' all your events
instead of counting them:

rule Reset alarm
when
a : Alarm()
c : Set( size  5) from accumulate (
e : Event( level  6) over window:time(10s) from
entry-point queue,
collectSet(e)
)
then
//All the Event objects matching the LHS are going to be in the set.
channels[reset].send(Alarm resolved.);
end


Regards,






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


On Tue, Nov 5, 2013 at 11:38 PM, webfrank webfr...@tiscali.it wrote:

 Hi,
I have a rule with a from accumulate where I bind e variable to
 Event
 object. I would like to pass e to
 send method of channel like: channels[reset].send(e); but I got a Rule
 Compilation error with: e cannot be resolved. Why I cannot access
 variable
 e when defined inside from accumulate?


 rule Reset alarm
 when
 a : Alarm()
 c : Number( intValue  5) from accumulate (
 e : Event( level  6) over window:time(10s) from
 entry-point queue,
 count(e)
 )
 then
 channels[reset].send(Alarm resolved.);
 end




 --
 View this message in context:
 http://drools.46999.n3.nabble.com/bound-variable-scope-tp4026652.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] why define the returnedProcessor twice

2013-10-17 Thread Esteban Aliverti
Where did you get that code from? That shouldn't even compile!
I've checked both in 5.2 and 6.0 and I couldn't find the code you are
showing:

5.2:
https://github.com/droolsjbpm/droolsjbpm-integration/blob/5.2.x/drools-camel/src/main/java/org/drools/camel/component/DroolsPolicy.java#L86
6.0:
https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/drools-camel-legacy5/src/main/java/org/drools/camel/component/DroolsPolicy.java#L67

Regards,





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


On Thu, Oct 17, 2013 at 11:37 AM, scarlettxu xu_han...@163.com wrote:

 Hi Expert,

 I am a new guy to drools rules and studying the drools camel server now.
 And I see in the DroolsPolicy class located in project
 drools-camel-5.2.0.Final , it define the returnedProcessor twice

   public Processor wrap(RouteContext routeContext, Processor processor)
   {
 RouteDefinition routeDef = routeContext.getRoute();

 ToDefinition toDrools = getDroolsNode(routeDef);
 *Processor returnedProcessor;
 Processor returnedProcessor;*
 if (toDrools != null) {
   returnedProcessor = new DroolsProcess(toDrools.getUri(), processor);
 }
 else {
   returnedProcessor = processor;
 }
 return returnedProcessor;
   }

 I wonder is it for special purpose ?
 As I checked from version 5.2.0 Final to 6.0.0RC3



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/why-define-the-returnedProcessor-twice-tp4026406.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] How does drools provides an explanation of how the solution was arrived?

2013-10-04 Thread Esteban Aliverti
Let me add that you can also use a custom AgendaEventListener to keep track
of all the rules that were executed.

Regards,




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


On Fri, Oct 4, 2013 at 10:20 AM, rjr201 rich.j.ri...@gmail.com wrote:

 This is a statement about the nature of rules engines in general. Rules
 engines are made up of human readable rules, as opposed to say a neural
 network where the knowledge isn't explicitly represented (it's a big black
 box of maths). A rules engine is symbolic, a neural network sub-symbolic. A
 neural network can give you an answer, but not a justification of why.
 People like rules engines because (when done properly) they can see why it
 has given the answer it has given.

 To answer your question, to get a explanation of what the rules engine did,
 you could insert a logging object as a global into your rules session and
 then add a log statement in the conclusion of each rule.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/How-does-drools-provides-an-explanation-of-how-the-solution-was-arrived-tp4026253p4026263.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] how to check difference between two .pkg files

2013-09-10 Thread Esteban Aliverti
Just one more thing: Guvnor doesn't compare the binary packages, it uses
the data stored in its repository to do this. So, just like Zahid said,
Guvnor uses JCR to compare 2 different versions of the same package.
Doing a binary comparison is not an easy thing. You can take this class as
a starting point (
https://github.com/droolsjbpm/drools/blob/5.6.x/drools-core/src/main/java/org/drools/agent/impl/BinaryResourceDiffProducerImpl.java),
but be sure that it doesn't implement all possible cases.

Regards,




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


On Tue, Sep 10, 2013 at 6:07 AM, Zahid Ahmed zahid.ah...@emirates.comwrote:

 Hi,

 It depends which version of Guvnor u r using. If its 5.x then, there are
 two ways to do this;

 1. Use guvnor provided REST interface to get information related to
 packages.
 2. Use JackRabbit API to directly access the repository as Guvnor 5.x uses
 JackRabbit as the assets repository.

 Regards,
 Zahid Ahmed

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] On Behalf Of maunakea
 Sent: 09 September 2013 20:38
 To: rules-users@lists.jboss.org
 Subject: [rules-users] how to check difference between two .pkg files

 I have 2 .pkg files that are 2 snapshots for the same package from 2
 different Guvnor instances. The 2 Guvnor instances are prod and test. I see
 that within Guvnor, it can show diff between 2 snapshots in its repository.
 If Guvnor can do it, there must be some API that I can use outside in a
 standalone program to compare between .pkg file. Anybody knows how to do
 this?

 thanks



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/how-to-check-difference-between-two-pkg-files-tp4025877.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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

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

Re: [rules-users] Question on From Collect

2013-07-30 Thread Esteban Aliverti
This is a tricky one. When I added this feature to Guvnor, Guvnor
automatically imported some classes like java.util.List, java.util.Set,
etc. Some time later, these automatically imported classes where removed
and you have to manually add their imports in the package configuration.
So, if you want to have the 'missing' methods for Lists and Sets, you just
need to import those classes in the package you are working on.

Regards,




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


On Mon, Jul 29, 2013 at 5:33 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 On 29 July 2013 15:55, IPatel ishita.pa...@usbank.com wrote:

 Hi,

 The below blog shows me how to use From Collect option on LHS.

 http://ilesteban.wordpress.com/2010/05/28/guvnor-guided-editor-suuport-for-fromcollectaccumulate-elements/

 However when i try to use the set option. I do not get the option of
 Size.

 The blog is from Esteban .

 Here is the use case. I have a class which contains a list of objects
 (transcations). All i am trying to do is fetch that list in my LHS so when
 the list is available other rules can be applied.


 If an object of this class already contains a list you don't need from
 collect whose purpose is the composition of a list, to be made up from
 individual objects here and there.

 -W




 Thank you,
 Isha



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



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

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

Re: [rules-users] Iterating string objects inside Arraylist

2013-07-17 Thread Esteban Aliverti
Hi,
Drools supports 'contains' and 'member of' operators. You can find more
information about them in the documentation.

Regards,





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


On Wed, Jul 17, 2013 at 7:49 AM, Ganesh R. ganesh_...@infosys.com wrote:

  I am a novice in Drools, sorry if this question is trivial and has
 already been discussed. I couldn’t find the direct method for implementing
 the below behavior. 

 ** **

 I have a class like this. 

 ** **

 public class Account { 

 public int balance; 

 public String id; 

 public ListString types; 

 // getter setters 

 } 

 ** **

 I am trying to check the following: 

 Accounts having balance greater than $100 and types containing both
 Savings and Checking. 

 ** **

 // Creating sample Facts in Java main 

 Account account = new Account(); 

 account.setBalance(100); 

 account.setId(A1); 

 ListString temp = new ArrayListString(); 

 temp.add(Savings); 

 temp.add(Checking); 

 account.setTypes(temp); 

 ** **

 // Creating rules 

 ** **

 rule Sample 

 ** **

 when 

 bat : Account(balance == 100) 

 then 

if (bat.getTypes().contains(Savings) 
 bat.getTypes().contains(Checking)){ 

 System.out.println(I got this); 

} 

 end 

 ** **

 Is there more proficient ways to do this?? like checking the contents of
 the arraylist (types as per the above example) in rule i.e. in when
 instead of doing it in then ?? 

 ** **

 Much appreciate your answers. 

 Thank you! 

 ** **

  CAUTION - Disclaimer *
 This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
 for the use of the addressee(s). If you are not the intended recipient, please
 notify the sender by e-mail and delete the original message. Further, you are 
 not
 to copy, disclose, or distribute this e-mail or its contents to any other 
 person and
 any such actions are unlawful. This e-mail may contain viruses. Infosys has 
 taken
 every reasonable precaution to minimize this risk, but is not liable for any 
 damage
 you may sustain as a result of any virus in this e-mail. You should carry out 
 your
 own virus checks before opening the e-mail or attachment. Infosys reserves the
 right to monitor and review the content of all messages sent to or from this 
 e-mail
 address. Messages sent to or from this e-mail address may be stored on the
 Infosys e-mail system.
 ***INFOSYS End of Disclaimer INFOSYS***


 ___
 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] Unexpected, Unclear, Unperiodic error

2013-05-15 Thread Esteban Aliverti
Are the admin module and user module running in the same box? Can you
access the package's URL from user's side? The error is clear, the kagent
is getting a HTTP-502 error when it tries to read the package binary. Maybe
a network configuration issue?

Regards,




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


On Wed, May 15, 2013 at 7:10 AM, abhinay_agarwal 
abhinay_agar...@infosys.com wrote:

 I have a piece of code which builds the kbase, when i run it from my local
 system as a java application with guvnor deployed, the code works fine.

 When i try and access from the admin module, it calls the same method
 readKnowledgeBase(), it works.

 But, when i call the same piece of code
 (the same method readKnowledgeBase()) from user module, no extra parameter,
 the same changeset is being used, it throws the following exception.

 java.lang.RuntimeException: KnowledgeAgent exception while trying to
 deserialize KnowledgeDefinitionsPackage
 at

 org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:796)
 at

 org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1103)
 at

 org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:844)
 at

 org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:684)
 at

 org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:207)
 at

 org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:186)
 at

 com.infosys.fps.drools.adapter.DroolsAdapter.readKnowledgeBase(DroolsAdapter.java:58)
 at

 com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.calculateFee(GoalFeeCommissionHelper.java:189)
 at

 com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.processFee(GoalFeeCommissionHelper.java:167)
 at

 com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.processFeeCalculation(GoalFeeCommissionHelper.java:126)
 at

 com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.chargeGoalCreation(GoalFeeCommissionHelper.java:77)
 at

 com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.chargeFee(GoalFeeCommissionHelper.java:55)
 at

 com.infosys.fps.client.goal.service.EduGoalNeedsService.saveEducationNeeds(EduGoalNeedsService.java:932)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at

 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
 at

 org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 at

 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 at

 org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
 at

 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 at

 org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
 at $Proxy57.saveEducationNeeds(Unknown Source)
 at

 com.infosys.fps.client.goal.delegate.EducationGoalDelegate.saveEducationNeeds(EducationGoalDelegate.java:217)
 at

 com.infosys.fps.client.goal.controller.EduGoalNeedsController.saveAfterGoalId(EduGoalNeedsController.java:865)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at

 org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
 at

 org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
 at

 org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
 at

 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
 at

 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
 at

 org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
 at

 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923

Re: [rules-users] Use of the binding variable

2013-05-09 Thread Esteban Aliverti
What you have described is half of the usage of binding variables. You can
bind a variable to a fact or to individual fields of a fact. You can then
use those variables in the LHS or the RHS of your rules.
For example:

1.- Find different Person objects

when
  $p1: Person($name1: name)
  $p2: Person($name2: name, *this != $p1*)
then
  System.out.println(Found +$p1+ with name '+$name1+' and +$p2+ with
name '+$name2+');
end

Regards,





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


On Thu, May 9, 2013 at 3:08 PM, IPatel ishita.pa...@usbank.com wrote:

 Hi,

 I am having little bit difficulty in understanding  binding variable
 concept in the guvnor. During our POC a business user asked me question
 around this and i was able to save myself by telling them that the binding
 variable is used in case you want use the fact again in Then statement.
 (This is how i see it in the examples of rules).

 Can anyone please explaining me the real use of the binding variable so
 that
 i can help my business partner understand it properly?

 Thank you for your help in advance

 Isha



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744.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] Comparing KnowledgePackages for Equality

2013-03-21 Thread Esteban Aliverti
The old knowledge agent did something similar to what you are looking for.
Maybe you could take a look at its implementation and reuse some of the
code:
https://github.com/droolsjbpm/drools/blob/5.5.x/drools-core/src/main/java/org/drools/agent/impl/BinaryResourceDiffProducerImpl.java


Best Regards,




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


On Thu, Mar 21, 2013 at 2:27 PM, gqmulligan gqmulli...@gmail.com wrote:

 Thanks for the suggestion Wolfgang. The problem is that hibernate does
 serialize the packages to compare the bytes and they are still somehow
 different.

 I also felt like I did a test before where I read a serialized package from
 the database, serialized it again, and the bytes were different from the
 original.

 I will test this again to be sure.

 Thanks.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Comparing-KnowledgePackages-for-Equality-tp4022952p4022967.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] Custom UI to create rules and inserting them via REST API

2013-01-29 Thread Esteban Aliverti
As far as I know, there is no API for DRL creation.

Best Regards,




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


On Mon, Jan 28, 2013 at 2:32 PM, benq2188 bengisag...@gmail.com wrote:

 Esteban thanks for the quick reply, so in this case my question is, which
 object is the key in the API to create .drl rule ? Should I create
 RuleModel?

 Also how can I store that .drl via POST method of the REST?

 Regards,

 Bengi.


 Esteban wrote
  If you are not planning to use Guvnor to author your rules, there is no
  need to store them in BRL format. You can store your rules as 'technical
  rules' directly.
 
  Best Regards,
 
 
  
 
  Esteban Aliverti
  - Blog @ http://ilesteban.wordpress.com
 
 
  On Mon, Jan 28, 2013 at 2:10 PM, benq2188 lt;

  bengisaglam@

  gt; wrote:
 
  Hi everyone,
 
  I would like to implement an Expert System which I can have my own UI to
  generate user defined rules, and I am planning to use REST API to
  insert/update/delete the rules,which are in the guvnor repository.
 Inside
  the guvnor, I would like to store my rules in .drl format. So I was
  wondering two thing:
 
  - Is that possible to create a brl file in XStream xml format as output
  of
  the UI, and store it in the repository as .drl format?. (I know the
  conversion from .brl to .drl is possible by using BRDRLPersistance
  object.)
  If it is possible then which object is the key point to create it from
  the
  package org.drools.ide.common.client.modeldriven.brl?
 
  -Another problem, by using REST API I can update and retrieve an asset
 in
  text/plain format, however I could not succeed to insert new asset into
  repository by using POST method. So how can I insert a new .drl rule
 into
  repository via REST.
 
  I will appreciate if you have some sample code for any of them and will
  be
  greatful for any help,
 
  Thanks,
 
  Bengi.
 
 
 
  --
  View this message in context:
 
 http://drools.46999.n3.nabble.com/Custom-UI-to-create-rules-and-inserting-them-via-REST-API-tp4021848.html
  Sent from the Drools: User forum mailing list archive at Nabble.com.
  ___
  rules-users mailing list
 

  rules-users@.jboss

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

  rules-users@.jboss

  https://lists.jboss.org/mailman/listinfo/rules-users





 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Custom-UI-to-create-rules-and-inserting-them-via-REST-API-tp4021848p4021851.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] form of accumulate in examples is depricated?

2013-01-22 Thread Esteban Aliverti
There are currently 3 ways to write your accumulate pattern in drools:

   1. The way you have pointed out containing all the different sections:
   init, action, reverse and result. The problem with this syntax is that you
   have to embed java code in your rules making them hard to read and
   maintain. Following this syntax, if you want to reuse an accumulate
   function you have to copy and paste it. This form of accumulate is highly
   discouraged by drools team.
   2. Use some of the predefined accumulate functions like sum(), avg(),
   count(), etc.
   3. If the predefined set of accumulate functions is not enough you can
   create your accumulate function in a Java class and then register it in
   drools and use it in your DRL. Please refer to the documentation for
   further information.

Best Regards,





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


On Tue, Jan 22, 2013 at 10:04 AM, Michiel Vermandel mverm...@yahoo.comwrote:

 Hi,

 In lots of rules in the drools planner examples the accumulate function is
 used in this way:

 rule requiredCpuPowerTotal
 when
 $computer : CloudComputer($cpuPower : cpuPower)
 $requiredCpuPowerTotal : Number(intValue  $cpuPower) from
 accumulate(
 CloudProcess(
 computer == $computer,
 $requiredCpuPower : requiredCpuPower),
 sum($requiredCpuPower)
 )
 then
 insertLogical(new IntConstraintOccurrence(requiredCpuPowerTotal,
 ConstraintType.NEGATIVE_HARD,
 $requiredCpuPowerTotal.intValue() - $cpuPower,
 $computer));
 end

 (example from cloudBalancing).

 Though, documentation says (
 http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_single/#d0e6921)
 one should this syntax:

 result pattern from accumulate( source pattern,
   init( init code ),
   action( action code ),
   reverse( reverse code ),
   result( result expression ) )

 Does this mean that the axemples could be optimized and that I should go
 for that syntaxt as well rather than using the syntax like rule
 requiredCpuPowerTotal ?

 Thanks


 -
 http://www.codessentials.com - Your essential software, for free!
 Follow us at http://twitter.com/#!/Codessentials

 ___
 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] Guvnor 5.5 being WIERD

2013-01-17 Thread Esteban Aliverti
Maybe a screenshot of Guvnor's editor might help.

Best Regards,




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


On Thu, Jan 17, 2013 at 12:01 PM, starfish15 pooja.gh...@accenture.comwrote:


 Manstis,

 If you notice the code written to execute the rules, you will find the
 Dummy
 object being added. That inserts the fact in the working memory of the
 rules
 i beleive. And hence it shud have been available in the Condition Facts
 also
 when i tried to add that. My Model.jar has all the three Facts in them.
 However, i always got only class, class1. Dummy was never received.

 Regards,
 Starfish



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Guvnor-5-5-being-WIERD-tp4021569p4021603.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] How are rules imported into the knowledgebuilder?

2013-01-16 Thread Esteban Aliverti
String rules = ...;

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newByteArrayResource(rules.getBytes()),
ResourceType.DRL);

You may also use .newInputStreamResource(), .newReaderResource() or
.newURLResource()

Best Regards,




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


On Wed, Jan 16, 2013 at 11:33 AM, Bojan Janisch 
bojan.jani...@scai.fraunhofer.de wrote:

 Hello everybody,

 the problem that I'm facing right know is,
 that I want to create rules from a program
 and (without writing it to file) loading it
 into the knowledgebuilder.

 So does anybody know how I can load a rule
 into the knowledgebuilder without using a
 file?

 Thanks to everyone who reads this.

 Bojan
 ___
 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] Hello and my first question

2013-01-14 Thread Esteban Aliverti
You can take a look at 'Conditional named consequences' to see if that is
what you need:
http://docs.jboss.org/drools/release/5.5.0.Final/droolsjbpm-introduction-docs/html_single/#releaseNotes_5.5.0_Expert

Best Regards,




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


On Mon, Jan 14, 2013 at 11:45 AM, Bojan Janisch 
bojan.jani...@scai.fraunhofer.de wrote:

 Hello everybody,

 this is my first post and also my first question to you.
 I've searched the net for quite some hours now, but don't get any
 information regarding optionally conditions.

 I'm using drools to annotate some textobjects and I'm stucking with the
 following rule:

 When there are two named entities, one body side and one anatomy in a text
 (they're defined earlier by a textannotating system, so I'm working on
 annotated objects) and there is a optionally anatomic side (it contains
 generally something like lateral oder medial and so on), then generate
 me a new annotation.

 So up to now I'm on this state:

 Rule Anatomic Side

 when

  $NE1 : NE(Type.contains(body))
  $NE2 : NE(Type.contains(anatomy))

  //So here starts the problem
  [$NE3 : NE(Type.contains(anatomic))]

 then
  ...

 How can I set a condition as optionally or is there no such way?

 Thanks everyone to who reads this.
 Janisch
 ___
 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] Listen event in different package

2013-01-11 Thread Esteban Aliverti
According to the code you have shown, OtherItem is not defined as an
@role(event)
but you are using it to do time-related comparisons.

Best Regards,




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


On Fri, Jan 11, 2013 at 12:59 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Add two declare ... @role(event) end to listener.drl.

 -W

 On 11/01/2013, Marco Malziotti marco.malzio...@trs.it wrote:
  Hello
  I am a beginner in Drools 5.1.1 and try to listen a event in a packageX
  inserted by a rule in another packageY.
  I have following 2 drl file :
 
  ---inserter.drl
  package packageY
  import internal.event.*;
 
  declare EventItem
 @role (event)
  end
 
  rule insert EventItem
  when
 ...
  then
 EventItem ei = new EventItem(...);
 insert(ei);
  end
  
 
  ---listener.drl---
  package packageX
  import internal.event.*;
 
  rule listen EventItem temporal constraint
  when
 ei: EventItem()
 oi: OtherItem(this after ei)
  then
 System.out.println(Hello word);
  end
  
 
  EventItem and OtherItem are defined in 'internal.event' package.
  If I run with a StatefulKnowledgeSession configured in 'pseudo clock',
  I have following stack trace:
 
  java.lang.ClassCastException: org.drools.common.DefaultFactHandle
  cannot be cast to org.drools.common.EventFactHandle
  at
 
 org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:322)
  at
 
 org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:117)
  at
 
 org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:121)
  at
 
 org.drools.common.SingleBetaConstraints.isAllowedCachedRight(SingleBetaConstraints.java:151)
  at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:125)
  at
 
 org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
  at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
  at
 
 org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
  at
  org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
  at
  org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
  at
 
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1174)
  at
 
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1123)
  at
 
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:917)
  at
 
 org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:251)
  ...
 
  Moving listener.drl in packageY, all works.
  I don't know if it is already open a related issue, perhaps the :
  https://issues.jboss.org/browse/JBRULES-2774
  Thanks for your attention.
  Regards.
 
  Marco Malziotti
  Tecnologie nelle Reti e nei Sistemi T.R.S. S.p.A.
  Integration Test Engineer
  Tel.  + 39 06.87281.407
  Fax.  + 39 06.87281.550
  E-mail: marco.malzio...@trs.it
 
 
  Tecnologie nelle Reti e nei Sistemi T.R.S. SpA
  Via della Bufalotta, 378 - 00139 Roma
  Tel +39.06.87.28.1.1 - Fax +39.06.87.28.1.550
 
  ---
 
  Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in
  questo messaggio
  sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio
 in
  parola Le
  fosse pervenuto per errore, la preghiamo di eliminarlo senza copiarlo e
 di
  non inoltrarlo
  a terzi, dandocene gentilmente comunicazione. Grazie.
  This message, for the law 196/2003, may contain confidential and/or
  privileged information.
  If you are not the addressee or authorized to receive this for the
  addressee, you must not
  use, copy, disclose or take any action based on this message or any
  information herein.
  If you have received this message in error, please advise the sender
  immediately by reply
  e-mail and delete this message. Thank you for your cooperation.
 
  ---
 
  This message has been scanned for viruses and dangerous content by
  MailScanner, and is believed to be clean.
 
 
  ___
  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] Correlating 2 independent streams of events

2013-01-07 Thread Esteban Aliverti
Thanks Wolfgang.
I was trying to solve the whole situation with just 1 rule, but not I'm
trying to separate the problem in multiple rules. There are some
bugs/language-limitations/programmer-skills-limitations that are preventing
me to get the expected results though.

Let's say I have a rule identifying my last 3 EventA (ALL my facts are
declared as events):


declare Last3A
@role(event)
firstEvent: EventA
lastEvent: EventA
end

rule 'Detect last 3'
when
   //some magic using sliding windows
then
   //$firstEventA and $lastEventA are the bounds identified in the LHS of
the rule.
   //EventA class doesn't have an explicit timestamp (drools is providing
it) and I'd prefer to leave it that way.
   insert (new Last3A($fistEventA, $lastEventA));
end


Then I have my rule trying to get the occurences of EventB that happen
during a Last3A

rule 'Get EventBs'
when
   $l: Last3A()
   //originally, I've used a collect here since I wanted a single
activation, but I'll use a single event here just to make syntax cleaner.
   EventB(this after $l.firstEvent,this before $l.lastEvent)
then
   ...
end

If I try the latter rule, after I insert the third EventA (I'm calling
fireAllRules() after each insertion) I get the following exception:

*Exception executing consequence for rule Detect last 3 in com.whatever:
java.lang.ClassCastException: com.whatever.EventA cannot be cast to
java.lang.Number*
*...*
*Caused by: java.lang.ClassCastException: **com.whatever.EventA** cannot be
cast to java.lang.Number
*
*at
org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedLeft(AfterEvaluatorDefinition.java:341)
*

I'm assuming Drools is trying to cast the result of $l.firstEvent into a
number (probably because it is expecting a timestamp) even though the
result is already an Event.

In order to avoid the $l.firstEvent and $l.lastEvent invocations I re-wrote
the rule as follows (is ugly, I know):

rule 'Get EventBs'
when
   $l: Last3A()
   $firstEvent: EventA() from $l.getFirstEvent()
   $lastEvent:  EventA() from $l.getLastEvent()
   EventB(this after $firstEvent,this before $lastEvent)
then
   ...
end

The exception now is:

*Exception executing consequence for rule **Detect last 3** in
com.cognitive.nsf.management: java.lang.ClassCastException:
org.drools.common.DefaultFactHandle cannot be cast to
org.drools.common.EventFactHandle*
*
*
What is happening now is that Drools doesn't realize that the object I'm
using for after and before are actually Events.
So it seems that temporal operators can only be used with events coming
from the same rule (and not coming from a 'from' or any other black box).
I'll continue digging on this, but it seems that the only solution will be
to use explicit time stamps and then use them instead of the events in my
marker fact.

Best Regards,








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


On Mon, Jan 7, 2013 at 12:17 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Use wrapper or marker facts to identify the last three EventA's
 and a rule to push EventA's through these markers. Then, a simple
 rule will give you all EventBs between the extremes of the marker set.

 Take care to get the start-up right ;-)

 -W

 On 07/01/2013, Esteban Aliverti esteban.alive...@gmail.com wrote:
  Let's say I have two independent streams of different events: EventA and
  EventB. Which is the best way to get all the occurrences of EventB that
  happened between the last 3 occurrences of EventA?
 
  For example:
 
  from:
  $b1:EventB, $a1:EventA, $b2:EventB, $b3:EventB, $a2:EventA,
  $b4:EventB, $b5:EventB, $a3:EventA, $b6:EventB
 
  I would like to get $b2, $b3, $b4, $b5
 
  Best Regards,
 
 
 
 
  
 
  Esteban Aliverti
  - Blog @ http://ilesteban.wordpress.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] Guvnor rule validation using Java Code?

2013-01-02 Thread Esteban Aliverti
You can get the whole source code of the pkg (drl) an the model (jar) from
Guvnor using rest and then you could try to compile the package in your app
using Drools APIs. That is what Guvnor does.

Best regards,
 On Jan 2, 2013 8:59 AM, arup arup4u2...@gmail.com wrote:

 Thanks for your replies.

 Here is my requirement.

 We are developing an application where we can interact with Guvnor using
 REST API. We will use this application only to manage rules not the Guvnor.
 Now is there any way to validate the rules or validate the whole package as
 we do in Guvnor while building the package? For now I have created few
 methods to check the syntax errors in a rule. But I need drools based
 validation. like validating a rule depending on it's Pojo model, validating
 import and global, rule condition and action parts etc. just as we do in
 IDE
 by clicking validate.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Guvnor-rule-validation-using-Java-Code-tp4021291p4021329.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] Writing a rule to find a fact that has a minimum value

2012-12-19 Thread Esteban Aliverti
rule 'Smallest city'
when
   $smallCity: City()
   not City(population  $smallCity.population)
then
   System.out.println(This is the smallest city: +$smallCity);
end

Best Regards,




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


On Wed, Dec 19, 2012 at 4:20 PM, David R Robison 
drrobi...@openroadsconsulting.com wrote:

 I want to write a rule that will select a fact that has the minimum
 value for an attribute. For example, find the city that has the minimum
 population. How would I write such a rule? David

 --

 David R Robison
 Open Roads Consulting, Inc.
 103 Watson Road, Chesapeake, VA 23320
 phone: (757) 546-3401
 e-mail: drrobi...@openroadsconsulting.com
 web: http://openroadsconsulting.com
 blog: http://therobe.blogspot.com
 book:
 http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526



 This email communication (including any attachments) may contain
 confidential and/or privileged material intended solely for the individual
 or entity to which it is addressed.
 If you are not the intended recipient, please delete this email
 immediately.


 ___
 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] Executing more than one rules having no infinite execution

2012-12-07 Thread Esteban Aliverti
Using drools.halt() is not considered a good practice at all. I would
recommend you to read this post:
http://ilesteban.wordpress.com/2012/11/16/about-drools-and-infinite-execution-loops/

Best Regards,




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



On Fri, Dec 7, 2012 at 8:59 AM, Hushen Savani
hushen.sav...@elitecore.comwrote:

  Hi,

 ** **

 I have a simple rule as following:

 ** **

 *import java.util.HashMap;*

 * *

 *rule first*

 *when*

 * a : CrestelRuleModel( $hmap : singleHashMap!=null);*

 *then*

 * System.out.println(Old Map:  + $hmap);*

 * HashMap mapp = new HashMap();*

 * mapp.put(hello, world);*

 * a.setSingleHashMap(mapp);*

 * System.out.println(New Map:  + a.getSingleHashMap());*

 * update(a);*

 *end;*

 ** **

 When I invoke the rule from my client, the rule is executed *infinitely*.*
 ***

 ** **

 So, I have placed a “*drools.halt()*” before “*end*” statement of above
 rule. So, it stopped executing infinitely as I wanted. But *is it a good
 practice?*

 ** **

 Now, I want my input to be filtered by *two rules*, so I have placed
 rules like following:

 ** **

 *import java.util.HashMap;*

 * *

 *rule first*

 *when*

 * a : CrestelRuleModel( $hmap : singleHashMap!=null);*

 *then*

 * System.out.println(Old Map:  + $hmap);*

 * HashMap mapp = new HashMap();*

 * mapp.put(hello, world);*

 * a.setSingleHashMap(mapp);*

 * System.out.println(New Map:  + a.getSingleHashMap());*

 * update(a);*

 * drools.halt();*

 *end;*

 * *

 *rule second*

 *when*

 * b : CrestelRuleModel( $hmap2 : singleHashMap!=null);*

 *then*

 * System.out.println(Old Map2:  + $hmap2);*

 * HashMap mapp2 = new HashMap();*

 * mapp2.put(hello2, world2);*

 * b.setSingleHashMap(mapp2);*

 * System.out.println(New Map2:  + b.getSingleHashMap());*

 * update(b);*

 * drools.halt();*

 *end;*

 ** **

 But in above case, *only the “second”  rule executes*. What to do in
 order to execute both the rules without any infinite loop?

 ** **

 Kindly share some pointers on this. Thanks.

 ** **

 ** **

 *PS*: *CrestelRuleModel* is my POJO model having following fields,

 * *

 *public* *class* CrestelRuleModel {



*private* *ArrayList* arrayListOfHashMap;

*private* *HashMap* singleHashMap;

*private* Object object;

*private* String remarks;

 ** **

//Getters and Setters

 ** **

 }

 ** **

 Best Regards

 *Hushen Savani* | Crestel Billing

 [image: ecTag]

 ** **

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


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


Re: [rules-users] A basic doubt about Drools Fusion

2012-12-07 Thread Esteban Aliverti
It could be the case, and I'm guessing here, that the AgendaEventListener
is called just before the activation is placed into the agenda. So, the
call to fireAllRules() finds an empty agenda. What you could do to check if
this is what is happening, is to insert 2 EvenA objects. The second call of
fireAllRules() should fire the activation of the first object (and you will
miss the activation of the second).

Best Regards,






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



On Fri, Dec 7, 2012 at 1:55 PM, Adrián Paredes 
adri...@epidataconsulting.com wrote:

 Hi all:

 I have a very basic doubt about Drools Fusion.

 I have two simple Java classes:

 EventA  {
 String id;
 Date timestamp;
 Long duration;
 }

 EventB {
 String id;
 Date timestamp;
 Long duration;
 }

 I have a DRL file, where I declare this two classes as Events:

 declare EventA
 @role(event)
 @timestamp(timestamp)
 @duration(duration)
 end

 declare EventB
 @role(event)
 @timestamp(timestamp)
 @duration(duration)
 end

 I have a simple rule:

 rule Basic Rule
 dialect 'mvel'
 when
 $eventA: EventA($aId: id) from entry-point time stream
 then
 System.out.println(Event A  + $aId +  at  + $eventA.timestamp);
 end

 Finally, I have a test that starts a StatefulKnowledgeSession in STREAM
 mode, register an eventLister in the session in order to fire the rules
 when an event arrives:

 ksession.addEventListener(new DefaultAgendaEventListener() {
 @Override
 public void activationCreated(ActivationCreatedEvent event) {
 ((StatefulKnowledgeSession)
 event.getKnowledgeRuntime()).fireAllRules();
 }
 });

 And then the test insert in the time stream entry-point an instance of
 EventA with duration of 10 miliseconds, as follows:

 EventA eventA = new EventA();
 eventA.setId(123);
 eventA.setTimestamp(new Date());
 eventA.setDuration(10L);
 ksession.getWorkingMemoryEntryPoint(time stream).insert(event);

 At the end of the test, I have an sleep of 2 seconds just in case.

 I don't understand why the Basic Rule never fires.

 But if I add another condition to the same rule, something like this:

 rule Basic Rule
 dialect 'mvel'
 when
 $eventA: EventA($aId: id) from entry-point time stream
 not EventB($aId == id, this after [0s,5s] $eventA) from entry-point
 time stream
 then
 System.out.println(Event A  + $aId +  at  + $eventA.timestamp);
 end

 The rules fires and I see this message in console:

 Event A 123 at Fri Dec 07 09:48:59 ART 2012

 I don't understand why the first rule, that is more open, don't fire, and
 the second rule, that is more restrictive, fires without problems.

 Thank you very much!

 Greetings,
 Adrian.

 --
 *Epidata Consulting | Deploying Ideas
 Ing. Adrián M. Paredes | Arquitecto Desarrollador
 adri...@epidataconsulting.com | Cel: (54911) 3297 1713

 
 Argentina: Maipú 521 Piso 1 Of. A | Buenos Aires | Of: (5411) 5031 0060
 Chile: Apoquindo 3600 Piso 7 y 9 | Las Condes - Santiago | Of: (+56) 2
 495 8450

 ---
  www.epidataconsulting.com
  Linkedin http://bit.ly/epidatalinkedin | 
 Facebookhttp://www.facebook.com/epidata.consulting
  | Twitter http://twitter.com/epidata
 *

 ___
 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] A basic doubt about Drools Fusion

2012-12-07 Thread Esteban Aliverti
I think you have 2 main options here:

   - Invoke fireUnitlHalt() in an independent thread.
   - Invoke fireAllRules() after each insert() you have.

Best Regards,





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



On Fri, Dec 7, 2012 at 3:57 PM, Adrián Paredes 
adri...@epidataconsulting.com wrote:

 Thank you, Esteban.

 You are right! If I insert two events A:

 rulesTest.addEventA(123);
 rulesTest.addEventA(456);

 The second call of fireAllRules() activates the rule for the first object:

 Event inserted com.epidataconsulting.drools.model.EventA
 Event A 123 at Fri Dec 07 11:54:21 ART 2012
 Event inserted com.epidataconsulting.drools.model.EventA

 But not for the second.

 How I can do to correct this behavior?

 Thanks!

 Adrian


 2012/12/7 Esteban Aliverti esteban.alive...@gmail.com

 It could be the case, and I'm guessing here, that the AgendaEventListener
 is called just before the activation is placed into the agenda. So, the
 call to fireAllRules() finds an empty agenda. What you could do to check if
 this is what is happening, is to insert 2 EvenA objects. The second call of
 fireAllRules() should fire the activation of the first object (and you will
 miss the activation of the second).

 Best Regards,




 

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



 On Fri, Dec 7, 2012 at 1:55 PM, Adrián Paredes 
 adri...@epidataconsulting.com wrote:

 Hi all:

 I have a very basic doubt about Drools Fusion.

 I have two simple Java classes:

 EventA  {
 String id;
 Date timestamp;
 Long duration;
 }

 EventB {
 String id;
 Date timestamp;
 Long duration;
 }

 I have a DRL file, where I declare this two classes as Events:

 declare EventA
 @role(event)
 @timestamp(timestamp)
 @duration(duration)
 end

 declare EventB
 @role(event)
 @timestamp(timestamp)
 @duration(duration)
 end

 I have a simple rule:

 rule Basic Rule
 dialect 'mvel'
 when
 $eventA: EventA($aId: id) from entry-point time stream
 then
 System.out.println(Event A  + $aId +  at  + $eventA.timestamp);
 end

 Finally, I have a test that starts a StatefulKnowledgeSession in STREAM
 mode, register an eventLister in the session in order to fire the rules
 when an event arrives:

 ksession.addEventListener(new DefaultAgendaEventListener() {
 @Override
 public void activationCreated(ActivationCreatedEvent event) {
 ((StatefulKnowledgeSession)
 event.getKnowledgeRuntime()).fireAllRules();
 }
 });

 And then the test insert in the time stream entry-point an instance of
 EventA with duration of 10 miliseconds, as follows:

 EventA eventA = new EventA();
 eventA.setId(123);
 eventA.setTimestamp(new Date());
 eventA.setDuration(10L);
 ksession.getWorkingMemoryEntryPoint(time stream).insert(event);

 At the end of the test, I have an sleep of 2 seconds just in case.

 I don't understand why the Basic Rule never fires.

 But if I add another condition to the same rule, something like this:

 rule Basic Rule
 dialect 'mvel'
 when
 $eventA: EventA($aId: id) from entry-point time stream
 not EventB($aId == id, this after [0s,5s] $eventA) from entry-point
 time stream
 then
 System.out.println(Event A  + $aId +  at  + $eventA.timestamp);
 end

 The rules fires and I see this message in console:

 Event A 123 at Fri Dec 07 09:48:59 ART 2012

 I don't understand why the first rule, that is more open, don't fire,
 and the second rule, that is more restrictive, fires without problems.

 Thank you very much!

 Greetings,
 Adrian.

 --
 *Epidata Consulting | Deploying Ideas
 Ing. Adrián M. Paredes | Arquitecto Desarrollador
 adri...@epidataconsulting.com | Cel: (54911) 3297 1713

 
 Argentina: Maipú 521 Piso 1 Of. A | Buenos Aires | Of: (5411) 5031 0060
 Chile: Apoquindo 3600 Piso 7 y 9 | Las Condes - Santiago | Of: (+56) 2
 495 8450

 ---
  www.epidataconsulting.com
  Linkedin http://bit.ly/epidatalinkedin | 
 Facebookhttp://www.facebook.com/epidata.consulting
  | Twitter http://twitter.com/epidata
 *

 ___
 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




 --
 *Epidata Consulting | Deploying Ideas
 Ing. Adrián M. Paredes | Arquitecto Desarrollador
 adri...@epidataconsulting.com | Cel: (54911) 3297 1713

 
 Argentina: Maipú 521 Piso 1

Re: [rules-users] Value is not reflected in Fact Object at Drool Client Side

2012-12-05 Thread Esteban Aliverti
I'm wondering where did you get the content of that Guvnor.properties file.
The problem you are having is that the property file is not used to tell
the agent which resources should it use, but to set some of its internal
configurations such as:

   - drools.agent.monitorChangeSetEvents (boolean)
   - drools.agent.scanDirectories (boolean)
   - drools.agent.scanResources (boolean)
   - drools.agent.newInstance (boolean)
   - drools.agent.useKBaseClassLoaderForCompiling (boolean)
   - drools.agent.validationTimeout (long)

So, the properties you have there are not even being user, nor understood,
by drools.
In order to tell the agent which resources should it use, you must provide
a change-set pointing to those resources. You can find more information
about change-sets in Drools documentation.

Best Regards,




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



On Wed, Dec 5, 2012 at 8:52 AM, Hushen Savani
hushen.sav...@elitecore.comwrote:

  It seems that problem is with rule consumer (client), because even when
 I mess up with url of guvnor, it is giving me the same behavior:

 ** **

 *Guvnor.properties*:

 ** **

 url=http://localhost:10080/   *guvnor*-5.5.0.Final-*tomcat*
 -6.0/org.drools.guvnor.Guvnor/package/new *Pkg*/car111_*messed_up_url*

 enableBasicAuthentication=true

 username=*admin*

 password=*admin*

 name=*drooltest*

 * *

 ** **

 *Drool Consumer*:

 ** **

 *package* kijanowski.eu;

 ** **

 *import* java.util.Collection;

 *import* java.util.Iterator;

 ** **

 *import* org.drools.KnowledgeBase;

 *import* org.drools.agent.KnowledgeAgent;

 *import* org.drools.agent.KnowledgeAgentFactory;

 *import* org.drools.runtime.StatefulKnowledgeSession;

 ** **

 *public* *class* GuvnorTest {

 ** **

 *public* *static* *final* *void* main(String[] args) {

 ** **

   KnowledgeAgent agent =  KnowledgeAgentFactory.*
 newKnowledgeAgent*(/Guvnor.properties); 

   KnowledgeBase ruleBase = agent.getKnowledgeBase();

 ** **

   StatefulKnowledgeSession workingMemory =
 ruleBase.newStatefulKnowledgeSession();

   

 Driver d = *new* Driver(Jarek, 20, *null*);

 workingMemory.insert(d);

 ** **

 workingMemory.fireAllRules();

 

 *Collection* c = workingMemory.getObjects();

 

 *for*(*Iterator* i = c.iterator(); i.hasNext();) {


 //System.out.println(i.next().getClass().getCanonicalName());

   Driver e = (Driver)i.next();

   System.*out*.println( Age:  + e.getAge() +  Name: + 
 e.getName() + 
 Car:  + e.getCar() +  Object:  + e);

 }

 }

 }

 ** **

 Can anyone please suggest some pointers on the same.

 ** **

 Thanks.

 ** **

 Best Regards

 *Hushen Savani*

 ** **

 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Esteban Aliverti
 *Sent:* Tuesday, December 04, 2012 9:38 PM
 *To:* Rules Users List
 *Subject:* Re: [rules-users] Value is not reflected in Fact Object at
 Drool Client Side

 ** **

 Sorry, I've just re-read your post and saw that you already mentioned that
 you are not seeing the system.out of your rule.

 What you can do is to debug (or add some code) to see which rules do you
 have in the kbase returned by the kagent.

 My guess is that your are not getting what you are expecting from Guvnor.*
 ***

 ** **

 Best Regards,  



 

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

 

 On Tue, Dec 4, 2012 at 5:03 PM, Esteban Aliverti 
 esteban.alive...@gmail.com wrote:

 Do you see the message you are printing in the RHS of your rule?

 ** **

 Best Regards,



 

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



 

 On Tue, Dec 4, 2012 at 3:28 PM, Mister Nono noel.maur...@univ-jfc.fr
 wrote:

 Hi,

 Have you try to add in the then of the drools rule the line : *update(a);*

 Best regards. ;)



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/rules-users-Value-is-not-reflected-in-Fact-Object-at-Drool-Client-Side-tp4021067p4021068.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

 ** **

 ** **

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


___
rules-users mailing list
rules-users

Re: [rules-users] keep only one, retract all other

2012-11-30 Thread Esteban Aliverti
Another way to obtain what you are looking for could be this:

rule Remove all but one
when
$f1: Fact(id == aaa)
$f2: Fact(id == aaa, this != $f1)
then
retract($f2);
end

The difference with this approach is the number of activations you will
have.

Best Regards,




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


On Fri, Nov 30, 2012 at 10:06 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 It seems you are using dialect mvel? This doesn't work
 in 5.2.0, 5.3.0 and 5.4.0. (I haven't tried 5.5)

 Use dialect java.

 -W

 On 30/11/2012, Martin Minka martin.mi...@gmail.com wrote:
  I was using ArrayList before and I don't think this is the real problem.
  collect() will return object compatible with List interface so it is
 valid
  to use size() and get() methods on $removeUs.
  I have helper method myhelper.log() with accepts any object and *
  myhelper.log($removeUs.get(i))* works for me, unfortunately
  *retract($removeUs.get(i))
  *doesn't work with error:
 
  Error: unable to resolve method using strict-mode:
  org.drools.spi.KnowledgeHelper.drools()] [Near : {...
  drools.retract($removeUs }]
 
  It looks like it is not even compiled.
 
  2012/11/30 Wolfgang Laun wolfgang.l...@gmail.com
 
  On 30/11/2012, Martin Minka martin.mi...@gmail.com wrote:
   Thank you for the tip. What solution would you suggest to solve my
  problem
   ?
 
  Look into the javadoc of java.util to find any class implementing List
  :-)
  -W
 
  
   Martin
  
  
   2012/11/30 Wolfgang Laun wolfgang.l...@gmail.com
  
   You cannot use an interfact (List) to instantiate an object, which
   is happening due to the collect.
   --W
  
   On 30/11/2012, Martin Minka martin.mi...@gmail.com wrote:
I want to keep only 1 fact with id==. But this is not
 working:
   
rule leave only one
when
$removeUs : java.util.List(size1)
from collect(Fact(id==)
then
size = $removeUs.size();
for (int i=1; i  size; i++) {
retract($removeUs.get(i));
}
end
   
   ___
   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] lock-on-active clarification needed

2012-11-16 Thread Esteban Aliverti
I've put together my ideas and findings in this topic in my blog:
http://ilesteban.wordpress.com/2012/11/16/about-drools-and-infinite-execution-loops/
Feel free to read it and provide feedback if desired.

Best Regards,




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


On Thu, Nov 15, 2012 at 2:14 PM, Esteban Aliverti 
esteban.alive...@gmail.com wrote:

 Thanks for your clarifications and thoughts.
 My misunderstanding was because I always thought that lock-on-active meant
 lock-on-RULE-active. Something like lock after the first activation and do
 not unlock until the agenda group is changed.
 The real meaning is lock-on-AGENDA_GROUP-active. Meaning: do not create
 activations of this rule (no matter if using update(), modify(), insert()
 or retract()) if the agenda group where it belongs is active.

 Best Regards!


 

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


 On Thu, Nov 15, 2012 at 7:54 AM, Mattias Nilsson Grip 
 mattias.nilsson.g...@redpill-linpro.com wrote:

 Armand/Esteban,

 I had a look at source code (
 org.drools.common.DefaultAgenda.createActivation(...) ) and as far as I can
 tell it should not matter if the rules match on the same facts or not. I
 interpret the source code like this:

 While an agenda group or rule flow group is active, any rules within
 that group with lock-on-active set to true are prevented from creating new
 activations

 I.e. the rule Rule 1 cannot create an activation since its agenda group
 MAIN is already active when its conditions are fulfilled.

 Regards,
 Mattias

 - Original Message -
 From: Armand Welsh awe...@statestreet.com
 To: Rules Users List rules-users@lists.jboss.org
 Sent: Wednesday, 14 November, 2012 11:04:36 PM
 Subject: Re: [rules-users] lock-on-active clarification needed

 Esteban,

 I too have been confused by lock-on-active. Only after reading the
 definition many times, have I come to the following conclusion:

 Looking at the documentation, and other examples, I think I can how
 lock-on-active behaves. From what I gather, it looks like when “init “ rule
 fires, the activations for that rule consist of the DataSample() facts (all
 of them). You then modify the fact, but at the same time, the
 lock-on-active blocks any further activations from occur as a result of
 modifying the DataSample() fact.

 Since “Rule 1” depends on DataSample, and it is in the same agenda group
 as init, “Rule 1” cannot fire until the agenda group is changed, or the
 ruleflow-group is changed.

 What is being blocked by lock-on-active is not the reactivation of the
 rule. What is being blocked is the resultant activations as a result of
 modify the DataSample fact.

 This block only holds true on the current focus (agenda-group or
 ruleflow-group). Think of it as a way of temporarily removing the facts
 from the knowledge tree.

 From: rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] On Behalf Of Esteban Aliverti
 Sent: Wednesday, November 14, 2012 3:41 AM
 To: Rules Users List
 Subject: [rules-users] lock-on-active clarification needed

 Hi all,

 I'm dealing with a set of rules having the lock-on-active attribute and
 I'm not getting the (at least what I understand as) expected results.

 I've created an isolated JUnit test. I'm attaching it to this email.

 Basically, I have 2 rules:

 rule init

 lock-on-active true

 when
 $d: DataSample()
 then
 System.out.println(Setting predefined value);
 modify($d){
 addValue(Parameter.PARAM_A, 10.0)
 }
 end

 rule Rule 1
 lock-on-active true
 when
 DataSample($v: values[Parameter.PARAM_A]  20)
 then
 System.out.println(Rule 1: +$v);
 end

 DataSample is a Java class containing a MapParameter, Double where
 Parameter is an enum.

 In the test I'm creating a ksession and inserting an empty DataSample
 object.

 I understand that as soon as the object is inserted, both rules are
 evaluated and the result is going to be an activation of rule init; and
 this is what is actually happening. So far so good.

 Now, after I call fireAllRules() I expect that 'Rule 1' becomes active
 because of the modification of the fact in init. Well, this is not the
 case. I don't see any activation for Rule 1.

 My understanding about lock-on-active is that a rule that WAS ACTIVATED
 is not going to be re-activated until the current agenda group is switched.
 The odd thing here is that I never had an activation for Rule 1 so I
 don't see why it activation after init is executed should be prevented.

 So my question is: Is my understanding wrong? What is the expected
 behavior of lock-on-active in this situation? I read the documentation but
 I couldn't get any hint:

 
 Whenever a ruleflow-group becomes active or an agenda-group receives the
 focus, any rule within that group that has lock-on-active set to true will
 not be activated any more ; irrespective of the origin of the update

Re: [rules-users] Is Flow / jBPM dying on the vine?

2012-11-09 Thread Esteban Aliverti
What you seem to be looking for is a Conditional Start Event where you
can define the condition using Drools syntax. What you should do when you
want to introduce a wait point is to do the merge of you current flow
with one of this Conditional Start Event using an Converging Parallel
Gateway. The gateway will not continue its execution until all of its
branches get executed.
That is a 100 BPMN2 solution (you could also use complex gateways, but I'm
not sure in which degree are they supported in jBPM5).
Another solution, more user friendly and even easier to implement and
maintain is to use asynchronous work items that will be completed by rules
when certain condition is met. The good thing about this solution is that
is easy to create your own task definition to put in the editor palette and
that you can create a single work item handler and reuse it for all your
'wait points'.


Best Regards,





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


On Fri, Nov 9, 2012 at 3:18 PM, dunnlow dunn...@yahoo.com wrote:

 Salaboy, the issue I have is that I want users to be able to see the
 process
 graphically, so I think that means I need one overall process (I may use a
 few sub-processes).  Using rules however as you suggest is there a way to
 pause a process until a message (/signal) with certain criteria is
 inserted?  I thought about using a business rule task, with a rule that
 would always be false (until the node should allow processing to pass
 through), but I could not get that working.

 I also saw a suggestion about adding a Condition to the metadata for a
 timer node, but that doesn't seem to be working either.

 Mark - thanks for the information.  I'm looking at flexible processes now
 and will be in touch with Kris.

 Thanks again,
 -J



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Is-Flow-jBPM-dying-on-the-vine-tp4020738p4020774.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] Error in adding BRL in Guvnor

2012-10-30 Thread Esteban Aliverti
If you are using the binary version of your package you should use
ResourceType.PKG.

Best Regards,



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


On Tue, Oct 30, 2012 at 7:15 AM, vargheseps varghesep...@gmail.com wrote:

 I have created a Model  named applicationHealth which contain a class
 “com.xyz.rims.model.Application” on Guvnor.
 Also created a Business rule asset named  ‘ApplicationHealthRule’  which
 uses  ‘Application’.  I have
 created a business rule task in a BPMN2  process and gave the
 ‘ruleflow-group’ as same as a Business rule assets .


 kbuilder.add(ResourceFactory.newUrlResource(DROOLS_COMMON_URL+ApplicationHealthRule/binary),
 ResourceType.BRL);
 I used the above code to add the resource to kbuilder The error I get is:

 [Unable to resolve ObjectType 'Application' : [Rule
 name='ApplicationHealthRule']
 ]




 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Error-in-adding-BRL-in-Guvnor-tp4020555.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] Local Variable

2012-10-05 Thread Esteban Aliverti
Did you read the documentation about 'globals'?

Best Regards,



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


On Fri, Oct 5, 2012 at 1:46 PM, joy kripa_...@infosys.com wrote:

 Hi

 i need local variables in drl file.
 it should hold integer/double value.
 Setting an integer value to a local variable in some rule and getting that
 integer value in some other rule

 when
 #some condition01
 then
 local variable=200
 end

 when
#some condition02
 then
local variable =300
 end

 when
  #some condition03
 then
  emp.salary=localvariable+2000
 end

 Anyone plz help me to resolve this.

 Thank you
 Joy




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

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


Re: [rules-users] Drools 5.4 final and jbpm: problem in acces process variable

2012-09-27 Thread Esteban Aliverti
At first view I think you are missing the dataoutput association in the
task that modifies the value.
You must define 'outputValue' in the DataOutputSet of the task and make the
association between this DataOutput and the process variable.
By the way, what is
'DroolsAuthorizationService.populateResultFields(decisionList);' doing?

Best Regards,



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


On Thu, Sep 27, 2012 at 1:10 PM, Manasi manasi.a.da...@capgemini.comwrote:

 hi,

 heres is the handler code in service task :

 I have added this line in service task:

 ListString decisionList = new ArrayListString();
 decisionList.add(UI_Kunde);
 outputValue=UI_Kunde;
 System.out.println(outputValue +outputValue);
 DroolsAuthorizationService.populateResultFields(decisionList);

 my 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;

   itemDefinition id=_screenIdItem structureRef=String /
   itemDefinition id=_outputValueItem structureRef=String /

   itemDefinition id=_3-screenIdItem structureRef=String /
   itemDefinition id=_3-outputValueItem structureRef=String /

   itemDefinition id=_4-screenIdItem structureRef=String /
   itemDefinition id=_4-outputValueItem structureRef=String /

   itemDefinition id=_6-screenIdItem structureRef=String /
   itemDefinition id=_6-outputValueItem structureRef=String /

   itemDefinition id=_8-screenIdItem structureRef=String /
   itemDefinition id=_8-outputValueItem structureRef=String /

   process processType=Private isExecutable=true id=12
 name=FeltKnapRestriktionerKundeMedAnl
 tns:packageName=com.yousee.drools.services 

 extensionElements
  tns:import name=org.drools.KnowledgeBaseConfiguration /
  tns:import name=org.drools.KnowledgeBaseFactory /
  tns:import name=org.drools.agent.KnowledgeAgent /
  tns:import name=org.drools.agent.KnowledgeAgentConfiguration /
  tns:import name=org.drools.agent.KnowledgeAgentFactory /
  tns:import name=org.drools.builder.KnowledgeBuilder /
  tns:import name=org.drools.builder.KnowledgeBuilderFactory /
  tns:import name=org.drools.builder.ResourceType /
  tns:import name=org.drools.conf.EventProcessingOption /
  tns:import name=org.drools.io.ResourceFactory /
  tns:import name=org.drools.runtime.StatefulKnowledgeSession /
  tns:import name=com.tdc.ktv.nyss.drools.common.NyssStaffSO /
  tns:import name=com.tdc.ktv.nyss.drools.common.NyssCableUnitSO /
  tns:import name=java.util.* /
 /extensionElements

 property id=screenId itemSubjectRef=_screenIdItem/
 property id=outputValue itemSubjectRef=_outputValueItem/


 startEvent id=_1 name=StartProcess /
 inclusiveGateway id=_2 name= gatewayDirection=Diverging /
 task id=_3 name=Customer Deatails tns:taskName=Log 
   extensionElements
 tns:onEntry-script scriptFormat=http://www.java.com/java;

 /tns:onEntry-script
   /extensionElements
   ioSpecification
 dataInput id=_3_MessageInput name=Message /
 inputSet
   dataInputRefs_3_MessageInput/dataInputRefs
 /inputSet
 outputSet
 /outputSet
   /ioSpecification
   dataInputAssociation
 targetRef_3_MessageInput/targetRef
 assignment
   from xsi:type=tFormalExpressionIn Customer Details
 Flow/from
   to xsi:type=tFormalExpression_3_MessageInput/to
 /assignment
   /dataInputAssociation
 /task
 task id=_4 name=SupplierCommodityCreateFlow tns:taskName=Log 
   extensionElements
 tns:onEntry-script scriptFormat=http://www.java.com/java;

 /tns:onEntry-script
   /extensionElements
   ioSpecification
 dataInput id=_4_MessageInput name=Message /
 inputSet
   dataInputRefs_4_MessageInput/dataInputRefs
 /inputSet
 outputSet
 /outputSet
   /ioSpecification
   dataInputAssociation
 targetRef_4_MessageInput/targetRef
 assignment
   from xsi:type=tFormalExpressionIn SupplierCommodity Create
 Flow/from
   to xsi:type=tFormalExpression_4_MessageInput/to
 /assignment
   /dataInputAssociation
 /task
 exclusiveGateway id=_5 name=Gateway gatewayDirection

[rules-users] How does 'from' cache works?

2012-09-12 Thread Esteban Aliverti
Assuming I have the following rule:

global SomeClient client;

rule Poll Values
timer (int: 0s 1s)
when
$data: Data() from client.getData();
then
insert($data);
end

and that I'm just creating a session with just that rule, setting the
global and calling fireAllRules(). And let's say that my session is running
for 5 seconds.

My questions are:
1.- How many times is the rule going to be executed?
2.- How many times is  client.getData() going to be invoked?

The test I have shows that the rule is executed 5 times,
but client.getData() is only invoked for the first activation. The returned
object is used in the subsequent activations. Is this the expected behavior?
As the rule name states, I'm expecting to get some (different) values from
client every second.
I understand that I'm doing 'strange' things since the rule doesn't use any
real fact but I would like to understand why I'm experiencing the described
behavior.

Best Regards,




Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] fireUntilHalt() is halt forever

2012-08-21 Thread Esteban Aliverti
Instead of grouping your rules using agenda-group maybe you could partition
your kbase to only have the rules for a particular Product (?)

Best Regards,



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


On Tue, Aug 21, 2012 at 5:00 PM, Rana ven12...@yahoo.com wrote:

 Here is the example

 rule AndroGel Provider State
 no-loop true
 salience 95
 agenda-group AndroGel
 when
 eval( droolsRequest.address.stateCode == MA )
 then
 logging();
 drools.halt();
 end

 the other rule is very similar but for a different Agenda Group

 rule Pradaxa Provider State
 no-loop true
 salience 95
 agenda-group Pradaxa
 when
 eval( droolsRequest.address.stateCode == MA )
 then
 logging();
 drools.halt();
 end

 In this case it is firing the Pradaxa rule and giving me the wrong output.

 Thanks.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/fireUntilHalt-is-halt-forever-tp4019146p4019313.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] fireUntilHalt() is halt forever

2012-08-21 Thread Esteban Aliverti
You can still have different change-sets pointing to different resources
(you can share these resources too) for different kbases.

Best Regards,



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


On Tue, Aug 21, 2012 at 5:21 PM, Rana ven12...@yahoo.com wrote:

 I am actually using ChangeSet, because we did not wanted the rule files to
 loaded many times, rather load at once and use scanner to look for any
 changes.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/fireUntilHalt-is-halt-forever-tp4019146p4019317.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] Question about the Nature of Ruleflows

2012-08-21 Thread Esteban Aliverti
Drools Flow (aka JBPM5) will look for all the Persons and Dogs you have in
your session.
Since the conditions in an XOR gateway are evaluated in order, the first
one being true is going to be selected.
In your case, after you insert the Persons, both rules are activated, but
the gateway is always going to pick the first one.
I would suggest to use different process instances for different scenarios.

Best Regards,



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


On Tue, Aug 21, 2012 at 11:14 PM, BenjaminWolfe
benjamin.e.wo...@gmail.comwrote:

 Thanks Wolfgang.

 My original post was a conceptual analogy.  But this still isn't working
 right for me, so I've written out a full-fledged example to see if you or
 anyone else can help.  The full example is behaving exactly the way my real
 (important) code is -- which is the wrong way for the business application.
 :-/  I should add that in real life, the ruleflow groups each have multiple
 rules within them.

 So without further ado, here's my code -- two POJOs, a bpmn file, a rule
 resource, and a test class -- along with the expected output and actual
 output.

 *User.java*

 package com.examples.ruleflow;

 public class User {

 private int id;

 public User() {}
 public User(int id) {
 this.id = id;
 }

 public int getId() {
 return id;
 }

 public void setId(int id) {
 this.id = id;
 }
 }

 *Dog.java*

 package com.examples.ruleflow;

 public class Dog {

 private int id;
 private int ownerId;
 private boolean hasDogTag;

 public Dog() {}
 public Dog(int id) {
 this.id = id;
 }

 public int getId() {
 return id;
 }
 public int getOwnerId() {
 return ownerId;
 }
 public boolean isHasDogTag() {
 return hasDogTag;
 }
 public void setId(int id) {
 this.id = id;
 }
 public void setOwnerId(int ownerId) {
 this.ownerId = ownerId;
 }
 public void setHasDogTag(boolean hasDogTag) {
 this.hasDogTag = hasDogTag;
 }

 }

 *dog_owner_flow.bpmn*

 ?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.examples.ruleflow.dogProcess name=Dog Owner Process
 tns:packageName=com.examples.ruleflow tns:version=1 


 startEvent id=_1 name=StartProcess /
 exclusiveGateway id=_2 name=Gateway gatewayDirection=Diverging
 /
 businessRuleTask id=_3 name=Branch A g:ruleFlowGroup=flowA
 /businessRuleTask
 businessRuleTask id=_4 name=Branch B g:ruleFlowGroup=flowB
 /businessRuleTask
 exclusiveGateway id=_5 name=Gateway gatewayDirection=Converging
 /
 endEvent id=_6 name=End terminateEventDefinition//endEvent


 sequenceFlow id=_1-_2 sourceRef=_1 targetRef=_2 /
 sequenceFlow id=_2-_3 sourceRef=_2 targetRef=_3 name=dog tags
 OK tns:priority=1 
   conditionExpression xsi:type=tFormalExpression
 language=http://www.jboss.org/drools/rule; 
 /$u : User()
 not ( Dog( ownerId == $u.id, hasDogTag == false ) )/
   /conditionExpression
 /sequenceFlow
 sequenceFlow id=_2-_4 sourceRef=_2 targetRef=_4 name=dog tag
 issue tns:priority=1 
   conditionExpression xsi:type=tFormalExpression
 language=http://www.jboss.org/drools/rule; 
 /$u : User()
 exists ( Dog( ownerId == $u.id, hasDogTag == false ) )/
   /conditionExpression
 /sequenceFlow
 sequenceFlow id=_3-_5 sourceRef=_3 targetRef=_5 /
 sequenceFlow id=_4-_5 sourceRef=_4 targetRef=_5 /
 sequenceFlow id=_5-_6 sourceRef=_5 targetRef=_6 /
   /process

   bpmndi:BPMNDiagram
 bpmndi:BPMNPlane bpmnElement=com.examples.ruleflow.dogProcess 
   bpmndi:BPMNShape bpmnElement=_1 
 dc:Bounds x=16 y=16 width=48 height=48 /
   /bpmndi:BPMNShape
   bpmndi:BPMNShape bpmnElement=_2 
 dc:Bounds x=180 y=15 width=48 height=48 /
   /bpmndi:BPMNShape
   bpmndi:BPMNShape bpmnElement=_3 
 dc:Bounds x=42 y=162 width=80 height=48 /
   /bpmndi:BPMNShape

Re: [rules-users] How to execute knowledeg base remotely?

2012-08-19 Thread Esteban Aliverti
AFAIK, after you deploy the generated .war you will have a running instance
of Drools Camel Server:
http://docs.jboss.org/drools/release/5.4.0.Final/droolsjbpm-integration-docs/html_single/index.html#ch.server

Best Regards,



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


On Sun, Aug 19, 2012 at 6:24 PM, jasonxzhong jason.zh...@ellucian.comwrote:

 In Guvnor 5.4.0 manual it states

 /Service Config is a special asset that defines an execution service
 configuration. This execution service is a war file (generated
 automatically
 by the editor) which you can deploy to execute KnowledgeBases remotely for
 any sort of client application./

 This is very interesting from the point of integration as we have both JVM
 and .NET based solutions. However even though the manual explains in
 details
 how to create a service config asset and deploy it, I cannot find any
 reference as how the service interface is exposed (REST, SOAP?) and any
 description of the definition of the remote APIs that can be invoked by a
 client application.

 Maybe I missed something...

 Jason



 -

 Jason
 --
 View this message in context:
 http://drools.46999.n3.nabble.com/How-to-execute-knowledeg-base-remotely-tp4019270.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] Specify enumeration for DSL variables?

2012-08-17 Thread Esteban Aliverti
http://docs.jboss.org/drools/release/5.4.0.Final/drools-guvnor-docs/html_single/index.html#d0e1802

Best Regards,



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


On Fri, Aug 17, 2012 at 4:06 PM, jasonxzhong jason.zh...@ellucian.comwrote:

 Sure I'll explain. Assuming I have the following defined in a DSL:

 [consequence][]Set result {name} to {value} = data.results.put({name},
 {value});

 In the guided BRL rule editor, when I choose to use this DSL to add an
 action, the following is displayed

Set rule flag [name] to [value]

 In this case data.results is a map that contains name/value pairs that can
 be set be the rules. My questions are:
 a. Can I attach a list of valid names to the {name} variable defined in the
 DSL?
 b. Is it possible to specify a list of valid values for the {value}
 variable
 based on the value of {name} defined in the DSL? For example if
 name==valid, {value} is in [true, false]. If name==code, {value} is in
 [1,2,3,4,5]. Or if a helper function can be used for this?

 Thanks,

 Jason









 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Specify-enumeration-for-DSL-variables-tp4019228p4019247.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] modify and update is not working in the rule file

2012-08-16 Thread Esteban Aliverti
By the way, what are you trying to do in this piece of code?

CollectionObject objs = workingMemory.getObjects();
IteratorObject it = objs.iterator();

while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof Program) {
FactHandle fact = workingMemory.getFactHandle(obj);
workingMemory.update(fact, obj);
}
}

Best Regards,



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


On Thu, Aug 16, 2012 at 4:25 PM, Esteban Aliverti 
esteban.alive...@gmail.com wrote:

 The project doesn't compile since the parent pom is missing. You don't
 event have the Drug and Program classes in it!

 Best Regards,

 

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



 On Thu, Aug 16, 2012 at 4:02 PM, Rana ven12...@yahoo.com wrote:

 Please find the project attached. Please check and help me out. I am now
 like
 cat on that wall. The project team needs it and this is giving me hard
 time.
 Please help



 http://drools.46999.n3.nabble.com/file/n4019196/pi-affiliate-drools-rule-engine.zip
 pi-affiliate-drools-rule-engine.zip


 Please help.

 Thanks.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/modify-and-update-is-not-working-in-the-rule-file-tp4019158p4019196.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] modify and update is not working in the rule file

2012-08-16 Thread Esteban Aliverti
One last thing. Just like Wolfgang said: if you don't activate the
agenda-group where the rule is defined its activations are never going to
be executed.

Best Regards,



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


On Thu, Aug 16, 2012 at 4:29 PM, Esteban Aliverti 
esteban.alive...@gmail.com wrote:

 By the way, what are you trying to do in this piece of code?

 CollectionObject objs = workingMemory.getObjects();
 IteratorObject it = objs.iterator();

 while (it.hasNext()) {
 Object obj = it.next();
 if (obj instanceof Program) {
 FactHandle fact = workingMemory.getFactHandle(obj);
 workingMemory.update(fact, obj);
 }
 }

 Best Regards,

 

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


 On Thu, Aug 16, 2012 at 4:25 PM, Esteban Aliverti 
 esteban.alive...@gmail.com wrote:

 The project doesn't compile since the parent pom is missing. You don't
 event have the Drug and Program classes in it!

 Best Regards,

 

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



 On Thu, Aug 16, 2012 at 4:02 PM, Rana ven12...@yahoo.com wrote:

 Please find the project attached. Please check and help me out. I am now
 like
 cat on that wall. The project team needs it and this is giving me hard
 time.
 Please help



 http://drools.46999.n3.nabble.com/file/n4019196/pi-affiliate-drools-rule-engine.zip
 pi-affiliate-drools-rule-engine.zip


 Please help.

 Thanks.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/modify-and-update-is-not-working-in-the-rule-file-tp4019158p4019196.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] Slow compilation (4h) for a single rule

2012-07-24 Thread Esteban Aliverti
As far as I remember, there were some fixes around compilation time for
edge cases in 5.4. Could you please give a try to 5.4 or even 5.5-SNAPSHOT?

Best Regards,



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


On Tue, Jul 24, 2012 at 1:11 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 On 24/07/2012, fx242 dro...@fx242.com wrote:
  Hi,
 
   This single
  rule was taking all the 4h to compile!
  I'm using DROOLS 5.2 Final.
  The rule example below samples the problem (don't mind the nonsense
  Number()
  conditions):
 

 Well, I do mind the nonsense Number(). There's no point in
 discussing this if you don't post an exact image of your rule.

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

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


Re: [rules-users] Gwt Error while integrating guvnor with custom application.

2012-07-18 Thread Esteban Aliverti
Try removing the
'gwt.codesvr=localhost:8080http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?gwt.codesvr=localhost:8080'
from the url. That parameter is only valid when GWT is running in dev mode.

Best Regards,



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


On Wed, Jul 18, 2012 at 3:55 PM, soumya soumya.she...@tcs.com wrote:

 Hi,

 I am new to drools, currently i have deployed drools-guvnor5.3 on jboss AS
 5.1GA.
 I want to use guvnor asset editor in my custom application. I have followed
 the link

 http://ilesteban.wordpress.com/2010/11/23/guvnor-embed-assets-editor-in-your-application/
 .
 I am using assetEditor.html, but when i click on submit button it says
 Plugin failed to connect to Development Mode server at localhost:8080

 The URL mentioned in my html is
 
 http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?gwt.codesvr=localhost:8080
 
 as my server is running on localhost:8080.

 Anybody come across this error and having solution?
 Please help!!!

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Gwt-Error-while-integrating-guvnor-with-custom-application-tp4018754.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


Re: [rules-users] Drools Guvnor-Decison Tables - Rule is not being fired!!! Please help

2012-07-16 Thread Esteban Aliverti
The problem is that you are inserting the fact type definition instead of
the facts themselves.

instead of insert *appType* and *incomeType* you should insert *application*and
*income*.

Best Regards,



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


On Mon, Jul 16, 2012 at 3:20 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Why do you think that you should have a third fact when there are no
 insert() calls except the two in your Java code?
 -W

 On 16/07/2012, Ravikiran ravikiran.kaka...@gmail.com wrote:
  Hi,
  I'm using default Guvnor package mortgages decision table as example
 for
  my POC. Below is the rules from the decision table. No rule is being
 fired
  from my JAVA client out of 3 rules given below.
 
  //from row number: 1
  rule Row 3 Pricing loans
dialect mvel
when
 application : LoanApplication( amount  131000 ,
 amount =
  20 , lengthYears == 30 , deposit  2 )
income : IncomeSource( type == Asset )
then
application.setApproved( true );
application.setInsuranceCost( 0 );
application.setApprovedRate( 2 );
  end
 
  //from row number: 2
  rule Row 1 Pricing loans
dialect mvel
when
application : LoanApplication( amount  1 , amount
 = 10 ,
  lengthYears == 20 , deposit  2000 )
income : IncomeSource( type == Job )
then
application.setApproved( true );
application.setInsuranceCost( 0 );
application.setApprovedRate( 4 );
  end
 
  //from row number: 3
  rule Row 2 Pricing loans
dialect mvel
when
application : LoanApplication( amount  11 , amount
 = 13 ,
  lengthYears == 20 , deposit  3000 )
income : IncomeSource( type == Job )
then
application.setApproved( true );
application.setInsuranceCost( 10 );
application.setApprovedRate( 6 );
  end
 
  == My Java client follows
  KnowledgeBase knowledgeBase = createKnowledgeBase(); //Successfully
 creates
  knowledgebase
  StatefulKnowledgeSession session =
  knowledgeBase.newStatefulKnowledgeSession();
 
  FactType appType = knowledgeBase.getFactType( mortgages,
  LoanApplication );
  FactType incomeType = knowledgeBase.getFactType( mortgages,
  IncomeSource );
 
  Object application = appType.newInstance();
  Object income = incomeType.newInstance();
 
  appType.set(application, amount, 10);
  appType.set(application, deposit, 1500);
  appType.set(application, lengthYears, 20);
 
  incomeType.set(income, type, Job);
  incomeType.set(income, amount, 65000);
 
  session.insert(appType);
  session.insert(incomeType);
 
  assertTrue(session.getFactCount() == 2);
  session.fireAllRules();
  assertTrue(session.getFactCount() == 3);
 
  Question: I hope the way i pass the input satisfies Row 2 Pricing loans
  above. But My assertion is getting failed after calling
  fireAllRules()...because the factcount was still 2. Please help what
 could
  be the wrong in above scenario.
 
  thanks a lot.
 
  --
  View this message in context:
 
 http://drools.46999.n3.nabble.com/Drools-Guvnor-Decison-Tables-Rule-is-not-being-fired-Please-help-tp4018701.html
  Sent from the Drools: User forum mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


Re: [rules-users] Error on Build Package Click

2012-07-16 Thread Esteban Aliverti
Could you paste the source code (DRL) of the package?

Best Regards,



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


On Mon, Jul 16, 2012 at 6:30 PM, paco fifi_nji...@yahoo.fr wrote:

 I got the following error when I tryed to build the default sample
 repository
 after starting guvnor the first time.
 I then tried to build my own package, and got the same error:

 400 Sorry, a technical error occurred. Please contact a system
 administrator.

 Service method 'public abstract org.drools.guvnor.client.rpc.BuilderResult
 org.drools.guvnor.client.rpc.PackageService.buildPackage

 (java.lang.String,boolean,java.lang.String,java.lang.String,java.lang.String,boolean,java.lang.String,
 java.lang.String,boolean,java.lang.String)
 throws com.google.gwt.user.client.rpc.SerializationException' threw an
 unexpected exception: [Error: illegal escape sequence: .] [Near : {...
 ...\.[1-4] }] ^ [Line: 1, Column: 22] [Error: illegal escape
 sequence: .] [Near : {... ..ppp\.[1-4] }] ^ [Line: 1, Column: 22]

 Please
 Suggest
 Thanks

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Error-on-Build-Package-Click-tp4018712.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] convert drl file to rf?

2012-07-04 Thread Esteban Aliverti
You can't just visualize the runtime execution order of the rules in design
time. What you could do is to dictate the order you want by using, for
example, jBPM5. The language used by jBPM5 is BPMN2.0, a business process
definition language, which can't be converted to DRL (which is a business
rule language). So, using BPMN2.0 you can orchestrate the rules present in
one or more DRL file.

Best Regards,



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


On Tue, Jul 3, 2012 at 10:28 PM, al so volks...@gmail.com wrote:

 Sure. All I am trying to do is to visualize the execution order of rules
 from drl files using whatever suitable UI tool. Looks like there is none.


 On Tue, Jul 3, 2012 at 1:13 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Please realize that the Drools Rule Language and jBPM are complementary;
 there is no way to express coded instances of either one in the language of
 the other one.
 -W


 On 3 July 2012 22:04, al so volks...@gmail.com wrote:

 I have only drl files (rule definition files in .drl and not rule
 flows). I guess there should be a way to convert drl to jBPM file?
 Or drl to rf to jBPM?

 On Tue, Jul 3, 2012 at 12:17 AM, Caillard, Quentin 
 quentin.caill...@ariadnext.com wrote:

 When i right click on the .rf file i have the option Convert to BPMN2
 process.


 2012/7/2 al so volks...@gmail.com

 I have both drools and jBPM plugin installed. Where do you do that
 right click? Anything that is intuitive won't work in eclipse. I did the
 right click on drl file and didn't see any such options.


 On Fri, Jun 29, 2012 at 1:01 AM, Caillard, Quentin 
 quentin.caill...@ariadnext.com wrote:

 The ruleflow file(.rf) is deprecated. You can convert your old
 ruleflow (.rf) to jbpm(.bpmn) file. I did it by using the Drools plugin 
 for
 Eclipse. If you have the plugin, a simple right click should work.


 2012/6/29 abhinay_agarwal abhinay_agar...@infosys.com

 in the newer version of drools we cannot create a ruleflow file..we
 can only
 create a jbpm process file

 are ruleflow file(.rf) and jbpm(.bpmn) related ??

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




 --


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



 ___
 rules-users 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] ruleflow-group

2012-07-04 Thread Esteban Aliverti
I have replayed you in other thread. You can't convert from BPMN2.0 (jBPM5
language) to DEL (Drools language). What you can do with jBPM5 is to
orchestrate the execution of the rules present in your DRL files. For more
information:
http://docs.jboss.org/jbpm/v5.3/userguide/ch.core-basics.html#d0e1862

Best Regards,



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


On Tue, Jul 3, 2012 at 10:02 PM, al so volks...@gmail.com wrote:

 I already have tons of rules today in drl file. I've both jBPM5 and drools
 plugin installed on eclipse 3.6. I didn't find a way to convert these drl
 files to jBPM to visualize the existing rules.


 On Tue, Jul 3, 2012 at 12:30 AM, Esteban Aliverti 
 esteban.alive...@gmail.com wrote:

 If what you are looking for is to graphically model the execution order
 of a set of rules, then the best you can do is to go to jBPM5. jBPM5 is a
 process engine where, among other things, you can have tasks (nodes in the
 process) activating and deactivating rule-flow-groups (yes, I know, the
 name is kind of old) in the agenda. The concept of a rule-flow-group is
 similar to the agenda-group where rules are only executed only if the group
 where they belong is 'active'. Using jBPM5 you can use a 'Rule Task' node
 to automatically activate a particular rule-flow-group.

 Best Regards,

 

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



 On Mon, Jul 2, 2012 at 10:08 PM, al so volks...@gmail.com wrote:

 One could control the rule execution order using various different
 constructs (like salience, etc) within the rule definition file. Is there
 any UI tool that can take the drl file and visualize the rule execution
 flow?  Does it help the section of audience who doesn't understand the
 concepts like agenda-group? Is jBPM the right tool in such scenario where
 all I have is bunch of drl files (no Process is involved here). i.e. try to
 visualize the Rule Execution order.

 This is where I was investigating the use of RuleFlow and later found
 that jBPM obsoletes it. Then was curious about how ruleflow-group is
 integrated with jBPM? Unable to find the solution yet.


 On Sun, Jul 1, 2012 at 3:03 PM, Mark Proctor mproc...@codehaus.orgwrote:

  On 30/06/2012 00:08, al so wrote:

 looks like one can't activate a ruleflow-group inside a drl file? Only
 available via UI?
 I was thinking there'll be some kind of setFocus way to control rule
 execution using this ruleflow-group.

 For the 6.0 development cycle we are looking into alternative
 approaches to handling rule execution orchestration. Nothing to show yet.

 Mark



 ___
 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



 ___
 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] KnowledgeAgent custom class loader not working for PKG resources

2012-07-03 Thread Esteban Aliverti
Hi Hrumph,
The pull request is still open and waiting to be merged (even if now it
can't be automatically merged):
https://github.com/droolsjbpm/drools/pull/100
Could someone of the dev team please take a look at it?

Best Regards,



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


On Mon, Jul 2, 2012 at 10:31 PM, Hrumph herman.p...@imail.org wrote:

 Hello.  I posted this issue quite awhile ago and also created Jira
 JBRULES-3388.   Esteban proposed a solution and submitted a pull request
 but
 this was not resolved in 5.3 or 5.4 releases.  I haven't seen Esteban
 online
 for awhile, so perhaps it has been overlooked.   This seems like a
 significant issue to me - the ability to use the KnowledgeBase classloader
 for dependencies that reside in a .PKG.   This feature was also described
 in
 the DroolsCookbook, but only demonstrated for a .DRL type resource.   I am
 surprised that others have not pointed out this issue - is there another
 approach for loading packages and their dependencies that is more commonly
 used?

 Thanks,

 Herm

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p4018395.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] ruleflow-group

2012-07-03 Thread Esteban Aliverti
If what you are looking for is to graphically model the execution order of
a set of rules, then the best you can do is to go to jBPM5. jBPM5 is a
process engine where, among other things, you can have tasks (nodes in the
process) activating and deactivating rule-flow-groups (yes, I know, the
name is kind of old) in the agenda. The concept of a rule-flow-group is
similar to the agenda-group where rules are only executed only if the group
where they belong is 'active'. Using jBPM5 you can use a 'Rule Task' node
to automatically activate a particular rule-flow-group.

Best Regards,



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


On Mon, Jul 2, 2012 at 10:08 PM, al so volks...@gmail.com wrote:

 One could control the rule execution order using various different
 constructs (like salience, etc) within the rule definition file. Is there
 any UI tool that can take the drl file and visualize the rule execution
 flow?  Does it help the section of audience who doesn't understand the
 concepts like agenda-group? Is jBPM the right tool in such scenario where
 all I have is bunch of drl files (no Process is involved here). i.e. try to
 visualize the Rule Execution order.

 This is where I was investigating the use of RuleFlow and later found that
 jBPM obsoletes it. Then was curious about how ruleflow-group is integrated
 with jBPM? Unable to find the solution yet.


 On Sun, Jul 1, 2012 at 3:03 PM, Mark Proctor mproc...@codehaus.orgwrote:

  On 30/06/2012 00:08, al so wrote:

 looks like one can't activate a ruleflow-group inside a drl file? Only
 available via UI?
 I was thinking there'll be some kind of setFocus way to control rule
 execution using this ruleflow-group.

 For the 6.0 development cycle we are looking into alternative approaches
 to handling rule execution orchestration. Nothing to show yet.

 Mark



 ___
 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


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


Re: [rules-users] Cannot get Custom Forms to work in Guvnor

2012-06-18 Thread Esteban Aliverti
What is the url you are using for the custom form? Did you try to see what
is going on using something like firebug of chrome developer tools? Is the
URL even invoked?

Best Regards,



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


On Tue, Jun 19, 2012 at 12:21 AM, sams dro...@mailinator.com wrote:

 I cannot get custom forms to work in guided editor. I can create a working
 set, add the field and value, and define the custom form OK. When I get to
 the editing experience and click on the 'pencil' I get a popup the size
 that
 I declared bit with no content. It makes no difference what URL I enter.

 Can someone please confirm that this feature indeed works in 5.4.0 on
 Tomcat?

 Thanks,
 Sam


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Cannot-get-Custom-Forms-to-work-in-Guvnor-tp4018036.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] guvnor-distribution-5.4.0.Final problem

2012-06-16 Thread Esteban Aliverti
All versions from 1 to 7?



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


On Sun, Jun 17, 2012 at 12:45 AM, Michael Anstis
michael.ans...@gmail.comwrote:

 If you receive Guvnor from the Drools download page it is not a Red Hat
 product, but a community open source effort.

 The three WARs are essentially different packages of the same application,
 but different application servers have different footprints and hence what
 we included in the respective WAR had to vary.

 If you buy Red Hat BRMS then I suggest you work with your account
 representative to discuss compatibility concerns.

 sent on the move

 On 16 Jun 2012 20:27, domingo sprabak...@gmail.com wrote:

 Hi,

 I have a question to the drools guvnor team
 In the guvnor-distribution binary folder contains three war files,
 guvnor-5.4.0.Final-jboss-as-7.0, guvnor-5.4.0.Final-jboss-as-5.1 and
 guvnor-5.4.0.Final-tomcat-6.0 respectively.
 My question is
 why these three specific war files?
 Will it be work with other version of these app. servers?
 Drools and Jboss are redhat products, than why guvnor is not supported by
 all versions of jboss Apps server?
 this raise lots of reliability related questions in the industry...I
 really
 appreciate some one from the core team can answer these questions.


 thanks,

 -
 with kind regards,

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/guvnor-distribution-5-4-0-Final-problem-tp4018004.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


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


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


Re: [rules-users] Performance issue

2012-05-31 Thread Esteban Aliverti
The first optimization I can advice (without knowing your rules) is to keep
the kbase cached instead of being compiling the resources and creating it
for each request.
You can compile the resources with kbuilder once, create a kbase once and
then for each request you only need to create a ksession from the already
existing kbase and use it.
The compilation of the rules is (usually) one of the most time-consuming
tasks you have in drools.

Best Regards,



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


On Thu, May 31, 2012 at 8:25 AM, Ini inder...@gmail.com wrote:

 Hi All,
I have written a code to check the properties of a bean
 using drools based
 rules.
I have created the different rules file where different
 properties of the
 bean will be checked.

The code i have written is a as below:

 public static void check(Object details,String rule){

long methodStartTime=System.currentTimeMillis();
Resource resource = new
 ClassPathResource(RULE_CLASSPATH+rule);

KnowledgeBuilder kbuilder =
 KnowledgeBuilderFactory.newKnowledgeBuilder();
long startTime=System.currentTimeMillis();
kbuilder.add(resource, ResourceType.DRL );
long endTime=System.currentTimeMillis();
System.out.println(Time taken in add resource in milli
 seconds
 is::+(endTime-startTime));
 KnowledgeBase kbase =
 KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(
 kbuilder.getKnowledgePackages() );
 KnowledgeBuilderErrors errors =
 kbuilder.getErrors();
 if (errors.size()  0) {
 for (KnowledgeBuilderError error: errors) {
 System.err.println(error);
 }
 }

 StatelessKnowledgeSession  ksession =
 kbase.newStatelessKnowledgeSession();


 ksession.execute(details);
 long methodEndTime=System.currentTimeMillis();

 System.out.println(Time taken in Method check  in
 milli seconds
 is::+(methodEndTime-methodStartTime));

}

Here in the check method we have three parameters details this is
 the bean
 whose properties need to be checked in rules file, rule this is the name of
 rules file which contains all the rules.

Here the issue is that it takes around 4 seconds for the first time
 and 1
 second for all consecutive requests, and 4 second looks too much time for
 validating the rules file that has only 10 rules.

Please let me know we have some better way of doing it in drools

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Performance-issue-tp4017688.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] Prevent saving the resource when using guvnorEditorObjRef, in case if validation fails.

2012-05-28 Thread Esteban Aliverti
AFAIK, there is no way to do what you have described.
Feel free to file a new feature request in jira about this.

Best Regards,



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


On Mon, May 28, 2012 at 8:44 AM, worldofprasanna
worldofprasa...@yahoo.comwrote:

 Hi All,

 We have embedded the Guvnor decision table asset into our html page and
 obtained the guvnorEditorObjRef to validate the new rule which is added. We
 wrote our business logic within the function,

 guvnorEditorObjRef.registerBeforeSaveAllButtonCallbackFunction()


 And it works fine. But the problem is when we find the business validation
 got failed, we couldn t stop the resource from saving. Check In dialog box
 opens and we couldn t find a way to prevent it from saving.

 Is there anyway to prevent the asset from Saving in case, if the validation
 failed ?

 Thanks,
 Prasanna Venkataraman.

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Prevent-saving-the-resource-when-using-guvnorEditorObjRef-in-case-if-validation-fails-tp4017580.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] Guvnor 5.3 to 5.4.0.CR1 DSLVariableValue ClassCastException

2012-04-23 Thread Esteban Aliverti
Thanks a lot Mike,
I have a really busy week. I really appreciate your help!

Best Regards,



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


On Mon, Apr 23, 2012 at 5:06 PM, jemka je...@tullahoma.de wrote:

 Hi Mike,
 thanks for the quick response.

 Regards Kai.

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Guvnor-5-3-to-5-4-0-CR1-DSLVariableValue-ClassCastException-tp3929542p3932741.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] Guvnor 5.3 to 5.4.0.CR1 DSLVariableValue ClassCastException

2012-04-22 Thread Esteban Aliverti
I tried with a legacy repo when I introduced this feature. It seems that I
missed something.
A failing repository export would be great in order to start working on
this problem.

Best Regards,





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


On Sun, Apr 22, 2012 at 6:36 PM, jemka je...@tullahoma.de wrote:

 Jira Issue:
 https://issues.jboss.org/browse/GUVNOR-1872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

 Am 22. April 2012 12:20 schrieb manstis [via Drools]
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3930246i=0:

  https://issues.jboss.org/browse/GUVNOR
 
  sent on the move
 
  On 22 Apr 2012 11:12, Michael Anstis [hidden email] wrote:
 
  Hi,
 
  I bet it is that change that causes the problem!
 
  Can you please raise a JIRA on GUVNOR (bit JBRULES) and attach a
  repository export showing the problem?
 
  We will have to fix for 5.4.0.Final.
 
  sent on the move
 
  On 22 Apr 2012 10:39, jemka [hidden email] wrote:
 
  Hello, i have noticed following poblem between Guvnor 5.4.0.CR1 and
  Guvnor
  5.3 with this change.
  Legacy RuleModels cannot be edited anymore and i get following
  ClassCastException when building the package: Caused by:
  java.lang.ClassCastException: java.lang.String cannot be cast to
  org.drools.ide.common.client.modeldriven.brl.DSLVariableValue
 
  Maybe caused by following change
  https://github.com/droolsjbpm/guvnor/pull/30
  A description of the error I've created there as a comment.
 
  By the way - I'm not sure where to report such a bug, jira - github -
  mailing list?
 
  Regards kai.
 
  --
  View this message in context:
 
 http://drools.46999.n3.nabble.com/Guvnor-5-3-to-5-4-0-CR1-DSLVariableValue-ClassCastException-tp3929542p3929542.html
  Sent from the Drools: User forum mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  [hidden email]
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
  ___
  rules-users mailing list
  [hidden email]
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
  
  If you reply to this email, your message will be added to the discussion
  below:
 
 http://drools.46999.n3.nabble.com/Guvnor-5-3-to-5-4-0-CR1-DSLVariableValue-ClassCastException-tp3929542p3929620.html
  To unsubscribe from Guvnor 5.3 to 5.4.0.CR1 DSLVariableValue
  ClassCastException, click here.
  NAML

 --
 View this message in context: Re: [rules-users] Guvnor 5.3 to 5.4.0.CR1
 DSLVariableValue 
 ClassCastExceptionhttp://drools.46999.n3.nabble.com/Guvnor-5-3-to-5-4-0-CR1-DSLVariableValue-ClassCastException-tp3929542p3930246.html

 Sent from the Drools: User forum mailing list 
 archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.htmlat 
 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] please provide a rule for events timeout cases

2012-04-13 Thread Esteban Aliverti
First question: are you using Drools Fusion?
If yes, did you try with something like this?:

EventRecord(type=EventRequest, id=1)
not EventRecord(type=EventResponse, id=1, this after [1s,10s]).

I'm using a 10s timeout here.

Best Regards,



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


On Fri, Apr 13, 2012 at 3:03 PM, skatta1986 shivaprasad_...@yahoo.co.inwrote:

 Hi,

 I would like to write a rule for events timeout case.

 Consider the events EventRecord(type=EventRequest, id=1) and
 EventRecord(type=EventResponse, id=1).
 I have written rules (in .drl file) for correlting the event request with
 event response.

 Now I would like to write timeout case. Suppose
 EventRecord(type=EventRequest, id=2) is not followed by its response. If we
 doesn't recieve response within 10 seconds, then it is considered as
 timeout
 case.
 I tried to use timers but it doen't work as it is not allowing me write
 inside when (LHS) pattern.

 Is there any other way to find timeout cases?



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/please-provide-a-rule-for-events-timeout-cases-tp3907955p3907955.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] KnowledgeAgent Changeset problems

2012-04-05 Thread Esteban Aliverti
Could you append the log output of the Knowledge Agent?

Best Regards,



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


On Wed, Apr 4, 2012 at 4:12 PM, albertorugnone
arugnonechemi...@gmail.comwrote:

 Thank you every body for your answer, unfortunately I was't able to reply
 to
 you until now because other stuff overwhelmed me literally at work.
 Anyway I was going ahead using KnowledgeAgent, following your comments and
 other suggestion. Now I am able to load rules applying change set with
 KnowledgeAgent (thank you!!!), but honestly this is a poor success because,
 even if when I change the rule KnowledgeAgent says incremental build of
 KnowledgeBase finished and in use nothing changes.
 It seems that changes at rules have no effect and it is pretty weird. I
 made
 a maven project with eclipse to explain you better my problem. Is a simple
 main. I am working for a better junit test. Anyway if you change the rule
 in
 the folder knowledge you can test the problem by yourself.
 Briefly I will explain the project:

 Here the code:

_l.warn(START);
 String xml = ;
xml += change-set xmlns='
 http://drools.org/drools-5.0/change-set'quot;;
xml += quot;
 xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'quot;;
xml += quot;
 xs:schemaLocation='http://drools.org/drools-5.0/change-set
 drools-change-set-5.0.xsd' ;
xml += add ;
 xml += resource
 source='Z:/EXP/drools-test/knowledge/test.drl'
 type='DRL' /;
xml += /add ;
xml += /change-set;
FileManager fileManager = new FileManager();
File fxml = fileManager.newFile(changeset.xml);
 Writer output = new BufferedWriter(new FileWriter(fxml));
output.write(xml);
output.close();
 // build a KnowledgeAgent
 ResourceFactory.getResourceChangeNotifierService()
.start();
ResourceFactory.getResourceChangeScannerService()
.start();

final ResourceChangeScannerConfiguration sconf =
 ResourceFactory.getResourceChangeScannerService()


  .newResourceChangeScannerConfiguration();
sconf.setProperty(drools.resource.scanner.interval, 2);
ResourceFactory.getResourceChangeScannerService()
.configure(sconf);

final KnowledgeAgentConfiguration aconf =
 KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty(drools.agent.scanDirectories, true);
aconf.setProperty(drools.agent.scanResources, true);
 /*
 * important newInstance has to be false in order to update
 the
 * knowledge base and not rebuild a new one
 */
aconf.setProperty(drools.agent.newInstance, false);
final KnowledgeAgent agent =
 KnowledgeAgentFactory.newKnowledgeAgent(pch.sel.knowledge.agent, aconf);
 // if (_l.isDebugEnabled()) {
/* we need some log every time */
agent.setSystemEventListener(new
 PrintStreamSystemEventListener());


 agent.applyChangeSet(ResourceFactory.newClassPathResource(pch.sel.kwset.xml));
// fire rules
StatefulKnowledgeSession session =
 agent.getKnowledgeBase().newStatefulKnowledgeSession();
session.fireAllRules();
_l.warn(END);


 and here the rule


 package it.ipiu.drools.KnowledgeAgent.test

 rule test rule timer(int: 0s 2s)
when
eval(true);
then
System.out.println(ciao);
 end



 If I try to change timer from 2s to 2m nothing changes even if
 KnowledgeAgent seems to reload all.

 *Please help!!! I googled the problem everywhere without solution!!!*



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

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


Re: [rules-users] Drools performance

2012-03-30 Thread Esteban Aliverti
Model Definition? Rules Definition?

How much memory your 100 objects are consuming?

Best Regards,




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


On Fri, Mar 30, 2012 at 1:30 PM, Hassan azbak...@gmail.com wrote:

 Hi everyone,

 In one of my tests, I inserted 100 objects into the working memory,
 drools engine made a lot of time to execute the program and it throws
 Exception : java.lang.OutOfMemoryError !!

 Please if someone could help me to improve drools performance and specially
 reduce the drools execution time

 thanks

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

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


Re: [rules-users] [drools-spring]Incompatibility with jdk 5

2012-03-29 Thread Esteban Aliverti
That bug that is now fixed in 5.4.

Best Regards,



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


On Thu, Mar 29, 2012 at 6:35 PM, jsoula jsoula.li...@gmail.com wrote:

 Hello,

 I'm using drools-spring version 5.3.0.Final, jdk 5.
 During execution, i have this error:
 Caused by: java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z
at

 org.drools.container.spring.namespace.ResourceDefinitionParser.parseInternal(ResourceDefinitionParser.java:89).

 Indeed the class ResourceDefinitionParser use String.empty. This is an
 upgrade from 5.2.1.Final.

 Is it a bug? Or is the compatibity with jdk5 no more maintained?

 Thanks.

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/drools-spring-Incompatibility-with-jdk-5-tp3868254p3868254.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] Exception in thread main java.lang.ClassCastException:

2012-03-19 Thread Esteban Aliverti
This is a known bug. We are trying to solve it:
https://issues.jboss.org/browse/JBRULES-2962

Best Regards,



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


On Mon, Mar 19, 2012 at 9:52 AM, srinivasasanda srinivasasa...@gmail.comwrote:


 Hi One and All,


 I used resource scanner in my program to update changes automatically.
 Every thing works fine.
 I had one method Method1 to create knowledge base.

 I had another method Method2 :
 with an infinite loop where i had a set of facts insert into in
 command list, and ksession.execute.

 Now i tested the application whether the changes are applying or not :
 After adding or modifying rule ,I validate and build package.

 Now from infinite loop i got an error at line
 ksession.execute(CommandFactory.newBatchExecution(cmds));

 Exception in thread main java.lang.ClassCastException:
 pricing.specification cannot be cast to pricing.specification
at
 org.drools.base.pricing.specification26362458$getSmsusage.getValue(Unknown
 Source)
at

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

 org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.setValue(CompositeObjectSinkAdapter.java:606)
at

 org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.init(CompositeObjectSinkAdapter.java:568)
at

 org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:362)
at
 org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:215)
at
 org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)
at
 org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:330)
at
 org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)
at

 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
at

 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)
at

 org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at

 org.drools.command.runtime.rule.InsertObjectCommand.execute(InsertObjectCommand.java:84)
at

 org.drools.command.runtime.rule.InsertObjectCommand.execute(InsertObjectCommand.java:38)
at

 org.drools.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:155)
at

 org.drools.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:76)
at

 org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:264)
at

 net.treetechnologies.bss.ruleengine.PricingRules.evaluatePriceRules(PricingRules.java:159)
at
 net.treetechnologies.bss.ruleengine.RunRule.price(RunRule.java:184)
at net.treetechnologies.bss.ruleengine.RunRule.main(RunRule.java:50)


 Thanks and regards
 Srinivasa sanda

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Exception-in-thread-main-java-lang-ClassCastException-tp3838503p3838503.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] uploading bpmn file from file system in guvnor

2012-02-24 Thread Esteban Aliverti
Continuing with Michaels' explanation: once the process editor is open you
have to search for a button in the toolbar of the editor that will allow
you to import a process providing a a file or simply the content.

Best Regards,



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


On Fri, Feb 24, 2012 at 6:44 PM, Michael Anstis michael.ans...@gmail.comwrote:

 Knowledge Bases (section) - Create New - New BPMN2 process.

 Assuming you've completed the prerequisites to have jBPM Designer setup to
 work with Guvnor this should be it.


 On 24 February 2012 17:35, MALABALU malathi.b...@aciworldwide.com wrote:

 How to upload/deploy  a bpmn  from file system into Guvnor?

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



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


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


Re: [rules-users] KnowledgeAgent custom class loader not working for PKG resources

2012-02-22 Thread Esteban Aliverti
I forgot to mention that you will have to change your code a little bit.
Instead of passing a KnowledgeBuilderConfiguration to the agent, you will
need to add a configuration option to the KnowledgeAgentConfiguration
object your are using:

aconf.setProperty(drools.agent.useKBaseClassLoaderForCompiling, true);

This way you are telling the agent to use the kbase's internal CL (We may
set this as the default value I think).

If you want to try my fix, this is what you need to do:

- Prerequisites: java 1.5 or grater, maven 3.0.3 or grater and git
1.- $git clone git://github.com/droolsjbpm/drools.git drools  (It will
download all the sources and place them in drools directory)
2.- Get the fix from my repo. Fortunately, the fix is just one file:
https://raw.github.com/esteban-aliverti/drools/61c2110df8c55c67ff532491865b3f28f368e8db/drools-core/src/main/java/org/drools/agent/impl/KnowledgeAgentImpl.java
3.- Replace the
file /drools-core/src/main/java/org/drools/agent/impl/KnowledgeAgentImpl.java
in
your working copy with the file you downloaded in the previous step.
4.- $mvn clean install -DskipTests=true (this will compile everything and
install the generated artifacts in your local maven repo) This could take
some time.
5.- If in your project you are already using maven, then you just need to
update the version of your dependencies to 5.4.0-SNAPSHOT. If you are not
 using maven, then you need to go to your local repo an get the generated
drools-core-5.4.0-SNAPSHOT.jar and use it.

Best Regards,



Best Regards,



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


On Tue, Feb 21, 2012 at 7:52 PM, Hrumph herman.p...@imail.org wrote:

 Thanks Esteban.  I’m not too adept with Git but will see what I can do.***
 *

 ** **

 ** **

 Herm

 ** **

 *From:* Esteban [via Drools] [mailto:[hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3764501i=0]

 *Sent:* Tuesday, February 21, 2012 11:10 AM

 *To:* Herman Post
 *Subject:* Re: [rules-users] KnowledgeAgent custom class loader not
 working for PKG resources

 ** **

 I added some comments to the issue and provided a possible solution to it.
 I'm waiting for the review and comments from the core developers. 

 In the meantime, if you have some skills with maven and git and you don't
 want to wait, you can create your own version of drools applying the
 provided patch to see if everything is ok.

 ** **

 Best Regards,

 

 Esteban Aliverti
 - Developer @ click here.
 NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 


 --
 View this message in context: RE: [rules-users] KnowledgeAgent custom
 class loader not working for PKG 
 resourceshttp://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3764501.html
 Sent from the Drools: User forum mailing list 
 archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.htmlat 
 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] KnowledgeAgent custom class loader not working for PKG resources

2012-02-22 Thread Esteban Aliverti
Are you sure that the binary package was also created with the same drools
version you are using in your tests?

Best Regards,



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


On Wed, Feb 22, 2012 at 7:39 PM, Hrumph herman.p...@imail.org wrote:

 I have a 5.4.0-SNAPSHOT version with your changes built and made the
 KnowledgeAgentConfiguration change you suggested.  My test code is now like
 this:

 ** **

 KnowledgeAgentConfiguration aconf =
 KnowledgeAgentFactory.newKnowledgeAgentConfiguration();

 aconf.setProperty(drools.agent.useKBaseClassLoaderForCompiling,
 true); // new

 // KnowledgeAgent kagent =
 KnowledgeAgentFactory.newKnowledgeAgent(test, kbase, aconf,
 kbuilderConfig);

 KnowledgeAgent kagent =
 KnowledgeAgentFactory.newKnowledgeAgent(test, kbase, aconf);  // not
 passing kBuilderConfig

 ** **

 My project is attached – let me know if it doesn’t upload.

 ** **

 I can see I’m stepping threw your new code,  and I’m now getting a new
 error, below.

 ** **

 I can also tell you that we tried to just use the KnowledgeBuilder with
 custom classloader as in the Expert documentation (4.1.1) and could not get
 that to work either.  Stack trace follows:

 ** **

 java.lang.RuntimeException: KnowledgeAgent exception while trying to
 deserialize KnowledgeDefinitionsPackage  

 at
 org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:770)
 

 at
 org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1029)
 

 at
 org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:812)
 

 at
 org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:671)
 

 at
 org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:202)
 

 at
 org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:181)
 

 at
 drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.createKnowledgeBase(KnowledgeAgentClassloaderTest.java:62)
 

 at
 drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.customClassloaderTest(KnowledgeAgentClassloaderTest.java:30)
 

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)

 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 

 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 

 at java.lang.reflect.Method.invoke(Method.java:601)

 at
 org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)

 at
 org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
 

 at
 org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)

 at
 org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
 

 at
 org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)

 at
 org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)

 at
 org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
 

 at
 org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
 

 at
 org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
 

 at
 org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
 

 at
 org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)**
 **

 at
 org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
 

 at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
 

 at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 

 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
 

 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 

 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 

 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
 

 Caused by: java.io.OptionalDataException

 at
 java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1367)

 at
 java.io.ObjectInputStream.readObject(ObjectInputStream.java:369

Re: [rules-users] Declared model and drools.agent.newInstance

2012-02-21 Thread Esteban Aliverti
There is a known bug with incremental kbase changes (what happens
when drools.agent.newInstance=false) and declared types. Sometime ago
someone mentioned a possible workaround. Try to search in the mailing list.

Best Regards,



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


On Tue, Feb 21, 2012 at 12:25 PM, Juanker Atina juank...@gmail.com wrote:

 Hi there,

 I want to work with declared facts, inside drl file, but when i set 
 drools.agent.newInstance
 property to false, it seems that drools won't work with this specific fact.


 My code stops working when i put this two lines,

 KnowledgeAgentConfiguration aconf =
 KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
 aconf.setProperty(drools.agent.newInstance, false);

 And it works fine when i remove these lines.


 So, I've read that this property is related to new instances of
 KnowledgeBase when resources changes...

 cp from: http://grepcode.com/file/repository.jboss.org/maven2/org.drools/
 drools-api/5.0.0.M4/org/drools/agent/KnowledgeAgentFactory.java

 *aconf.setProperty( drools.agent.newInstance,
   true ); // resource changes results in a new
 instance of the KnowledgeBase being built,
 // this cannot currently be set to
 false for incremental building*

 Hence, why is this property changing the behaviour of the rules?

 (See this thread too,
 http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tt3722632.html#a3731857
 )
 ___
 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] KnowledgeAgent custom class loader not working for PKG resources

2012-02-21 Thread Esteban Aliverti
I added some comments to the issue and provided a possible solution to it.
I'm waiting for the review and comments from the core developers.
In the meantime, if you have some skills with maven and git and you don't
want to wait, you can create your own version of drools applying the
provided patch to see if everything is ok.

Best Regards,



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


On Tue, Feb 21, 2012 at 4:56 PM, Hrumph herman.p...@imail.org wrote:

 Great!

 ** **

 https://issues.jboss.org/browse/JBRULES-3388**

 ** **

 ** **

 Herm

 ** **

 *From:* Esteban [via Drools] [mailto:[hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3763942i=0]

 *Sent:* Monday, February 20, 2012 2:30 AM

 *To:* Herman Post
 *Subject:* Re: [rules-users] KnowledgeAgent custom class loader not
 working for PKG resources

 ** **

 Hi Herman,

 I'm working on this issue right now. Did you create the jira issue? Could
 you please send me the link?

 ** **

 Best Regards,

 

 Esteban Aliverti
 - Developer @ click here.
 NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 


 --
 View this message in context: RE: [rules-users] KnowledgeAgent custom
 class loader not working for PKG 
 resourceshttp://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3763942.html
  Sent from the Drools: User forum mailing list 
 archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.htmlat 
 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] KnowledgeAgent custom class loader not working for PKG resources

2012-02-20 Thread Esteban Aliverti
Hi Herman,
I'm working on this issue right now. Did you create the jira issue? Could
you please send me the link?

Best Regards,



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


On Sat, Feb 18, 2012 at 1:46 PM, Hrumph herman.p...@imail.org wrote:


 http://drools.46999.n3.nabble.com/file/n3756244/knowledge-agent-classloader-5.4.zip
 knowledge-agent-classloader-5.4.zip

 Attached...thanks.

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3756244.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] Adding a List(CollectionFramework) datatype in DeclarativeModel

2012-02-20 Thread Esteban Aliverti
Just do not select anything in the combo-box and write the fqn of the type
you want to use: i.e. java.util.List

Best Regards,



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


On Mon, Feb 20, 2012 at 9:51 AM, Veera veera...@gmail.com wrote:

 Hi All,


 While creating Fact fields in Declarative Model the options are :
 Whole Number,text,Date,Decimal,true/false ,

 So is it possible to add a List(CollectionFramework) Datatype in that.

 Thanks,
 Veera

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Adding-a-List-CollectionFramework-datatype-in-DeclarativeModel-tp3760157p3760157.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] Guvnor 5.4.0.Beta2 launch Error.

2012-02-20 Thread Esteban Aliverti
Do you see any suspicious log in Tomcat's logs?

Best Regards,



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


On Tue, Feb 21, 2012 at 1:42 AM, Monline online.re...@gmail.com wrote:

 Hi,

 Just wondering if anyone has any experience with the following scenario
 and if so, did you find a solution?

 1. I deployed this Beta2 version successfully onto Tomcat.
 2. Then during the launch the following error message popped up:
- 400 Sorry, a technical error occurred. Please contact a system
 administrator.

 Thanks in advance...



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Guvnor-5-4-0-Beta2-launch-Error-tp3762321p3762321.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] ConsequenceException when using modify

2012-02-16 Thread Esteban Aliverti
Just out of curiosity, if you change your modify block and use an
updeat instead, does it work?
Something like:

$myObject.setVariable1(defaultValue);
update($myObject);

Best Regards,



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


On Thu, Feb 16, 2012 at 5:14 PM, Vakimshaar jean.loge...@gmail.com wrote:

 That's not what is in the doc:


 Documentation wrote
 
  All operators have normal Java semantics except for == and !=.
  The == operator has null-safe equals() semantics:
  // Similar to: java.util.Objects.equals(person.getFirstName(), John)
  // so (because John is not null) similar to:
  // John.equals(person.getFirstName())
  Person( firstName == John )
 

 And still, actually the MyObject class is actually wrapper to the
 ActualObject class. The getters and setters are basically simple wrapped.


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/ConsequenceException-when-using-modify-tp3750604p3750755.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] KnowledgeAgent custom class loader not working for PKG resources

2012-02-16 Thread Esteban Aliverti
Seems like a bug to me. The best you can do is to rise a Jira issue.
Actually, the best you can do is to provide a patch also ;)

Best Regards,



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


On Thu, Feb 16, 2012 at 5:59 PM, Hrumph herman.p...@imail.org wrote:

 Sorry for being a nuisance, but unless we are doing something wrong, this
 is
 a significant issue for us.  We are trying to deploy Drools on a remote
 server and hope to pull PKG Changesets and Fact models from Guvnor.  It is
 essential that we can use custom Classloaders in our design.

 Should I just enter this in Jira?

 Thanks,

 Herm



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3750972.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] KnowledgeAgent custom class loader not working for PKG resources

2012-02-16 Thread Esteban Aliverti
By the way, in the stacktrace you pasted I only see a NullPointerException,
but no ClassNotFoundException. Where are you seeing the
ClassNotFoundException?

Best Regards,



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


2012/2/16 Herman Post herman.p...@imail.org

 Thanks Esteban, I will enter in Jira.

 ** **

 ** **

 Herm

 ** **

 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Esteban Aliverti
 *Sent:* Thursday, February 16, 2012 10:07 AM
 *To:* Rules Users List
 *Subject:* Re: [rules-users] KnowledgeAgent custom class loader not
 working for PKG resources

 ** **

 Seems like a bug to me. The best you can do is to rise a Jira issue.

 Actually, the best you can do is to provide a patch also ;)

 ** **

 Best Regards,

 

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

 

 On Thu, Feb 16, 2012 at 5:59 PM, Hrumph herman.p...@imail.org wrote:

 Sorry for being a nuisance, but unless we are doing something wrong, this
 is
 a significant issue for us.  We are trying to deploy Drools on a remote
 server and hope to pull PKG Changesets and Fact models from Guvnor.  It is
 essential that we can use custom Classloaders in our design.

 Should I just enter this in Jira?

 Thanks,

 Herm



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3750972.html
 

 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

 ** **

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


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


Re: [rules-users] KnowledgeAgent custom class loader not working for PKG resources

2012-02-16 Thread Esteban Aliverti
Could you please try using 5.4.0-SNAPSHOT? I tried to reproduce your error
in that version, but I couldn't. Using 5.3.1 I experienced the error you
mentioned.
Please note that in order to change drools version you need to have a
binary .pkg compiled using the same version.

Best Regards,



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


2012/2/16 Herman Post herman.p...@imail.org

 In debug,  KnowledgeAgentImpl.createPackageFromResource(), the last line
 to run is DroolsStreamUtils.streamIn(is), then an excecption is caught:***
 *

 ** **

 *this*.listener.exception( *new* RuntimeException( KnowledgeAgent
 exception while trying to deserialize KnowledgeDefinitionsPackage  , ex));
 

 ** **

 The exception here says “java.lang.ClassNotFoundException:
 org.ihc.hwcir.drools.facts.Patient”, which is my Fact model.  It doesn’t
 seem to get surfaced anywhere.

 ** **

 As my sample illustrates, if I switch to DRL changeset, or put Patient.jar
 on classpath all works fine.

 ** **

 Thanks,

 ** **

 Herm

 ** **

 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Esteban Aliverti
 *Sent:* Thursday, February 16, 2012 10:33 AM

 *To:* Rules Users List
 *Subject:* Re: [rules-users] KnowledgeAgent custom class loader not
 working for PKG resources

 ** **

 By the way, in the stacktrace you pasted I only see a
 NullPointerException, but no ClassNotFoundException. Where are you seeing
 the ClassNotFoundException?

 ** **

 Best Regards,

 

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

 

 2012/2/16 Herman Post herman.p...@imail.org

 Thanks Esteban, I will enter in Jira.

  

  

 Herm

  

 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Esteban Aliverti
 *Sent:* Thursday, February 16, 2012 10:07 AM
 *To:* Rules Users List
 *Subject:* Re: [rules-users] KnowledgeAgent custom class loader not
 working for PKG resources

  

 Seems like a bug to me. The best you can do is to rise a Jira issue.

 Actually, the best you can do is to provide a patch also ;)

  

 Best Regards,

 

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

 On Thu, Feb 16, 2012 at 5:59 PM, Hrumph herman.p...@imail.org wrote:

 Sorry for being a nuisance, but unless we are doing something wrong, this
 is
 a significant issue for us.  We are trying to deploy Drools on a remote
 server and hope to pull PKG Changesets and Fact models from Guvnor.  It is
 essential that we can use custom Classloaders in our design.

 Should I just enter this in Jira?

 Thanks,

 Herm



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3750972.html
 

 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

  


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

 ** **

 ___
 rules-users 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] KnowledgeAgent custom class loader not working for PKG resources

2012-02-16 Thread Esteban Aliverti
Could you please upload you failing test project using 5.4 so I can test it?

Best Regards,



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


2012/2/16 Hrumph herman.p...@imail.org

 Regretably, I’m still getting the same error with 5.4.0.Beta2.


 I did rebuild my PKG in 5.4.0.Beta2 Guvnor and switched my Drools
 dependencies over to 5.4.0.Beta2 in my sample app pom too.

 ** **

 Is your 5.4.0 Snapshot later than this, and possibly it was fixed since
 Beta2?

 ** **

 Thanks,

 ** **

 Herm

 ** **

 *From:* Esteban [via Drools] [mailto:[hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3752041i=0]

 *Sent:* Thursday, February 16, 2012 12:05 PM
 *To:* Herman Post

 *Subject:* Re: [rules-users] KnowledgeAgent custom class loader not
 working for PKG resources

 ** **

 Could you please try using 5.4.0-SNAPSHOT? I tried to reproduce your error
 in that version, but I couldn't. Using 5.3.1 I experienced the error you
 mentioned.

 Please note that in order to change drools version you need to have a
 binary .pkg compiled using the same version.

 ** **

 Best Regards, 


 

 Esteban Aliverti
 - Developer @ click here.
 NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 

 --
 View this message in context: RE: [rules-users] KnowledgeAgent custom
 class loader not working for PKG 
 resourceshttp://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3752041.html

 Sent from the Drools: User forum mailing list 
 archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.htmlat 
 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] Failed to get rules from Guvor after apply Security using Tomcat and JAAS

2012-02-15 Thread Esteban Aliverti
Please search in this list about this problem. Your question has been
answered before. I think the documentation also has a section about how to
add security elements to the change-set.

Best Regards,



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


2012/2/15 mujoko mujoko mujoko.muj...@gmail.com

 Dear Rules Users,


 Previously, I use guvnor with no security.
 Now, my boss wants me to apply security on guvnor.

 The way I implement is use this link
 http://ngjweb.wordpress.com/2011/12/07/drools-guvnor-manage-access-part-2/


 which is using realm of tomcat and create a table is the system for guvnor
 user.
 I tested from browser, the security is working fine even more than 10
 users access concurrently.

 But when my application access the guvnor and try to create the knowledge
 base. It's becoming intermittent.
 After several time access the guvnor, the guvnor is hang/can not access
 even from browser.

 Here is the exception I got

 java.lang.RuntimeException: java.io.IOException: Server returned HTTP
 response code: 401 for URL:
 http://localhost:9090/guvnor/org.drools.guvnor.Guvnor/package/com.rbtsb.tm.meter/meter-internet/Dro
 pCDR-LocalcallWithBRemarks.drl
 
 at
 org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692)
 at
 org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37

 The way our app access the guvnor after apply security is as below.
 Snipped Code

 UrlResource urlResource = (UrlResource)
 ResourceFactory.newUrlResource(ruleUrl);
 urlResource.setBasicAuthentication(enabled);
 urlResource.setUsername(admin);
 urlResource.setPassword(admin);
  builder.add(urlResource,ResourceType.DRL);

 --
 Mujoko
 http://www.linkedin.com/in/mujoko


 ___
 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 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] (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 tns:taskName

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] GUVNOR

2012-02-09 Thread Esteban Aliverti
Deploy the war



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


2012/2/9 Olfa h h.olf...@gmail.com

 HI ,

 how to install DROOLS Guvnor ?

 ___
 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 ruleflow question

2012-02-08 Thread Esteban Aliverti
ruleflow term is kind of deprecated since jBPM5 emerged as a separate
project :) The correct term now should be process or business process.
These are the minimal dependencies you need if you want to use processes
and rules in your applications:

dependency
groupIdorg.drools/groupId
artifactIdknowledge-api/artifactId
version5.4.0-SNAPSHOT/version
typejar/type
/dependency
dependency
groupIdorg.drools/groupId
artifactIddrools-core/artifactId
version5.4.0-SNAPSHOT/version
/dependency
dependency
groupIdorg.drools/groupId
artifactIddrools-compiler/artifactId
version5.4.0-SNAPSHOT/version
/dependency
dependency
groupIdorg.jbpm/groupId
artifactIdjbpm-bpmn2/artifactId
version5.3.0-SNAPSHOT/version
/dependency
dependency
groupIdorg.jbpm/groupId
artifactIdjbpm-flow/artifactId
version5.3.0-SNAPSHOT/version
/dependency
dependency
groupIdorg.jbpm/groupId
artifactIdjbpm-flow-builder/artifactId
version5.3.0-SNAPSHOT/version
/dependency

Please note that org.jbpm artifact's versions (5.3.0-SNAPSHOT) are
different from org.drools  (5.4.0-SNAPSHOT)

Best Regards,



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


2012/2/7 St. Lawrence, Zachary zstla...@akamai.com

 I am trying to use ruleflows to test a different approach to a problem but
 I am having problems finding the right implementing jars for use in my
 maven imports.

 In 5.2 the needed builder classes were in jbpm-flow-builder.  But 5.3
 doesn't have that package.  How does one use ruleflows in the most recent
 release of drools?

 Zack

 ___
 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] Rule does not fire when JBPM asks to do so in BPMN 2.0 process

2012-02-08 Thread Esteban Aliverti
This is a tricky one :)

What is happening is that you are running the process first and inserting
the process instance later.
When the process is started, it runs until it finds the Rule Task. At that
point, since there is no activation for any of the rules in jobs
group (there is no ProcessInstance inserted yet, so there is no activation
for job complete rule) the execution continues (since you are already
inside a fireAllRules() invocation) until the process reaches the end or a
wait-state. At that point, the control is returned to the original rule
that started the process and the ProcessInstance is finally inserted.
What you can do is to split the creation of the process instance and its
execution:

rule New case
when
$case : Case(processed==false) from entry-point case stream

then
modify ($case){
setProcessed(true)
}

[  processing code omitted ... ]

//create the instance, but don't start it yet
ProcessInstance processInstance
= kcontext.getKnowledgeRuntime().createProcessInstance(com.mycompany.Process,
parameters);

//insert the instance in the WM: this will create the activation of
the other rule
insert(processInstance);

//now, start the process

  
kcontext.getKnowledgeRuntime().startProcessInstance(processInstance.getProcessInstance());

end

Best Regards,



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


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

 I'm afraid I can't publish as it is, but I hope this would give you a hint:

 myrules.drl:

 rule New case
 when
 $case : Case(processed==false) from entry-point case stream

 then
 modify ($case){
 setProcessed(true)
 }

 [  processing code omitted ... ]

 insert(kcontext.
 getKnowledgeRuntime().startProcess(com.mycompany.Process, parameters));
 end

 rule job complete
 ruleflow-group jobs group
 when
 $processInstance: WorkflowProcessInstance()
 then
 Job job = (Job)$processInstance.getVariable(var);
 update(job);
 end




 process.bpmn:

 ?xml version=1.0 encoding=UTF-8?
 definitions 
 process processType=Private isExecutable=true
 id=com.mycompany.Process name=process 
 [one start node and lots of nodes here, one that ends in the next ]

 businessRuleTask g:ruleFlowGroup=jobs group id=job complete
 name=complete job/

 [ lots of nodes after, ending in an end node]

 /process
 /definitions




 As you can see the rule New case is not in any group and is responsible
 ( if it is the case ) of launching the process, and then that process
 invokes the bussinessrule group jobs group. As stated, what we see is
 that the rule job complete never gets fired.



 Alberto R. Galdo
 arga...@gmail.com


 Alberto R. Galdo
 arga...@gmail.com




 On Tue, Feb 7, 2012 at 21:16, Mauricio Salatino sala...@gmail.com wrote:

 businessRuleTask who tries to fire a rule in drools ant that rule
 are not in the same group can you share the process definition and
 the rule?

 2012/2/7 Alberto R. Galdo arga...@gmail.com:
  Hi,
 
 The rule that inserts the process which has the node
 businessRuleTask
  who tries to fire a rule in drools ant that rule are not in the same
 group.
  In fact, the rule that should be fired is the only rule in that group
 and
  should only be fired by the process itself.
 
 What we are trying to do is to update the state of a fact inside
 drools
  with information gathered in the BPM process. Maybe I am getting this
 wrong,
  but, Is there another way to accomplish this?
 
  Greets,
 
 
  Alberto R. Galdo
  arga...@gmail.com
 
 
 
 
  On Tue, Feb 7, 2012 at 19:23, Mauricio Salatino sala...@gmail.com
 wrote:
 
  Hi are you using the same rule flow-group in the businessRuleTask and
  in your rule? can you share the rule that you are using?
  remember that the evaluation will be done by the engine as soon as the
  information comes in. The rule flow group will only execute something
  if a rule was activated inside the rule flow group of your
  businessRuleTask.
  Cheers
 
  On Tue, Feb 7, 2012 at 2:23 PM, argaldo arga...@gmail.com wrote:
   Hi,
  
We're running an application that uses Drools + JBPM 5 + Drools
   integration our set-up can be seen as:
  
Some rule fires and creates a JBPM process ( a fact gets inserted
 into
   drools using kcontext.getKnowledgeRuntime().startProcess() ),
 after a
   few
   nodes processed, the JBPM engine arrives to a node of type
   businessRuleTask which in turn tells drools to evaluate a group of
   rules (
   which at the moment consists on only one rule ).
  
Well, the problem is that what we see is that everything runs ok
 before
   the businessRuleTask and at the moment when the rule group would be
   evaluated we could see that in drools the rule gets created,
 activated,
   but
   never fired.
  
We

Re: [rules-users] [rules-dev] http://blog.athico.com/2012/02/welcome-alexandre-porcelli.html

2012-02-07 Thread Esteban Aliverti
Congratulation Alexandre!



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


On Tue, Feb 7, 2012 at 3:44 PM, Mark Proctor mproc...@codehaus.org wrote:

 http://blog.athico.com/2012/02/welcome-alexandre-porcelli.html
 ___
 rules-dev mailing list
 rules-...@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-dev

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


Re: [rules-users] how to retract all documents created in the following scenario

2012-02-03 Thread Esteban Aliverti
Did you try using Java dialect instead of MVEL?

Best Regards,



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


On Thu, Feb 2, 2012 at 11:47 PM, vadlam sreeram.vadlam...@wellsfargo.comwrote:


 when

 $emptyDocs:java.util.List(size0) from collect ( Document( field1== null ||
 == (  ) , field2 == null || == ( ) ) )

 then


//insert an error
Error fact0 = new Error();
fact0.setErrorCode( code1 );
insert(fact0 );

 for (int i=0; i  $emptyDocs.size(); i++){
retract( $emptyDocs.get(i));
}


 end

 when I do a validate on this, I get an error as below

 unable to resolve method using strict-mode:
 org.drools.spi.KnowledgeHelper.$emptyDocs()] [Near : {... for (int i=0; i 
 $emptyDocs.size(); i++){ }]


 am I making a mistake somewhere ?

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/how-to-retract-all-documents-created-in-the-following-scenario-tp3711226p3711512.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] Ruleflow: two flow exits (or equivalent?) from reusable sub-process?

2012-02-03 Thread Esteban Aliverti
One simple solution would be to define a boolean output variable in your
sub-process. When you use the sub-process in a bigger process you can map
the boolean output to a process variable and connect a Gateway to the
sub-process that evaluates the variable.
You can emulate this behavior using events as well. Define a throw event
node in your sub-process and attach a boundary event to it in the parent
process.

Best Regards.



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


2012/2/2 George Georgovassilis g.georgovassi...@gmail.com

 Hello list,

 I modeled (v5.3) a reusable sub-process which can either finish in a
 desired state (i.e. validations ok) or an undesired state (some validations
 failed and I need to route to a different flow). Ideally the sub-process
 would allow for two outgoing connections, but as far as I see that is
 currently not possible. Can anybody advise on how to achieve a similar
 functionality?

 Is there a chance I could build a workitem that extends the reusable
 sub-process but allows for two exit connections, and if yes, how?

 Can signals or fault nodes achieve a similar effect and if yes, then how?

 Thanks in advance,
 G.

 ___
 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] ChangeSet not working for Package Type

2012-02-03 Thread Esteban Aliverti
Could you please post the change-set you are using along with the error you
are getting?

Best Regards,



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


On Fri, Feb 3, 2012 at 12:47 PM, Mark Proctor mproc...@codehaus.org wrote:

 unit tests say otherwise:

 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/xml/changeset/ChangeSetTest.java

 If you think you have found a bug, you'll need to submit a pull request
 with additions to the above test class showing your problem.

 Mark
 On 03/02/2012 17:11, ponmanirajan wrote:
  I tried an application which gets the rule names using changeset.xml.
 
  In changeSet.xml,
 
i given the resource type as PKG and it is not working
 fine.
  but when i give the Type as DRL it is working fine.
 
 
  is any tips for me to run this case? My system has 64-bit OS. is it a
  problem?
  In 32-bit OS system, the same is running finely.
 
  can anyone help me?
 
 
  thanks in advance.
 
  --
  View this message in context:
 http://drools.46999.n3.nabble.com/ChangeSet-not-working-for-Package-Type-tp3712795p3712795.html
  Sent from the Drools: User forum mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users

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

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


Re: [rules-users] [rules-dev] Contributing to Drools?

2012-02-03 Thread Esteban Aliverti
Same thing here. Count on me for that! It is a good excuse to visit London
:)

Best Regards,



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


On Fri, Feb 3, 2012 at 12:57 PM, Mario Fusco mario.fu...@gmail.com wrote:

 That sounds a great idea.
 I don't come to London since too much time now, so I'd finally have a very
 good reason to come :)
 I am also looking forward to meet the other guys of the Drools team in
 person.

 Mario


 On Fri, Feb 3, 2012 at 12:48 PM, Mauricio Salatino sala...@gmail.comwrote:

 Count with me for that.. I always willing to do this kind of hackatons
 and long coding nights..
 Mark is it time to create a Drools User Group in London? a Drools Lab
 maybe?
 Cheers

 On Fri, Feb 3, 2012 at 8:07 AM, Mark Proctor mproc...@codehaus.org
 wrote:
  I've tried to organise these before, last time I had one person turn up
 :)
 
  I live in London and Michael Anstis is near by. Mauricio Salatino will
 be
  moving near by in March too. If there are people who are genuinely
  interested in learning to hack/improve DroolsjBPMGuvnor, and not just
  after free consultancy, we can arrange days and evenings in London. The
 Red
  Hat office is on Baker Street and has a room suitable for about 8
 people.
 
  I live in Chiswick and will gladly meet up with anyone at any time
 there,
  night or day. I regularly work from nero's of starbucks :)
 
  Also remember the entire DroolsjBPMGuvnor team is always available on
 irc.
  http://www.jboss.org/drools/irc
 
  Mark
 
  On 03/02/2012 15:49, Stephen Masters wrote:
 
  Hi folks,
 
  As with Mark's response on OSGI this morning, there have been a number
 of
  answers to questions on this list that mention that components are
 either
  not currently being worked on, or which request that users contribute
 new
  features or patches.
 
  It tends not to be that easy to get to grips with a large open source
  project, so recently the London Java Community organised an OpenJDK hack
  session (http://www.meetup.com/Londonjavacommunity/events/49243872/)
 where
  they were helping people to build the projects and working on some
  'low-hanging-fruit' issues. And apparently the session produced around
 20
  patches, which seems pretty impressive to me given that it was just a
 3-hour
  evening session.
 
  There seems to be a reasonable number of Drools developers and users in
 or
  near London, although I'm not sure about other locations. So I was
 wondering
  how feasible it might be to organise something similar around Drools.
  Obviously it would need a combination of some core developers prepared
 to
  spend some of their time helping folks such as myself get to grips with
  building and testing things, and enough developers interested in
 spending
  their spare time learning their way around the internals of the various
  Drools components. The London JBoss User Group set up a JBoss AS7
 hackathon
  last year, so perhaps there might be someone there who would be
 prepared to
  help out?
 
  Any thoughts?
 
  Steve
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
  ___
  rules-dev mailing list
  rules-...@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-dev
 



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



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


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


Re: [rules-users] how to retract all documents created in the following scenario

2012-02-02 Thread Esteban Aliverti
You could do something like this:

rule 'empty documents'
...
when
  $emptyDocs: List(size0) from collect ( Document( field1== null || == (
 ) , field2 == null || == ( ) ) )
then
//insert an error
Error fact0 = new Error();
fact0.setErrorCode( code1 );
insert(fact0 );

//retract empty documents
for (int i=0; i  $emptyDocs.size(); i++){
retract( $emptyDocs.get(i));
}

end


Best Regards,



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


On Thu, Feb 2, 2012 at 9:59 PM, vadlam sreeram.vadlam...@wellsfargo.comwrote:

 Hi All,

 we have a scenario whereby, several documents are created as part of the
 ruleflow. at the end of the ruleflow, if any of the fields in the document
 is empty or null, we would like to create a error (only one error) and
 retract all the documents so far.

 rule createError
ruleflow-group mrHardErrors
no-loop true
dialect mvel

when


 emptyDoc : Document( field1== null || == (  ) , field2 == null || == ( 
 )  )
doc : Document( )
then

Error fact0 = new Error();
fact0.setErrorCode( code1 );
insert(fact0 );
retract( emptyDoc);

 end

 I see that error is created more than once ( as many as matching documents
 )

 How do we ensure that all documents are retracted and also the error is
 created only once ?

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/how-to-retract-all-documents-created-in-the-following-scenario-tp3711226p3711226.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] setting different value in consequence ( RHS part) based on a conditional check

2012-01-27 Thread Esteban Aliverti
Did I just heard Wolfgang complaining about being too dogmatic??? After all
maybe the Mayans were right :)
By the way, Vadlam,  did you try using a template rule in Guvnor?

Best Regards,



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


On Fri, Jan 27, 2012 at 10:10 AM, FrankVhh frank.vanhoensho...@agserv.euwrote:

 Hi Wolfgang,

 Can I push you for a clarification on this statement?

 Imho, any of the following reasons is good enough to put a decision in
 rules
A- The decision logic is likely to be subject to change
B- The decision logic is too complex to implement in a procedural way
C- The decision logic is making sense to business users. (i.e.
 non-technical logic)

 In this case, option B is opviously way off. But one can only guess
 regarding A and C.

 Regards,
 Frank


 laune wrote
 
  Oh my, aren't we a wee bit too dogmatic? I've certainly been known as
  being
  a stickler to style and best practice and what not, but in this
 particular
  case I'd use a single rule and offload the earth-shaking decision between
  'Y' and 'N' into a function:
 
  rule x
  when
 samplefact1( $status: status, state == CA )
  then
 fact0.setField1(  yn( $status)  );
  end
 
  Cheers
  -W
  ___
  rules-users mailing list
  rules-users@.jboss
  https://lists.jboss.org/mailman/listinfo/rules-users
 


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-RHS-part-based-on-a-conditional-check-tp3690826p3692750.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] Infinit loop in simple example

2012-01-20 Thread Esteban Aliverti
import spikes.Applicant
rule Is of valid age when
   $a : Applicant( age  18 )
then
   modify( $a ) { valid = false };
end

By using modify() you are telling the engine that $a was modified in some
way. This causes the re-evaluation of your rule, and since $a.age is still
 18, then the rule is activated and fired infinite times.
Read the documentation manual about some attributes you can use in your
rules to avoid this behavior: no-loop, lock-on-active.

Best Regards,



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


On Fri, Jan 20, 2012 at 3:12 PM, roland.kofler roland.kof...@gmail.comwrote:

 Simple example loops ad infinitum if executed:

 package spikes;

 import org.springframework.roo.addon.javabean.RooJavaBean;

 @RooJavaBean
 public class Applicant {
 private final String string;
 private final int age;
 public boolean valid=true;

 public Applicant(String string, int i) {
this.string = string;
this.age = i;
 }
 }
 DroolsSpikeTest

 package spikes;

 import static org.junit.Assert.*;

 import org.drools.KnowledgeBase;
 import org.drools.runtime.StatelessKnowledgeSession;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

 @RunWith(SpringJUnit4ClassRunner.class)

 @ContextConfiguration(locations={classpath:**/applicationContext-drools.xml})
 public class DroolsSpikeTest {

@Autowired
private KnowledgeBase kbase;

@Test
public void testspikeDroolRule() {
StatelessKnowledgeSession ksession =
 kbase.newStatelessKnowledgeSession();
Applicant a = new Applicant(Mr John Smith, 16);
assertTrue(a.isValid());
ksession.execute(a);
assertFalse(a.isValid());
}

 }
 applicationContext-drools.xml

 ?xml version=1.0 encoding=UTF-8 standalone=no?

 beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:aop=http://www.springframework.org/schema/aop;
 xmlns:context=http://www.springframework.org/schema/context;
 xmlns:jee=http://www.springframework.org/schema/jee;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:drools=http://drools.org/schema/drools-spring;
 xsi:schemaLocation=http://www.springframework.org/schema/aop
 http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context-3.1.xsd
 http://www.springframework.org/schema/jee
 http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
 http://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
 http://drools.org/schema/drools-spring

 http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd
 

 drools:kbase id=kbase1
   drools:resources
drools:resource id=licenseRule type=DRL
 source=classpath:spikes/licenseApplication.drl/
   /drools:resources
   drools:configuration
   drools:mbeans enabled=true /
   /drools:configuration
 /drools:kbase
 drools:ksession kbase=kbase1 type=stateless id=ksessionStateless
 name=stateless1 
 /drools:ksession
 /beans

 licenseApplication.drl

 import spikes.Applicant
 rule Is of valid age when
$a : Applicant( age  18 )
 then
modify( $a ) { valid = false };
 end

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Infinit-loop-in-simple-example-tp3675536p3675536.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] Guvnor export options.

2012-01-18 Thread Esteban Aliverti
Take a look at the documentation: REST-API and webdav sections.

Best Regards,



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


On Wed, Jan 18, 2012 at 5:03 AM, pm-lemos pedrolemos...@gmail.com wrote:

 Hi,

 I'm kind of looking for a way to export the rules I wrote in Guvnor to a
 .DRL file.
 Is it possible? How can I do it?

 Thanks in advance.
 Pedro

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Guvnor-export-options-tp3668262p3668262.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] unable to load jar file

2012-01-18 Thread Esteban Aliverti
As far as I know, what you are asking is not possible.

Best Regards,



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


2012/1/18 kavitha sethu kavithase...@gmail.com

 Hi,

 Can anybody tell me how to use groovy classes as fact classes in guvnor.
 Because, i tried to upload the jar file of the java classes and it seems to
 be working fine.

 Thanks,
 Kavitha.



 On Wed, Jan 18, 2012 at 10:13 AM, Esteban Aliverti 
 esteban.alive...@gmail.com wrote:

 Seems like your model has some Groovy dependencies. If you upload a jar,
 all the referenced classes (dependencies) of that jar must to be available
 to Guvnor.
 What I recommend to do is to create a plain POJO model without any
 external library dependency (if possible)

 Best Regards,

 

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



 On Wed, Jan 18, 2012 at 6:10 PM, kavita kavithase...@gmail.com wrote:

 Hi,

 I am trying to upload a POJO jar file into drools guvnor. But it is
 throwing
 me an error saying unable to load file.
 This is the file that am trying to upload

 http://drools.46999.n3.nabble.com/file/n3669841/QcResult.jarQcResult.jar

 I am running drools guvnor 5.3 on tomcat server. When i looked into the
 logs
 of tomcat, the following is the stacktrace..

 SEVERE: Servlet.service() for servlet AssetFileServlet threw exception
 java.lang.ClassNotFoundException: groovy.lang.GroovyObject
at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at

 org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at

 org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86)
at

 org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104)
at java.lang.ClassLoader.loadClass(Unknown Source)
at

 org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183)
at

 org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148)
at

 org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66)
at

 org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115)
at

 org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at

 org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
at

 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at

 org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
at

 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at

 org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
at

 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at

 org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
at

 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at

 org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
at

 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
 org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at

 org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
at

 org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
at

 org.drools.guvnor.server.files.FileManagerUtils_$$_javassist_seam_10.attachFile(FileManagerUtils_$$_javassist_seam_10.java)
at

 org.drools.guvnor.server.files.AssetFileServlet.processAttachFileToAsset(AssetFileServlet.java:97)
at

 org.drools.guvnor.server.files.AssetFileServlet.doPost(AssetFileServlet.java:49

Re: [rules-users] Resource Change Scanner Service modified date error

2012-01-17 Thread Esteban Aliverti
Dean, did you figure out why your code is using a ReaderResource? There are
other threads reporting this same problem.

Best Regards,



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


On Fri, Jan 6, 2012 at 2:14 PM, Jiri Svitak jsvi...@redhat.com wrote:

 Hello Dean,

 you are right,
 https://issues.jboss.org/browse/GUVNOR-1699
 solves something different. Bugzilla
 https://bugzilla.redhat.com/show_bug.cgi?id=733008
 still waits to be solved. I have updated this bugzilla to be linked to
 belonging JIRA issues.
 You can look also on other bugs which have the same root cause. But I am
 not developer, so I cannot
 tell you when it'll be fixed.

 Jiri Svitak

 On 01/05/2012 02:27 PM, Dean wrote:
  Hi
 
  I am experiencing a problem with starting the
 ResourceChangeScannerService
  as described here: https://bugzilla.redhat.com/show_bug.cgi?id=733008
 
  I can create a KnowledgeAgent instance and apply a changeset to it which
  loads the desired package from Guvnor. However, as soon as I attempt to
  start the ScannerService in order to be notified of changes to this
 package
  I immediately receive the exception: java.lang.IllegalStateException:
 reader
  does have a modified date. Then on every scanner interval following, the
  scanner fails each time with the same error message.
 
  Apparently, this issue has already been fixed here:
  https://issues.jboss.org/browse/GUVNOR-1699
 
  However, I am still experiencing this problem even with Drools
 5.4.0.Beta1
 
  Could somebody perhaps help me with this. I am attempting to rebuild the
  source code on my side, however, I am having endless problems with Maven.
 
  Regards
 
  Dean
 
  --
  View this message in context:
 http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3634802.html
  Sent from the Drools: User forum mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users

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

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


Re: [rules-users] Application Guvnor integration

2012-01-17 Thread Esteban Aliverti
Unfortunately, this is a known issue that remains open:
https://bugzilla.redhat.com/show_bug.cgi?id=733008
What I don't understand is why Drools is trying to use a
ReaderResource instead of a URLResource. Let me check into the source code
to see what I find.

Best Regards,



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


2012/1/17 Michael Anstis michael.ans...@gmail.com

 Yay, at long last a Java Stack Trace :)

 This is a known problem, but one I believe has been fixed for 5.4.0.beta1
 - correct me if I am wrong esteban.

 sent on the move

 On 17 Jan 2012 07:22, Senthil K kris.senthilku...@gmail.com wrote:

 Thank you Manstis..I'm able to retrieve the packages and rulenames through
 ChangeSet.I verified that example(Mortgages).But,When I delete a rule in
 guvnor,the change is not getting reflecting in my Java code..I think the
 ResourceScanner is unable to start the service.Here is the following
 exception I'm getting when i add the below lines
 ResourceChangeScannerConfiguration sconf=


 ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();

 sconf.setProperty(drools.resource.scanner.interval, 30);

 ResourceFactory.getResourceChangeScannerService().configure(sconf);


 ResourceFactory.getResourceChangeNotifierService().start();

 ResourceFactory.getResourceChangeScannerService().start();
 *This is exception I'm getting*
 Exception in thread Thread-3 java.lang.IllegalStateException: reader
 does
 have a modified date
at
 org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java:64)
at

 org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:166)
at

 org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:311)
at java.lang.Thread.run(Thread.java:662)
 After starting Notification service
 After rule engine start
 no of packages1
 This is : pricing Packages and  RuleName is ageprice
 This is : pricing Packages and  RuleName is incomeprice
 This is : pricing Packages and  RuleName is cpvprice


 How to scan changes in that ChangeSet.Did my Java code went wrong??Can you
 please help me out this..Please
 Thanks


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


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


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


Re: [rules-users] Resource Change Scanner Service modified date error

2012-01-17 Thread Esteban Aliverti
So, maybe some change in PackageBuilder is not setting the correct Resource
to Declared Fact types. Unfortunately I don't have time right now to take a
look at this problem.
Could you try adding DRL resource instead of compiled package?

Best Regards,



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


2012/1/17 Dean Eastwood d...@qualica.com

 Hi Esteban

 Unfortunately I haven't had time to work further on this issue, so I don't
 have an answer yet.

 All I can say for now is it seems that the ReaderResources are being
 created along with the URLResource each time. This is evidenced by the
 details below.

 In my test, I have the following changeset based on the mortgages sample
 (I have changed my hosting port):


 --

 *change-set xmlns='http://drools.org/drools-5.0/change-set'*
 *xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'*
 *xs:schemaLocation='http://drools.org/drools-5.0/change-set
 http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd'
 *
 *add*
 * resource source='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST'
 type='PKG' /*
 */add*
 */change-set*

 --


 This changeset can be read as a UrlResource, ClassPathResource or
 ByteArrayResource. I then use the following code to initialise the
 KnowledgeAgent:

 --


 *SystemEventListenerFactory.setSystemEventListener(new
 PrintStreamSystemEventListener(System.out));*
 **
 *KnowledgeAgent kagent =
 KnowledgeAgentFactory.newKnowledgeAgent(MortgageAgent);*
 *Resource changeset =
 ResourceFactory.newClassPathResource(ChangeSet.xml);*
 *kagent.applyChangeSet(changeset);*

 --


 Within the System event listener output, I see that the KnowledgeAgent
 picks up all of the KnowledgeDefinitions from Drools and creates them as
 new UrlResources. Next, it picks up the KnowledgeDefinitions from drools
 and creates these all as null ReaderResources. Here is some output from my
 System event listener:

 --


 *[2012-01-17 10:32:32,577:debug] KnowledgeAgent rebuilding KnowledgeBase
 using ChangeSet*
 *[2012-01-17 10:32:33,410:debug] KnowledgeAgent building resource map*
  *[2012-01-17 10:32:33,411:debug] KnowledgeAgent no resource mapped for
 rule=[Rule name=Dummy rule, agendaGroup=MAIN, salience=0, no-loop=false]*
 *[2012-01-17 10:32:33,411:debug] KnowledgeAgent mapping
 resource=[UrlResource path='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST']
 to KnowledgeDefinition=[Rule name=Dummy rule, agendaGroup=MAIN, salience=0,
 no-loop=false]*
 *[2012-01-17 10:32:33,411:debug] KnowledgeAgent mapping
 resource=[UrlResource path='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST']
 to KnowledgeDefinition=[Rule name=Underage, agendaGroup=MAIN, salience=10,
 no-loop=false]*
 *[2012-01-17 10:32:33,411:debug] KnowledgeAgent mapping
 resource=[UrlResource path='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST']
 to KnowledgeDefinition=[Rule name=Bankruptcy history, agendaGroup=MAIN,
 salience=10, no-loop=false]*
 *[2012-01-17 10:32:33,411:debug] KnowledgeAgent mapping
 resource=[UrlResource path='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST']
 to KnowledgeDefinition=[Rule name=No bad credit checks, agendaGroup=MAIN,
 salience=10, no-loop=false]*
 *[2012-01-17 10:32:33,411:debug] KnowledgeAgent mapping
 resource=[UrlResource path='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST']
 to KnowledgeDefinition=[Rule name=no NINJAs, agendaGroup=MAIN, salience=10,
 no-loop=false]*
 *[2012-01-17 10:32:33,411:debug] KnowledgeAgent mapping
 resource=[UrlResource path='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST']
 to KnowledgeDefinition=[Rule name=Row 3 Pricing loans, agendaGroup=MAIN,
 salience=0, no-loop=false]*
 *[2012-01-17 10:32:33,411:debug] KnowledgeAgent mapping
 resource=[UrlResource path='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST']
 to KnowledgeDefinition=[Rule name=Row 1 Pricing loans, agendaGroup=MAIN,
 salience=0, no-loop=false]*
 *[2012-01-17 10:32:33,411:debug] KnowledgeAgent mapping
 resource=[UrlResource path='
 http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST']
 to KnowledgeDefinition=[Rule name=Row 2 Pricing loans, agendaGroup=MAIN

Re: [rules-users] ClassCastException when KnowledgeAgent loads declared type

2012-01-17 Thread Esteban Aliverti
This is a known bug: https://issues.jboss.org/browse/JBRULES-2962 Some
improvements were made in 5.3 and 5.4 but AFAIK, the issue still remains.
Could you please try using 5.4.SNAPSHOT ot beta1 to see if the error
persists?

Best Regards,



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


On Mon, Jan 16, 2012 at 7:21 PM, lhorton lhor...@abclegal.com wrote:

 Code level:  5.2.0.Final

 I have a DRL file that includes a declared type:

 package com.abclegal.rules.servicerequirements
 declare TransgressionMetaData
attempt : ServiceAttempt
requirement : Requirement
 end

 The package loads the first time and its rules run without error.  If I
 make
 a change to the file and hot-deploy it (copy it to the server), the
 ResourceChangeScanner picks up the file and KnowledgeAgent loads it, but
 when any rule from that package subsequently fires, I get a
 ClassCastException on the declared type:

 com.abclegal.rules.servicerequirements.TransgressionMetaData cannot be cast
 to com.abclegal.rules.servicerequirements.TransgressionMetaData

 it appears the KnowledgeAgent is not replacing the existing (in working
 memory) definition of the declared type, but instead is creating a new one
 with a different hash code.

 looks like a bug?

 Full stack trace:
 Caused by: RulesConsequenceException executing consequence for rule
 PHOTO_WHEN_SERVED: Photo must be taken if served. in
 com.abclegal.rules.servicerequirements
 [Error: drools.insert(new TransgressionMetaData($attempt,$req)):
 com.abclegal.rules.servicerequirements.TransgressionMetaData cannot be cast
 to com.abclegal.rules.servicerequirements.TransgressionMetaData]
 [Near : {... @Modify with($attempt){ }]
 ^
 [Line: 1, Column: 1]
 java.lang.ClassCastException:
 com.abclegal.rules.servicerequirements.TransgressionMetaData cannot be cast
 to com.abclegal.rules.servicerequirements.TransgressionMetaData
 Rules working memory:
 Fact ServiceAttempt id: 17
at

 com.abclegal.rules.utility.RulesConsequenceExceptionHandler.handleException(RulesConsequenceExceptionHandler.java:24)
at
 org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:912)
at
 org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:845)
at
 org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1056)
at

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

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

 org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at

 org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:305)
at

 com.abclegal.rules.server.RulesServiceImpl.execute(RulesServiceImpl.java:378)
... 44 more
 Caused by: [Error: drools.insert(new TransgressionMetaData($attempt,$req)):
 com.abclegal.rules.servicerequirements.TransgressionMetaData cannot be cast
 to com.abclegal.rules.servicerequirements.TransgressionMetaData]
 [Near : {... @Modify with($attempt){ }]
 ^
 [Line: 1, Column: 1]
at

 org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:409)
at

 org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:140)
at

 org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:67)
at org.mvel2.ast.ASTNode.optimize(ASTNode.java:154)
at
 org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:110)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:86)
at
 org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:122)
at
 org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:115)
at org.mvel2.MVEL.executeExpression(MVEL.java:928)
at
 org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:105)
at
 org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:906)
... 51 more
 Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at

 org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:1066)
at

 org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:338)
... 61 more


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/ClassCastException-when-KnowledgeAgent-loads-declared

Re: [rules-users] Application Guvnor integration

2012-01-16 Thread Esteban Aliverti
I noticed you are calling applyChangeSet() twice. Any reason in why to do
that? I mean, it should work ok, but maybe you have found a bug. Try to
remove one of the invocations.
Regarding the logs, there must be some KnowledgeAgent logs in the console
output of your application. Could you share them?

Best Regards,



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


On Mon, Jan 16, 2012 at 6:14 AM, Senthil K kris.senthilku...@gmail.comwrote:

 Hi Esteban,
 Any update on this please? Anything wrong in what i am doing?
 Please help me out.

 Regards,
 Senthil


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Application-Guvnor-integration-tp3655924p3662255.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] unable to update the changes (guvnor rules) to application using changeset

2012-01-16 Thread Esteban Aliverti
Each package in Guvnor has its own REST URL (I think it is the same URL
used in the changeset :P). You can try to manually add each package to your
kbuilder using a URLResource pointing to each package's URL.

Best Regards,



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


On Sat, Jan 14, 2012 at 6:36 PM, srinivasasanda srinivasasa...@gmail.comwrote:

 Hi Esteban,

 Can you please suggest me how to implement this changeset using REST API.

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3659361.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] Calling POJO class get Method in BRL

2012-01-16 Thread Esteban Aliverti
The rule seems ok. Of course you need to insert a PersonDetails object in
your working memory if you want the rule to get activated. Please read
Drools documentation to see rules' life-cycle:
http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-expert-docs/html_single/index.html

Best Regards,



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


On Mon, Jan 16, 2012 at 1:34 PM, srinivasasanda srinivasasa...@gmail.comwrote:

 Hi Manstis,

 Where do you insert a PersonDetails fact?

 Why do you set the age on Person when you state it'll be in PersonDetails?

 You'll also need to have a relationship between Person and PersonDetails
 and
 include this in your rule.

 Manstis,Let me explain my requirement precisely.age is the field in my POJO
 class which is set to 40.In the same way,I set the value of age which is in
 Person fact to 40 in my main executable class.

 Now,I need to compare age in POJO class(which is 40(hardcoded))and age in
 Person fact(which is set to 40 in the main Java class
 -appType.set(application, age, 40);)

 When these two ages are equal,I should print welcome drools.As both are
 40,the output must be Welcome Drools.

 Here is my BRL code.
 when
 4. |PersonDetails( a : age  0 )
 5. |Personn( age == a )
 6. |then
 7. |System.out.println(Welcome Drools);
 8. | end

 Should i need to insert Model PersonDetails in the source code?I followed
 ur
 instructions to create BRL.Please help me in achieving my requirement

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Calling-POJO-class-get-Method-in-BRL-tp3662420p3663046.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] unable to update the changes (guvnor rules) to application using changeset

2012-01-16 Thread Esteban Aliverti
You will need to check why are you getting the exception in the knowledge
agent: java.lang.RuntimeException: KnowledgeAgent exception while trying
to deserialize KnowledgeDefinitionsPackage
The error seems to happen when MVELDialectRuntimeData is deserialized. The
strange thing is that error could only happen if you are using PKG in your
changesets. According to your code, you are using DRL, right?

Best Regards,




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


On Mon, Jan 16, 2012 at 1:42 PM, srinivasasanda srinivasasa...@gmail.comwrote:

 Hi Esteban,

 I tried all ways to implement changeset using REST API with the same
 code,but my packages that I'm retrieving are zero.Could you help me out in
 implelementing changeset using REST API

 Thanks

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3663064.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] unable to update the changes (guvnor rules) to application using changeset

2012-01-16 Thread Esteban Aliverti
So, no Knowledge Agent logs? That's weird. I would suggest you to download
Drools' binaries and debug inside KnowldgeAgentImpl.java to see what is
going on. Did you try without using a KnowledgeAgent? You can also add a
change-set to a KnowledgeBuilder and construct a KnowledgeBase using the
compiled packages of the kbuilder.

Best Regards,



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


On Mon, Jan 16, 2012 at 3:11 PM, srinivasasanda srinivasasa...@gmail.comwrote:

 efore rule engine start
 after creating kagent
 $After Apply change set
 After starting Notification service
 After rule engine start
 no of packages0
 no of packages0
 no of packages0
 no of packages0.

 ChangeSet is
 change-set xmlns='http://drools.org/drools-5.0/change-set'
   xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
   xs:schemaLocation='http://drools.org/drools-5.0/change-set

 http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd
 '
 
   add
 resource
 source='
 http://localhost:8080/guvnor-5.3.0.Final-jboss-as-5.1/rest/packages/pricing/source
 '
 type='DRL' /
resource
 source='
 http://localhost:8080/guvnor-5.3.0.Final-jboss-as-5.1/rest/packages/search/source
 '
 type='DRL' /
/add
 /change-set
 Till now,I'm unable to find why changeset is working fine for local DRL
 files,but when it comes to guvnor DRL's with rest api embedded,its
 generating no output.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3663306.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] Application Guvnor integration

2012-01-16 Thread Esteban Aliverti
I think we have a duplication problem here :) Are you and
srinivasasa...@gmail.com working together? If so, please let's continue
this discussion in just one thread.

Best Regards,



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


On Mon, Jan 16, 2012 at 3:26 PM, Senthil K kris.senthilku...@gmail.comwrote:

 Hi Esteban,

 This is my System.out log...Where I'm getting all packages as 0.

 Before rule engine start
 after creating kagent
 after apply change set
 After starting Notification service
 no of packages0
 Thanks

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Application-Guvnor-integration-tp3655924p3663347.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


  1   2   3   4   5   >