Re: [rules-users] Rule storage

2011-03-28 Thread Mauricio Salatino
Hi there.. I think that there is directory called repository that it's
created using JCR to store all your knowledge assets.
Take a look inside your container directory structure to see if you can find
it. Guvnor also allows you to connect to the repository using web dav, so
you can basically browse your knowledge assets using that.

Greetings.

On Mon, Mar 28, 2011 at 6:42 AM, FrankVhh wrote:

> Hi all,
>
> This may be a stupid question, but is there a way to see your Guvnor-rules
> outside Guvnor in some kind of readable file?
>
> I noticed jackrabbit is used as a repository, so I would like to have a
> look
> in there, but I am not able to find it in the expanded guvnor.war folder.
>
> The version I am using is Guvnor 5.1.1, with standard configuration.
>
> A look in the Guvnor documentation did not help me out. Feel free to burn
> me
> if I missed it :-)
>
> Thanks and regards,
> Frank
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2742515.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



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

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


Re: [rules-users] Rule storage

2011-03-28 Thread FrankVhh
Hi,

Thanks for your quick reply, Salaboy.

Webdav indeed allow me to browse through the packages and I was able to
locate a file mortgage-sample-repository.xml in the folder WEB-INF/classes
of drools-fuvnor.war.

However, changes in the xml did not show up in Guvnor and vice versa. So,
jackrabbit has to store its contents somewhere else. The folder "repository"
only consists of class-files.

The reason I am looking for this file, is because I am looking for ways to
simultaneously update multiple rule parameters, without adding a new rule to
the ruleset. F.e. we want all base prices of our beverages to increase by
5%.

It would be as if you run an sql update statement on a "rule database".
You'll probably need to parse the drl to achieve this.

Regards,
Frank

--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743044.html
Sent from the Drools - User 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 storage

2011-03-28 Thread Michael Anstis
mortgage-sample-repository.xml is the example repository installed into
Guvnor when you first deploy (and answer "yes" to the install examples
prompt).

Changing this XML will therefore have no effect, unless you re-import the
XML too using the Administration functions in Guvnor.

In order to achieve what you state you'd need to (a) use the JCR API to
query the underlying datastore, (b) re-build your binary rule package. We
don't provide a bulk update facility.

Given your example would it be not best to have Beverages themselves as
Facts and have rules that set their prices?

Think of the Rules Engine as a RDBMS and the Facts as records.

With kind regards,

Mike

On 28 March 2011 14:09, FrankVhh  wrote:

> Hi,
>
> Thanks for your quick reply, Salaboy.
>
> Webdav indeed allow me to browse through the packages and I was able to
> locate a file mortgage-sample-repository.xml in the folder WEB-INF/classes
> of drools-fuvnor.war.
>
> However, changes in the xml did not show up in Guvnor and vice versa. So,
> jackrabbit has to store its contents somewhere else. The folder
> "repository"
> only consists of class-files.
>
> The reason I am looking for this file, is because I am looking for ways to
> simultaneously update multiple rule parameters, without adding a new rule
> to
> the ruleset. F.e. we want all base prices of our beverages to increase by
> 5%.
>
> It would be as if you run an sql update statement on a "rule database".
> You'll probably need to parse the drl to achieve this.
>
> Regards,
> Frank
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743044.html
> Sent from the Drools - User 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 storage

2011-03-28 Thread FrankVhh
Hi,

Tx agaiin for the clarification on the .xml file. It makes a lot more sense,
now.

Bulk update is indeed not provided, I was hoping to have a look at the way
the rules were stored (probably plain drl, or isn't it?) to assess what
effort a bulk update would take.

If you mean by your last statement to have rules that set the initial base
price, and afterwards add rules to modify the base price (when beverage(),
then b.augmentBasePrice(5)), I absolutely agree it is the best solution,
implementation-wise.

Regarding rule management and governance, there are a few issues that might
arise.
 1) It is more difficult to get a view on your base prices
 2) What if base prices are adapted manually to the desired level? Which
"adaptation rules" need to be deleted or changed?

I am not saying that this should be basic functionality of a brms, neither
am I very fond of the requirement myself. As it shifts the burden of work
from the business to the more technical people :-)

Regards,
Frank


manstis wrote:
> 
> mortgage-sample-repository.xml is the example repository installed into
> Guvnor when you first deploy (and answer "yes" to the install
> examples
> prompt).
> 
> Changing this XML will therefore have no effect, unless you re-import the
> XML too using the Administration functions in Guvnor.
> 
> In order to achieve what you state you'd need to (a) use the JCR API to
> query the underlying datastore, (b) re-build your binary rule package. We
> don't provide a bulk update facility.
> 
> Given your example would it be not best to have Beverages themselves as
> Facts and have rules that set their prices?
> 
> Think of the Rules Engine as a RDBMS and the Facts as records.
> 
> With kind regards,
> 
> Mike
> 
> On 28 March 2011 14:09, FrankVhh 
> wrote:
> 
> > Hi,
> >
> > Thanks for your quick reply, Salaboy.
> >
> > Webdav indeed allow me to browse through the packages and I was able
> to
> > locate a file mortgage-sample-repository.xml in the folder
> WEB-INF/classes
> > of drools-fuvnor.war.
> >
> > However, changes in the xml did not show up in Guvnor and vice versa.
> So,
> > jackrabbit has to store its contents somewhere else. The folder
> > "repository"
> > only consists of class-files.
> >
> > The reason I am looking for this file, is because I am looking for
> ways to
> > simultaneously update multiple rule parameters, without adding a new
> rule
> > to
> > the ruleset. F.e. we want all base prices of our beverages to
> increase by
> > 5%.
> >
> > It would be as if you run an sql update statement on a "rule
> database".
> > You'll probably need to parse the drl to achieve this.
> >
> > Regards,
> > Frank
> >
> > --
> > View this message in context:
> >
> http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743044.html
> > Sent from the Drools - User 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
> 


--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743373.html
Sent from the Drools - User 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 storage

2011-03-28 Thread Michael Anstis
Hi Frank,

The rules are, on the whole, stored as XML (RuleModel passed through
XStream). See a previous exchange of emails on this forum about RuleModel,
it might prove useful.

However this is how we hand Rule persistence off to JCR; which in turn
stores it in another, lets say, internal format. Unfortunately I've not ran
JCR against a database to know what the resulting tables look like.

A colleague suggested use of DSL might help as you'd only need update the
DSL and recompile all rules. Might be worth a look?

Otherwise, using the REST API, or WEBDAV (not sure if it's more limited) to
retrieve a list of rules that can then be iterated and updated before
writing back might be the best option :(

With kind regards,

Mike

On 28 March 2011 15:37, FrankVhh  wrote:

> Hi,
>
> Tx agaiin for the clarification on the .xml file. It makes a lot more
> sense,
> now.
>
> Bulk update is indeed not provided, I was hoping to have a look at the way
> the rules were stored (probably plain drl, or isn't it?) to assess what
> effort a bulk update would take.
>
> If you mean by your last statement to have rules that set the initial base
> price, and afterwards add rules to modify the base price (when beverage(),
> then b.augmentBasePrice(5)), I absolutely agree it is the best solution,
> implementation-wise.
>
> Regarding rule management and governance, there are a few issues that might
> arise.
> 1) It is more difficult to get a view on your base prices
> 2) What if base prices are adapted manually to the desired level? Which
> "adaptation rules" need to be deleted or changed?
>
> I am not saying that this should be basic functionality of a brms, neither
> am I very fond of the requirement myself. As it shifts the burden of work
> from the business to the more technical people :-)
>
> Regards,
> Frank
>
>
> manstis wrote:
> >
> > mortgage-sample-repository.xml is the example repository installed into
> > Guvnor when you first deploy (and answer "yes" to the install
> > examples
> > prompt).
> >
> > Changing this XML will therefore have no effect, unless you re-import the
> > XML too using the Administration functions in Guvnor.
> >
> > In order to achieve what you state you'd need to (a) use the JCR API to
> > query the underlying datastore, (b) re-build your binary rule package. We
> > don't provide a bulk update facility.
> >
> > Given your example would it be not best to have Beverages themselves as
> > Facts and have rules that set their prices?
> >
> > Think of the Rules Engine as a RDBMS and the Facts as records.
> >
> > With kind regards,
> >
> > Mike
> >
> > On 28 March 2011 14:09, FrankVhh 
> > wrote:
> >
> > > Hi,
> > >
> > > Thanks for your quick reply, Salaboy.
> > >
> > > Webdav indeed allow me to browse through the packages and I was able
> > to
> > > locate a file mortgage-sample-repository.xml in the folder
> > WEB-INF/classes
> > > of drools-fuvnor.war.
> > >
> > > However, changes in the xml did not show up in Guvnor and vice
> versa.
> > So,
> > > jackrabbit has to store its contents somewhere else. The folder
> > > "repository"
> > > only consists of class-files.
> > >
> > > The reason I am looking for this file, is because I am looking for
> > ways to
> > > simultaneously update multiple rule parameters, without adding a new
> > rule
> > > to
> > > the ruleset. F.e. we want all base prices of our beverages to
> > increase by
> > > 5%.
> > >
> > > It would be as if you run an sql update statement on a "rule
> > database".
> > > You'll probably need to parse the drl to achieve this.
> > >
> > > Regards,
> > > Frank
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743044.html
> > > Sent from the Drools - User 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
> >
>
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743373.html
> Sent from the Drools - User 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 storage

2011-03-28 Thread FrankVhh
Mike,

Thanks again for your swift reply.

I have one more question, though :-) What do you mean by "only need to
update DSL"? I really don't get this. Imo, DSL are just rules with a shirt
on.

Regards,
Frank

--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743501.html
Sent from the Drools - User 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 storage

2011-03-28 Thread Michael Anstis
I think the view would have been if rules used DSL like "There is a priced
beverage=Beverage( $p : price > 200)" then you could change the "200" to
something else and all rules using the DSL would automagically change.

My colleague, who is choosing to remain silent here ;), also had the good
idea that an export is only XML, that you could parse and update before
re-importing; however you'd loose all your history.

Cheers,

Mike

On 28 March 2011 16:09, FrankVhh  wrote:

> Mike,
>
> Thanks again for your swift reply.
>
> I have one more question, though :-) What do you mean by "only need to
> update DSL"? I really don't get this. Imo, DSL are just rules with a shirt
> on.
>
> Regards,
> Frank
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743501.html
> Sent from the Drools - User 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 storage

2011-03-28 Thread Tihomir Surdilovic
Sorry I am the "silent partner" in this - as Michael said if you use the 
a dsl and its "then" scope expression in your rules, a change to the dsl 
like for example:


[then] Augment {var} price = ${var}.price += 5
to
[then] Augment {var} price = ${var}.price += 10

would be considered a global change across all rules using this dsl in 
your package that use that expression.


You could as Michael also said make direct changes in your exported 
repository.xml and then import it back to Guvnor, but you will loose 
version history and would need to re-import all for fact model jars and 
any other assets that are not text so this is not recommended ;)


Thanks.
Tihomir




On 3/28/11 11:22 AM, Michael Anstis wrote:
I think the view would have been if rules used DSL like "There is a 
priced beverage=Beverage( $p : price > 200)" then you could change the 
"200" to something else and all rules using the DSL would 
automagically change.


My colleague, who is choosing to remain silent here ;), also had the 
good idea that an export is only XML, that you could parse and update 
before re-importing; however you'd loose all your history.


Cheers,

Mike

On 28 March 2011 16:09, FrankVhh > wrote:


Mike,

Thanks again for your swift reply.

I have one more question, though :-) What do you mean by "only need to
update DSL"? I really don't get this. Imo, DSL are just rules with
a shirt
on.

Regards,
Frank

--
View this message in context:

http://drools-java-rules-engine.46999.n3.nabble.com/Rule-storage-tp2742515p2743501.html
Sent from the Drools - User 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] Rule storage

2011-03-29 Thread FrankVhh
Hi all,

Thanks for your inputs Manstis and Mister X. Out of pure gratitude, I will
make sure your name remains unspoken :-).

This is my second attempt to write a reply, some weird thing happened during
the previous one. I hope it does not suddenly show up on the message board.

There surely is something in the DSL approach. Using DSL that way, you
copuld actually replace variables by a possibly more flexible alternative.

However, there are some drawbacks as well, as there will still be some
manageablility issues. Suppose prices go up by 5% in year X and by another
2% in year Y. This would mean you have to do some calculations in order to
get your DSL straight. Also, you would need to know which groups could be
bulk updated in the future. If there are some corss-overs, that might
complicate things as well.

Providing you can control versioning, I guess a more direct approach might
be the way to go.

But no need to worry about that, you helped me a lot gaining more insight,
especially the silent one.

Thanks,
Frank  

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