Re: [rules-users] planner: when gets a solution cloned?

2013-02-27 Thread Geoffrey De Smet

  
  

Op 27-02-13 19:50, Michiel Vermandel
  schreef:


  Hi,

I think a planning solution gets cloned in two different
scenarios:
1) a better solution is found
2) the solver propagates from one solving phase to another.

Is this right?
  

Currently this is right IIRC. But mix in multi-threading for 6.1 or
6.2 and there will be more cases of cloning.

  
If so, how do I know (inside the cloneSolution() method) if the
clone is intended for a best-solution or a new working-solution?
  

Why would you need to know that? Would it alter your cloning
behavior somehow?

It's probably hackable through BestSolutionRecaller, but it will
give you a hard time when upgrading to 6.0 if you do hack it there.

  
Thanks

Michiel

  
 
-
  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] How to integrate Declarative Fact created using Guvnor in Java

2013-02-27 Thread Davide Sottara
The KnowledgeBuilder processes the declared types in a DRL file,
creating the bytecode on the fly.
When the knowledge package is added to a knowledge base, the newly
created class descriptor
(the FactType and its related components) become part of the KB and the
actual class is (re)loaded by
the KB's classloader.
Since the dynamic class is not available until runtime, the "Type"
descriptors give you a reflection-like
API to manipulate the instances. This said:

Step 1: I'd actually get **the** KB which is being used to spawn
sessions, to make sure you are using
the same classes, as loaded by the same classloader.
Step 2: The FactType also holds a reference to the loaded class, you can
get it using FactType.getDefinedClass(), if needed
Step 3: it's not really a step: it means that the next two steps (4+5)
are just an example of what you can
do now that you have the Type reference.

Best,
Davide

On 02/27/2013 03:36 PM, IPatel wrote:
> Hi,
>
> Basic questions on the facts that are created in Guvnor using New
> Declaritive Model
>
> I have the facts that are created in Guvnor which i dont have java classes
> defined. I am refering to the tutorial provided on Chapter 5 The Fact Model
> and in that it shows how to use the declarative facts from Java.
>
> I am having hard time following the steps. So i am going to layout below to
> see if my understanding is correct:
> Step 1: // get a reference to a knowledge base with a declared type:
> KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
>
> Step 2:// get the declared FactType
> FactType personType = kbase.getFactType( "PackageName",  "FactName" );
>
> Step 3:// handle the type as necessary:
> Not sure what this means
>
> Step 4:// create instances:
> Object bob = personType.newInstance(); 
>
> Step5: // set attributes values
> personType.set( bob,
> "name",
> "Bob" );
> Step 6: // insert fact into a session
> StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
>
> Step 7:ksession.insert( bob );
> Step 8:ksession.fireAllRules();
>
> I am able to understand Step 4 thru Step 8. I guess i am having trouble
> understanding step 1 and Step 3.
>
> Can someone please help me clarify or have example for me to refer.
>
>
>
>
>
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/How-to-integrate-Declarative-Fact-created-using-Guvnor-in-Java-tp4022625.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] How to integrate Declarative Fact created using Guvnor in Java

2013-02-27 Thread IPatel
Hi,

Basic questions on the facts that are created in Guvnor using New
Declaritive Model

I have the facts that are created in Guvnor which i dont have java classes
defined. I am refering to the tutorial provided on Chapter 5 The Fact Model
and in that it shows how to use the declarative facts from Java.

I am having hard time following the steps. So i am going to layout below to
see if my understanding is correct:
Step 1: // get a reference to a knowledge base with a declared type:
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();

Step 2:// get the declared FactType
FactType personType = kbase.getFactType( "PackageName",  "FactName" );

Step 3:// handle the type as necessary:
Not sure what this means

Step 4:// create instances:
Object bob = personType.newInstance(); 

Step5: // set attributes values
personType.set( bob,
"name",
"Bob" );
Step 6: // insert fact into a session
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

Step 7:ksession.insert( bob );
Step 8:ksession.fireAllRules();

I am able to understand Step 4 thru Step 8. I guess i am having trouble
understanding step 1 and Step 3.

Can someone please help me clarify or have example for me to refer.


   



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-integrate-Declarative-Fact-created-using-Guvnor-in-Java-tp4022625.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 Configuration file

2013-02-27 Thread IPatel
I got it fixed now.. Somehow my guvnor war file got corrupted.. I was trying
to locate components.xml file in the WEB_INF as indicated in Chapter 14 to
set my datasource file path. I couldn't find the xml file but my actions
messed up the file.

For now its working... but it would be nice to know where this file will be
located if it is not in WEB_INF folder

Thank you



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-Configuration-file-tp4022617p4022624.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] planner: when gets a solution cloned?

2013-02-27 Thread Michiel Vermandel
Hi,

I think a planning solution gets cloned in two different scenarios:
1) a better solution is found
2) the solver propagates from one solving phase to another.

Is this right?

If so, how do I know (inside the cloneSolution() method) if the clone is 
intended for a best-solution or a new working-solution?

Thanks

Michiel


 
-
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

Re: [rules-users] Guvnor Configuration file

2013-02-27 Thread IPatel
Hi,

So i have the datastore folder created under repository. Do you think this
is place where my rules are saved?
I think these folders were created when i first installed Guvnor. Do you
think if i re-install guvnor, this is the place it will load those rules
again?

Thank you for your prompt response



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-Configuration-file-tp4022617p4022622.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 Configuration file

2013-02-27 Thread Stephen Masters
That would let you provide a custom location, but it should have saved the 
repository files in a default location anyway. If I remember right, on a 'nix 
server, that would be under /repository/

So if you did no customisation, then a new install should pick it up there 
anyway.

Hopefully that enables you to breathe a sigh of relief… :)


On 27 Feb 2013, at 16:38, IPatel  wrote:

> Thank you for your response...
> 
> Reading your post, i had an "ah -ha" moment. Couple of days ago i was
> reviewing chapter 14 - database configuration (link provided below) but
> didn't understand it very well. Now i get it. I should have followed 14.1
> section of making changes to components.xml file to include the file-system
> path so that when my guvnor crashed, reinstall would have picked it up...
> 
> http://docs.jboss.org/drools/release/5.2.0.Final/drools-guvnor-docs/html/chap-database_configuration.html#d0e2028
> 
> Am I understanding this correctly??
> 
> 
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Guvnor-Configuration-file-tp4022617p4022619.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


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


[rules-users] Guvnor JBoss 7 Authentication

2013-02-27 Thread rjr201
Hi,

I'm having some problems getting user authentication working with Guvnor on
JBoss AS 7.

I have this in beans.xml: 





  


   
jaasAuthenticator



  

  


other
  


  
  
  

   
true
  

And I've created the following files on Guvnors class path:

roles.properties: 

admin=admin 

users.properties 

admin=admin 

This initially gave me a '401 This user has no permissions setup.' error. So
I followed this post: 

http://drools.46999.n3.nabble.com/How-configure-Guvnor-5-4-JAAS-with-jboss-7-0-2-td4020424.html#a4020854

And changed the /SecurityServiceImpl.java file as suggested (not sure if
this was the right thing to do or not, but it got rid of the error). However
now it gives me "incorrect username/password" regardless of what I enter. 

Has anyone had any success with this, or can see where I'm going wrong? I
feel like I'm really close but can't work out this last step. 

As always, thanks for any help anyone can give. 

Rich. 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-JBoss-7-Authentication-tp4022620.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 Configuration file

2013-02-27 Thread IPatel
Thank you for your response...

Reading your post, i had an "ah -ha" moment. Couple of days ago i was
reviewing chapter 14 - database configuration (link provided below) but
didn't understand it very well. Now i get it. I should have followed 14.1
section of making changes to components.xml file to include the file-system
path so that when my guvnor crashed, reinstall would have picked it up...

http://docs.jboss.org/drools/release/5.2.0.Final/drools-guvnor-docs/html/chap-database_configuration.html#d0e2028

Am I understanding this correctly??



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-Configuration-file-tp4022617p4022619.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 Configuration file

2013-02-27 Thread Stephen Masters
I take it you hand't performed an export of your rules recently which you could 
restore?

Assuming that you didn't set up a database for storage of your rules, then you 
should be able to find a directory called "repository" somewhere on the 
filesystem of your server. So re-installing Guvnor or the web server is likely 
to just pick up that location by default.


On 27 Feb 2013, at 15:15, IPatel  wrote:

> Hi all,
> 
> Somehow starting yesterday Guvnor won't start. I can see no exceptions in my
> log file except that the last link it executes and gets stuck at is
> following:
> 
> ..."Brontes" started in 2853ms - Started 133 of 208 services <74 services
> are passive or on-demand>
> 
> now i have a POC demo next week and i was wondering if guvnor has a way to
> store somewhere the rules/packages i created  and i can restore them.  I
> will install the tool again and import the rules/packages. This way I dont
> have to re-create them again.
> 
> All your help will be greatly appreciated.
> 
> 
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Guvnor-Configuration-file-tp4022617.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


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


[rules-users] Guvnor Configuration file

2013-02-27 Thread IPatel
Hi all,

Somehow starting yesterday Guvnor won't start. I can see no exceptions in my
log file except that the last link it executes and gets stuck at is
following:

..."Brontes" started in 2853ms - Started 133 of 208 services <74 services
are passive or on-demand>

now i have a POC demo next week and i was wondering if guvnor has a way to
store somewhere the rules/packages i created  and i can restore them.  I
will install the tool again and import the rules/packages. This way I dont
have to re-create them again.

All your help will be greatly appreciated.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-Configuration-file-tp4022617.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] Bad Gateway at http://www.jboss.org/drools

2013-02-27 Thread Geoffrey De Smet
Forwarded to our internal jboss.org team.
Thanks for reporting.

Op 27-02-13 14:15, Syargey schreef:
> I can't access  http://www.jboss.org/drools 
> for two days :-(
>
> The error message is sjown:
>
>
> Bad Gateway
>
> We're experiencing a problem with one of the servers behind our gateway.
>
> Please try again in a while.
>
>
>
>
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Bad-Gateway-at-http-www-jboss-org-drools-tp4022614.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] GC Overhead Limit Exceeded and 1B JoinLeftNode Objects

2013-02-27 Thread Julian Klein
I wanted to circle back before this thread gets too far off the original
topic and folks searching in the future don't get confused.  I am still
confused between the 'or' and '||' as explained here and in the
documentation.  I will attempt to review this in more detail.  In the
meantime, I have simplified my rules per the above comments and am able to
run them with about 10M facts in under 3 hours.  The system required more
than 40GB of RAM.  I am chunking the data and running multiple threads.  I
will look to reduce the overhead where possible as I am certain their are
further improvements that can be made.  Once I complete out my refactoring
and reviews, I'll circle back again.  Needless to say, things have moved in
a very positive direction.  I am not sure what memory expectations I should
have so I'll take a complete run in this timeframe without errors as a win.

Thank you, Wolgang and Mark.  You guys have been fantastic!


On Mon, Feb 25, 2013 at 3:13 AM, Mark Proctor  wrote:

>
> On 25 Feb 2013, at 06:46, Wolfgang Laun  wrote:
>
> > On 24/02/2013, Mark Proctor  wrote:
> >
> >>>when
> >>>  $sv1 : SiteVisit( yearRecorded == durationCycleYear, !annualVisit
> )
> >>>  FaultCode( $sv1.ID==svID, code matches "366.\\d+|743.3\\d?" )
> >>>  $inspector: Insepector (ID == $sv1.insepectortID)
> >>>
> >>>  $sv2 : SitVisit( yearRecorded == durationCycleYear, !annualVisit )
> >>>  #make sure we are dealing with the same inspector
> >>>  Inspector (ID == $sv2.inspectorID, EUID == $inspector.EUID)
> >>>
> >>>  ( FaultCode( $sv2.ID == svID, code matches "45.61" ) or
> >>>  ServiceCode($sv2.ID == svID, code matches
> >>> "66(8[4-9][0-9]|9([0-3][0-9]|40))|66982|66984|66983" ) )
> >>>
> >> same here
> >>
> >> Are you sure you want 'or' and not ||.
> >
> > Mark, how would you suggest to avoid 'or' and use '||' (and I don't
> > mean the deprecated alternative to 'or')? You are beginning to confuse
> > (even) me!
> Many people do not want CE 'or' they want infix '||' used in compound
> expressions. I later clarified the difference in the follow up email.
>
> Mark
> >
> > -W
> >
> >> The 'or' CE can result in two rules
> >> firing, if they are not mutually exclusive logical conditions.
> > ___
> > 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] Bad Gateway at http://www.jboss.org/drools

2013-02-27 Thread Syargey
I can't access  http://www.jboss.org/drools   
for two days :-(

The error message is sjown:


Bad Gateway

We're experiencing a problem with one of the servers behind our gateway.

Please try again in a while.





--
View this message in context: 
http://drools.46999.n3.nabble.com/Bad-Gateway-at-http-www-jboss-org-drools-tp4022614.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 to pass variables to a drools rule file?

2013-02-27 Thread Wolfgang Laun
This is yet another MVEL bug, as it appears to fail to handle package
visibility correctly.

Put Qos into a .java file of its own in any package, precede class by
"public" and use a proper import in the .drl.

You can omit the import if the package of the Java class and the .drl
is the same.

-W



On 27/02/2013, FrankVhh  wrote:
> It is looking for com.sample.Qos. Try to add the import statement
> test.java.Qos somewhere on top of your file.
>
> Regards,
> Frank
>
>
> penny wrote
>> Hi,there.I have a class in test.java file.It looks like:
>> class Qos{
>>  boolean S;
>>  boolean W;
>>  Qos(){
>>  S = true;
>>  W = false;
>>  }
>>  public boolean getS(){
>>  return S;
>>  }
>>  public boolean getW(){
>>  return W;
>>  }
>> }
>>
>> Now I want to use the Qos class in my rule file like this:
>> rule "rule1"
>>  ruleflow-group "myRules"
>>  salience 4
>> when
>> //conditions
>> $qos:Qos(S==true && W==true);
>> then
>>System.out.println("rule1");  
>> end
>>
>> But here is an error.
>> [Error: could not access field: com.sample.Qos.S]
>> [Near : {... S == true }]
>>  ^
>> [Line: 1, Column: 1]
>>
>> How can I do?
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-pass-variables-to-a-drools-rule-file-tp4022607p4022608.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 pass variables to a drools rule file?

2013-02-27 Thread FrankVhh
It is looking for com.sample.Qos. Try to add the import statement
test.java.Qos somewhere on top of your file.

Regards,
Frank


penny wrote
> Hi,there.I have a class in test.java file.It looks like:
> class Qos{
>   boolean S;
>   boolean W;
>   Qos(){
>   S = true;
>   W = false;
>   }
>   public boolean getS(){
>   return S;
>   }
>   public boolean getW(){
>   return W;
>   }
> }
> 
> Now I want to use the Qos class in my rule file like this:
> rule "rule1"
>   ruleflow-group "myRules"
>   salience 4
> when
> //conditions
> $qos:Qos(S==true && W==true);
> then
>System.out.println("rule1");   
> end
> 
> But here is an error.
> [Error: could not access field: com.sample.Qos.S]
> [Near : {... S == true }]
>  ^
> [Line: 1, Column: 1]
> 
> How can I do?





--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-pass-variables-to-a-drools-rule-file-tp4022607p4022608.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