Re: [rules-users] how can i get document of ruleflow?

2011-10-31 Thread xdyl
Thanks.
But the drools flow and jbpm is the same thing?


http://www.jboss.org/drools/drools-flow.html 
in this link,i find it say



 wrote:
 
 Drools Flow is a community project. jBPM is still the only offical
 workflow product at JBoss. Drools Flow and jBPM are two separate projects.
 This is as a result of the need for process integration within the Drools
 knowledge-oriented platform (and advanced integration between processes
 and rules), which could not be provided by the jBPM project at that point.
 Both jBPM4 and Drools Flow are based on a (similar but independent)
 process framework with pluggable execution behaviour, what jBPM refers to
 as the PVM (Process Virtual Machine). However, until now, neither the jBPM
 or Drools team have been able to agree on a common way to move forward. We
 however do believe Drools Flow offers a set of features at least
 comparable with the jBPM project.
 


--
View this message in context: 
http://drools.46999.n3.nabble.com/how-can-i-get-document-of-ruleflow-tp3460258p3467247.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] how can i get document of ruleflow?

2011-10-31 Thread Mauricio Salatino
jBPM5 and Drools Flow are based on the same code base.
jBPM3 and jBPM 4.x are not the same. Which version are you evaluating?
Cheers

On Mon, Oct 31, 2011 at 4:43 AM, xdyl xdylx...@163.com wrote:

 Thanks.
 But the drools flow and jbpm is the same thing?


 http://www.jboss.org/drools/drools-flow.html
 in this link,i find it say



  wrote:
 
  Drools Flow is a community project. jBPM is still the only offical
  workflow product at JBoss. Drools Flow and jBPM are two separate
 projects.
  This is as a result of the need for process integration within the Drools
  knowledge-oriented platform (and advanced integration between processes
  and rules), which could not be provided by the jBPM project at that
 point.
  Both jBPM4 and Drools Flow are based on a (similar but independent)
  process framework with pluggable execution behaviour, what jBPM refers to
  as the PVM (Process Virtual Machine). However, until now, neither the
 jBPM
  or Drools team have been able to agree on a common way to move forward.
 We
  however do believe Drools Flow offers a set of features at least
  comparable with the jBPM project.
 


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/how-can-i-get-document-of-ruleflow-tp3460258p3467247.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.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


Re: [rules-users] how can i get document of ruleflow?

2011-10-31 Thread xdyl
i want use the latest version of drools.

it can be 5.3.0


if drools flow and jbpm5 is the same thing ,how can i get the jbpm5
document?
i didnt find document in the link you give me.



but  i find another link in google search with  drools flow manual :
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-flow/html_single/index.html




--
View this message in context: 
http://drools.46999.n3.nabble.com/how-can-i-get-document-of-ruleflow-tp3460258p3467266.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] how can i get document of ruleflow?

2011-10-31 Thread Mauricio Salatino
Drools flow doesn't exist any more from the newest versions, now the
project is called jBPM5:

http://www.jboss.org/jbpm/documentation

Cheers

On Mon, Oct 31, 2011 at 4:56 AM, xdyl xdylx...@163.com wrote:

 i want use the latest version of drools.

 it can be 5.3.0


 if drools flow and jbpm5 is the same thing ,how can i get the jbpm5
 document?
 i didnt find document in the link you give me.



 but  i find another link in google search with  drools flow manual :

 http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-flow/html_single/index.html




 --
 View this message in context:
 http://drools.46999.n3.nabble.com/how-can-i-get-document-of-ruleflow-tp3460258p3467266.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.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


Re: [rules-users] how can i get document of ruleflow?

2011-10-31 Thread xdyl
thanks very much.
i will try the newest version.



--
View this message in context: 
http://drools.46999.n3.nabble.com/how-can-i-get-document-of-ruleflow-tp3460258p3467353.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Sliding Length Windows

2011-10-31 Thread diana-mendes
Hello,

Thank you for your response, I understand how the sliding window works now. 
However, when I use the code you wrote I get the following error:

Exception in thread main java.lang.RuntimeException: Unable to resolve
ObjectType 'List' : [Rule name='Rule2']

Unable to Analyse Expression $last2:
[Error: unable to resolve method using strict-mode:
java.lang.Object.$last2()]


My rule looks like this:

rule Rule2
when
  $last2: List() from collect( Notif() over window:length(2) ) 
  $nNewONT : Number() from accumulate ( Notif( specificProblem
== New ONT ) from $last2, count() )
then
  ...
end


Do Lists require any additional code?...

Thanks in advance,

Diana



--
View this message in context: 
http://drools.46999.n3.nabble.com/Sliding-Length-Windows-tp3438408p3467432.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] Online 5.3.0 javadocs

2011-10-31 Thread Martin A
Hello,
I'm looking for the online 5.3.0 javadocs, but can't find it... Would you
point me to a reference?

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


[rules-users] How can Drools Planner consume Guvnor generated drl file?

2011-10-31 Thread Praveen
Hi,

We are trying to build a system where drools planner consumes drl from the
Guvnor.
The planner doesnot use Knowledgebase built on ChangeSet.xml which is a
conventional way 
of using drl from Guvnor in Java apps.

Please let us know the details of how we can achieve this .
Also how can we get rid of the Config xml that we use in the planner.

Thanks  Regards,
Praveen.

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-can-Drools-Planner-consume-Guvnor-generated-drl-file-tp3467722p3467722.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Sliding Length Windows

2011-10-31 Thread Edson Tirelli
   import java.util.List

   Edson

2011/10/31 diana-mendes diana-men...@hotmail.com

 Hello,

 Thank you for your response, I understand how the sliding window works now.
 However, when I use the code you wrote I get the following error:

 Exception in thread main java.lang.RuntimeException: Unable to resolve
 ObjectType 'List' : [Rule name='Rule2']

 Unable to Analyse Expression $last2:
 [Error: unable to resolve method using strict-mode:
 java.lang.Object.$last2()]


 My rule looks like this:

 rule Rule2
when
   $last2: List() from collect( Notif() over window:length(2) )
  $nNewONT : Number() from accumulate ( Notif( specificProblem
 == New ONT ) from $last2, count() )
 then
  ...
 end


 Do Lists require any additional code?...

 Thanks in advance,

 Diana



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Sliding-Length-Windows-tp3438408p3467432.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




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


[rules-users] global as link to DB: different results

2011-10-31 Thread elsdestickere
Hi,

I read docs about global and Hibernate to access your DB from the rules.
I tried something simular for in memory DAO's.
But some rules fire (WM in RHS) as the DAO has 3 items, but others (dao
in LHS) don't, how is that possible?

global RepositoryFactory repFact;
rule dao 
when
   k : Customer(  ) from repFact.getCustomerRepository().findAll();
then
System.out.println( Drools +drools.getRule().getName()+: 
+k.getName());
end
rule WM
when
   k : Customer(  ) ;
then
System.out.println( Drools +drools.getRule().getName()+: 
+k.getName()+ + size: +repFact.getCustomerRepository().findAll().size());
end
...
RepositoryFactory repFact = Registry.getRepositoryFactory();
ksession.setGlobal(repFact, repFact);
...
CustomerRepository customerRepo = Registry.getRepositoryFactory()
.getCustomerRepository();
customerRepo.add(tom);
customerRepo.add(elise);
customerRepo.add(bert);
ksession.insert(bert);
ksession.fireAllRules();

...
Output:
Drools WM: Bert + size: 3

br,
Els


--
View this message in context: 
http://drools.46999.n3.nabble.com/global-as-link-to-DB-different-results-tp3467897p3467897.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Does window:length work in Drools version 5.1.1 ?

2011-10-31 Thread eskomk
Hi W,

Thank you, the sum in tracker approach worked fine.

Now I'll test if the update of tracker instead of creating level2 tracker is
enough for us ...

On the other hand, we are now considering moving from drools 5.1.1 to 5.2.0
or to 5.3.0.

br Esko

Esko Hujanen
www.ebsolut.fi

--
View this message in context: 
http://drools.46999.n3.nabble.com/Does-window-length-work-in-Drools-version-5-1-1-tp3460621p3467949.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] global as link to DB: different results

2011-10-31 Thread Wolfgang Laun
Globals cannot to be used - directly or indirectly - as objects that should
trigger
the firing of rules. It is only insert, modify or update, and retract that
cause (re-)evaluation of LHS conditions.

-W

On 31 October 2011 15:05, elsdestickere elsdestick...@yahoo.com wrote:

 Hi,

 I read docs about global and Hibernate to access your DB from the rules.
 I tried something simular for in memory DAO's.
 But some rules fire (WM in RHS) as the DAO has 3 items, but others (dao
 in LHS) don't, how is that possible?

 global RepositoryFactory repFact;
 rule dao
when
   k : Customer(  ) from repFact.getCustomerRepository().findAll();
then
System.out.println( Drools +drools.getRule().getName()+: 
 +k.getName());
 end
 rule WM
when
   k : Customer(  ) ;
then
System.out.println( Drools +drools.getRule().getName()+: 
 +k.getName()+ + size: +repFact.getCustomerRepository().findAll().size());
 end
 ...
 RepositoryFactory repFact = Registry.getRepositoryFactory();
 ksession.setGlobal(repFact, repFact);
 ...
 CustomerRepository customerRepo = Registry.getRepositoryFactory()
.getCustomerRepository();
 customerRepo.add(tom);
 customerRepo.add(elise);
 customerRepo.add(bert);
 ksession.insert(bert);
 ksession.fireAllRules();

 ...
 Output:
 Drools WM: Bert + size: 3

 br,
 Els


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/global-as-link-to-DB-different-results-tp3467897p3467897.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] Turning off strict mode

2011-10-31 Thread Alexander
Hello.

Is it possible to turn off strict mode in Drools 5.2 or 5.3 like in 5.1? How
can i do it?

We use Drools 5.1 and we use lots of maps so we turned off strict mode. I
tried to switch to Drools 5.2 or 5.3 but setting
System.setProperty(drools.dialect.mvel.strict, false) doesn't work with
those versions. Our domain model is basicaly a hierarchy of Maps without
generics so using strict mode will force us to write alot of casts. This is
not acceptable cause we want our non technical guys to write some rules. One
of our goals was to make it possible to update our application without
recompiling and redeploying any java code only rules and flows, thats why we
have such domain model.

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


Re: [rules-users] rule fires several times

2011-10-31 Thread arrehman
Makes sense, pretty good explanation.

Is there a way to turn this behaviour off? I don't want the rule engine to
re-calculate the rules when I update a fact inside the rule engine. Is that
possible? The reason I ask is that in my application it makes sense based on
the way I have structured the rules and invoking drools.

Thanks,
Abdul

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


Re: [rules-users] rule fires several times

2011-10-31 Thread Wolfgang Laun
On 31 October 2011 16:41, arrehman arrehma...@yahoo.com wrote:

 Makes sense, pretty good explanation.

 Is there a way to turn this behaviour off? I don't want the rule engine to
 re-calculate the rules when I update a fact inside the rule engine. Is that
 possible?


Just don't make the engine aware of changes to your fact objects, i.e.,
omit modify/update.
-W


 The reason I ask is that in my application it makes sense based on
 the way I have structured the rules and invoking drools.


 Thanks,
 Abdul

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/rule-fires-several-times-tp3466250p3468125.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] rule fires several times

2011-10-31 Thread arrehman
I have /update()/ on consequence/action part of rules, which I can't void. I
guess there is no way and rule engine is doing the right thing then.

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


Re: [rules-users] rule fires several times

2011-10-31 Thread Wolfgang Laun
On 31 October 2011 17:06, arrehman arrehma...@yahoo.com wrote:

 I have /update()/ on consequence/action part of rules, which I can't void.


It seems to me that you are contradicting yourself. If you can't remove
update() then this means that you do need the changes to facts being
made known to the rules engine so that it can fire rules (again), due to
changes made. This is the only purpose of an update() call; changes to
the Java object are made by setter calls, as always.

-W


 I
 guess there is no way and rule engine is doing the right thing then.

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/rule-fires-several-times-tp3466250p3468183.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] global as link to DB: different results

2011-10-31 Thread Michael Anstis
I thought use of the from keyword allowed you to reason over facts
(potentially) not in WM. I believe the OP's example is mentioned in the
docs?

sent on the move

On 31 Oct 2011 15:08, Wolfgang Laun wolfgang.l...@gmail.com wrote:

 Globals cannot to be used - directly or indirectly - as objects that
 should trigger
 the firing of rules. It is only insert, modify or update, and retract that
 cause (re-)evaluation of LHS conditions.

 -W

 On 31 October 2011 15:05, elsdestickere elsdestick...@yahoo.com wrote:

 Hi,

 I read docs about global and Hibernate to access your DB from the rules.
 I tried something simular for in memory DAO's.
 But some rules fire (WM in RHS) as the DAO has 3 items, but others
 (dao
 in LHS) don't, how is that possible?

 global RepositoryFactory repFact;
 rule dao
when
   k : Customer(  ) from repFact.getCustomerRepository().findAll();
then
System.out.println( Drools +drools.getRule().getName()+: 
 +k.getName());
 end
 rule WM
when
   k : Customer(  ) ;
then
System.out.println( Drools +drools.getRule().getName()+: 
 +k.getName()+ + size:
 +repFact.getCustomerRepository().findAll().size());
 end
 ...
 RepositoryFactory repFact = Registry.getRepositoryFactory();
 ksession.setGlobal(repFact, repFact);
 ...
 CustomerRepository customerRepo = Registry.getRepositoryFactory()
.getCustomerRepository();
 customerRepo.add(tom);
 customerRepo.add(elise);
 customerRepo.add(bert);
 ksession.insert(bert);
 ksession.fireAllRules();

 ...
 Output:
 Drools WM: Bert + size: 3

 br,
 Els


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/global-as-link-to-DB-different-results-tp3467897p3467897.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] global as link to DB: different results

2011-10-31 Thread Wolfgang Laun
If the donator isn't a fact, it's not visible to the engine.

Globals are OK on the RHS and as a provider for constant (!) data used as
stand-in for literals on the LHS. Other than this: beware!

-W


2011/10/31 Michael Anstis michael.ans...@gmail.com

 I thought use of the from keyword allowed you to reason over facts
 (potentially) not in WM. I believe the OP's example is mentioned in the
 docs?

 sent on the move

 On 31 Oct 2011 15:08, Wolfgang Laun wolfgang.l...@gmail.com wrote:

 Globals cannot to be used - directly or indirectly - as objects that
 should trigger
 the firing of rules. It is only insert, modify or update, and retract
 that cause (re-)evaluation of LHS conditions.

 -W

  On 31 October 2011 15:05, elsdestickere elsdestick...@yahoo.com wrote:

 Hi,

 I read docs about global and Hibernate to access your DB from the rules.
 I tried something simular for in memory DAO's.
 But some rules fire (WM in RHS) as the DAO has 3 items, but others
 (dao
 in LHS) don't, how is that possible?

 global RepositoryFactory repFact;
 rule dao
when
   k : Customer(  ) from repFact.getCustomerRepository().findAll();
then
System.out.println( Drools +drools.getRule().getName()+: 
 +k.getName());
 end
 rule WM
when
   k : Customer(  ) ;
then
System.out.println( Drools +drools.getRule().getName()+: 
 +k.getName()+ + size:
 +repFact.getCustomerRepository().findAll().size());
 end
 ...
 RepositoryFactory repFact = Registry.getRepositoryFactory();
 ksession.setGlobal(repFact, repFact);
 ...
 CustomerRepository customerRepo = Registry.getRepositoryFactory()
.getCustomerRepository();
 customerRepo.add(tom);
 customerRepo.add(elise);
 customerRepo.add(bert);
 ksession.insert(bert);
 ksession.fireAllRules();

 ...
 Output:
 Drools WM: Bert + size: 3

 br,
 Els


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/global-as-link-to-DB-different-results-tp3467897p3467897.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] Time Window

2011-10-31 Thread diana-mendes
Hello, 

I want to implement a simple scenario using Drools, but I can't find the
right functions to do so.

I have a class named Notif that represents my events.

When I receive a Notif with a certain attribute (for example, type == A) I
want to get a list of all the events I receive in the next 10 seconds.

If I receive a second event of type A during those 10 seconds, I don't
want to start another count. It should only restart the count after the 10
seconds have expired.

Example:
1s: Notif (type==A)should start the 10 second count
2s: Notif (type==B)
3s: Notif (type==C)
4s: Notif (type==A)
5s: Notif (type==D)
12s: Notif(type==E)


10 seconds after the first Notif(type==A) I would like to receive the
following list:
Notif (type==A)
Notif (type==B)
Notif (type==C)
Notif (type==A)
Notif (type==D)

Note that Notif(type==E) (at 12 seconds) should not be in the list because
it's outside of the 10 seconds interval. Also, note that the second
Notif(type==A) (at 4 seconds) should not start a new count because it's
included in the 10 seconds interval.

Thanks in advance,

Diana

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


Re: [rules-users] Sliding Length Windows

2011-10-31 Thread diana-mendes
Thank you!

Diana

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


Re: [rules-users] global as link to DB: different results

2011-10-31 Thread Michael Anstis
H... this may be the way it works, but it's not clear from the
documentation-

The Conditional Element from enables users to specify an arbitrary source
for data to be matched by LHS patterns. This allows the engine to reason
over data not in the Working Memory. The data source could be a sub-field
on a bound variable or the results of a method call. It is a powerful
construction that allows out of the box integration with other application
components and frameworks. One common example is the integration with data
retrieved on-demand from databases using hibernate named queries.

I therefore assume ...or the results of a method call should mean ...or
the results of a method call on a Fact and the following should work:-

rule dao
  when
$cs : CustomerRepository( )
k : Customer(  ) from $cs.getCustomerService().findAll()
  then
System.out.println( Drools +drools.getRule().getName()+: 
+k.getName());
end

?

2011/10/31 Wolfgang Laun wolfgang.l...@gmail.com

 If the donator isn't a fact, it's not visible to the engine.

 Globals are OK on the RHS and as a provider for constant (!) data used as
 stand-in for literals on the LHS. Other than this: beware!

 -W



 2011/10/31 Michael Anstis michael.ans...@gmail.com

 I thought use of the from keyword allowed you to reason over facts
 (potentially) not in WM. I believe the OP's example is mentioned in the
 docs?

 sent on the move

 On 31 Oct 2011 15:08, Wolfgang Laun wolfgang.l...@gmail.com wrote:

 Globals cannot to be used - directly or indirectly - as objects that
 should trigger
 the firing of rules. It is only insert, modify or update, and retract
 that cause (re-)evaluation of LHS conditions.

 -W

  On 31 October 2011 15:05, elsdestickere elsdestick...@yahoo.comwrote:

 Hi,

 I read docs about global and Hibernate to access your DB from the rules.
 I tried something simular for in memory DAO's.
 But some rules fire (WM in RHS) as the DAO has 3 items, but others
 (dao
 in LHS) don't, how is that possible?

 global RepositoryFactory repFact;
 rule dao
when
   k : Customer(  ) from repFact.getCustomerRepository().findAll();
then
System.out.println( Drools +drools.getRule().getName()+: 
 +k.getName());
 end
 rule WM
when
   k : Customer(  ) ;
then
System.out.println( Drools +drools.getRule().getName()+: 
 +k.getName()+ + size:
 +repFact.getCustomerRepository().findAll().size());
 end
 ...
 RepositoryFactory repFact = Registry.getRepositoryFactory();
 ksession.setGlobal(repFact, repFact);
 ...
 CustomerRepository customerRepo = Registry.getRepositoryFactory()
.getCustomerRepository();
 customerRepo.add(tom);
 customerRepo.add(elise);
 customerRepo.add(bert);
 ksession.insert(bert);
 ksession.fireAllRules();

 ...
 Output:
 Drools WM: Bert + size: 3

 br,
 Els


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/global-as-link-to-DB-different-results-tp3467897p3467897.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


Re: [rules-users] rule fires several times

2011-10-31 Thread arrehman
You are right, I need to re-think what I am doing. Perhaps there is no need
for me to do the update() calls. I will post back. Thanks.

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


Re: [rules-users] Guvnor custom form not working for DSL sentences

2011-10-31 Thread GPatel
Here's the model:

declare Vehicle
engineType: String
fuelType: String
end

Here's the DSL:

[when]there is a vehicle=$vehicle : Vehicle()
[when]- with engine type {value}=engineType=={value}
[then]say hello=System.out.println(Hello);

When I create a rule using the Guided Editor the usual way (without using 
DSL sentences), the custom form does pop up, as shown in attached file 
ss1.gif. 

When I create a rule using the DSL sentence (when there is a vehicle with 
engine type {value}), the value is the usual text field. Clicking on it 
does not invoke the custom form. Please see attached file ss-dsl.gif. 

Thanks
G. Patel



From:   Michael Anstis michael.ans...@gmail.com
To: Rules Users List rules-users@lists.jboss.org
Date:   10/30/2011 03:04 PM
Subject:Re: [rules-users] Guvnor custom form not working for DSL 
sentences
Sent by:rules-users-boun...@lists.jboss.org



Can you bit a little more descriptive? I am having trouble knowing exactly 
to what part of Guvnor you refer.
sent on the move
On 30 Oct 2011 21:52, gpa...@tsys.com wrote:

Hi

Is the guvnor custom form not meant for use with fact fields appearing in
dsl sentences? It works fine with guided editor, not with dsl though.

Using 5.3.CR1

Thanks
G. Patel

-
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you
___
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

attachment: ss1.GIFattachment: ss-dsl.gif___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor custom form not working for DSL sentences

2011-10-31 Thread Michael Anstis
Is it possible for you to provide a repository export? I think I know what
you have configured but an export would help.

sent on the move

On 31 Oct 2011 20:40, gpa...@tsys.com wrote:

 Here's the model:

 declare Vehicle
 engineType: String
 fuelType: String
 end

 Here's the DSL:

 [when]there is a vehicle=$vehicle : Vehicle()
 [when]- with engine type {value}=engineType=={value}
 [then]say hello=System.out.println(Hello);

 When I create a rule using the Guided Editor the usual way (without using
 DSL sentences), the custom form does pop up, as shown in attached file
 ss1.gif.

 When I create a rule using the DSL sentence (when there is a vehicle with
 engine type {value}), the value is the usual text field. Clicking on it
 does not invoke the custom form. Please see attached file ss-dsl.gif.

 Thanks
 G. Patel



 From:Michael Anstis michael.ans...@gmail.com
 To:Rules Users List rules-users@lists.jboss.org
 Date:10/30/2011 03:04 PM
 Subject:Re: [rules-users] Guvnor custom form not working for DSL
 sentences
 Sent by:rules-users-boun...@lists.jboss.org
 --



 Can you bit a little more descriptive? I am having trouble knowing exactly
 to what part of Guvnor you refer.

 sent on the move

 On 30 Oct 2011 21:52, *gpa...@tsys.com* gpa...@tsys.com wrote:

 Hi

 Is the guvnor custom form not meant for use with fact fields appearing in
 dsl sentences? It works fine with guided editor, not with dsl though.

 Using 5.3.CR1

 Thanks
 G. Patel

 -
 The information contained in this communication (including any
 attachments hereto) is confidential and is intended solely for the
 personal and confidential use of the individual or entity to whom
 it is addressed. If the reader of this message is not the intended
 recipient or an agent responsible for delivering it to the intended
 recipient, you are hereby notified that you have received this
 communication in error and that any review, dissemination, copying,
 or unauthorized use of this information, or the taking of any
 action in reliance on the contents of this information is strictly
 prohibited. If you have received this communication in error,
 please notify us immediately by e-mail, and delete the original
 message. Thank you
 ___
 rules-users mailing list*
 **rules-users@lists.jboss.org* rules-users@lists.jboss.org*
 **https://lists.jboss.org/mailman/listinfo/rules-users*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] Live Queries and Expired Events

2011-10-31 Thread Robert Crawford
I have a live query that should match *all* the events I insert. However,
it's apparently not being called for a large number of them. It appears that
if an event is expired at the time of insert, it's not tripping the
rowRemoved part of the query.

Is this the expected behavior? If so, is there some way to catch this
condition?

Thanks!


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


Re: [rules-users] How can Drools Planner consume Guvnor generated drl file?

2011-10-31 Thread ge0ffrey
See manual, section on setRulebase() instead of scoredrl
Feel free to open a jira if bits can improve.


--
View this message in context: 
http://drools.46999.n3.nabble.com/How-can-Drools-Planner-consume-Guvnor-generated-drl-file-tp3467722p3469265.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] Help with troubleshooting rules/Drools

2011-10-31 Thread Robert Crawford
Any advice on how to troubleshoot problems? I have a fairly simple set of
rules (a couple dozen), but keep having problems with fatal exceptions. The
most recent was:

org.drools.RuntimeDroolsException: Unexpected exception executing action
org.drools.reteoo.PropagationQueuingNode$PropagateAction@1e60aa7
 at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:977)
 at
org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1231)
 at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:753)
 at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:729)
 at
org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:234)
 at
com.kroger.tempmonitor.app.service.RuleService$1.run(RuleService.java:214)
 at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.NoSuchElementException
 at java.util.LinkedList.remove(LinkedList.java:788)
 at java.util.LinkedList.removeFirst(LinkedList.java:134)
 at
org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:264)
 at
org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:357)
 at
org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:238)
 at
org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:502)
 at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:975)
 ... 6 more


No mention of a rule name, so where do I begin?

My architecture is simple: one thread ran fireUntilHalt(), other (multiple)
threads inserting objects. Should I synchronize on the session so only one
thread is inserting at a time?

There's one rule that triggers a large number of inserts, and it used to
give me problems, but I've moved those inserts into Commands and those
problems seem to have gone away.

Any advice would be welcome, no matter how basic you think it is! Thanks!


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


Re: [rules-users] Online 5.3.0 javadocs

2011-10-31 Thread Richard Calmbach

Martin A wrote:
 
 Hello,
 I'm looking for the online 5.3.0 javadocs, but can't find it... Would you
 point me to a reference?
 

I have not been able to find online (as opposed to download) javadoc for any
version of Drools after 5.1.1 either. I created an issue about that here:
https://issues.jboss.org/browse/JBRULES-3276 .

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


Re: [rules-users] Help with troubleshooting rules/Drools

2011-10-31 Thread Richard Calmbach

Robert Crawford wrote:
 
 Any advice on how to troubleshoot problems? I have a fairly simple set of
 rules (a couple dozen), but keep having problems with fatal exceptions.
 The most recent was:
 
 org.drools.RuntimeDroolsException: Unexpected exception executing action
 org.drools.reteoo.PropagationQueuingNode$PropagateAction@1e60aa7
  at
 org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:977)
  at
 org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1231)
  at
 org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:753)
  at
 org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:729)
  at
 org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:234)
  at
 com.kroger.tempmonitor.app.service.RuleService$1.run(RuleService.java:214)
  at java.lang.Thread.run(Thread.java:662)
 Caused by: java.util.NoSuchElementException
  at java.util.LinkedList.remove(LinkedList.java:788)
  at java.util.LinkedList.removeFirst(LinkedList.java:134)
  at
 org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:264)
  at
 org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:357)
  at
 org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:238)
  at
 org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:502)
  at
 org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:975)
  ... 6 more
 
 
 No mention of a rule name, so where do I begin?
 

The exception may happen during working memory operations (e.g., an insert),
so there isn't even a rule active.

Which version of Drools are you using? In my case, switching from Drools
5.2.0.Final to Drools 5.3.0.Final broke 47 of my unit tests (1 error and 46
failures). The one that now gives an error, shows this stacktrace (similar
to yours):

org.drools.RuntimeDroolsException: Unexpected exception executing action
org.drools.reteoo.PropagationQueuingNode$PropagateAction@7a9b777a
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:977)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:315)
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 com.acme.das.fraud.RulesTestBase.sendEot(RulesTestBase.java:139)
at com.acme.das.fraud.RulesTestBase.advanceTime(RulesTestBase.java:131)
at com.acme.das.fraud.RulesTestBase.advanceTime(RulesTestBase.java:135)
at
com.acme.das.fraud.RulesTest.testUdrAndThenStartCdrWithinTimeout(RulesTest.java:1061)
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.junit.internal.runners.TestMethod.invoke(TestMethod.java:66)
at org.jmock.integration.junit4.JMock$1.invoke(JMock.java:37)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:105)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:86)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:94)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:98)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:61)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:54)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
at 
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
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