Including repository in a WAR file

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Including repository in a WAR file

ilguapo
I'm using Drools 5.3.0


I'd like to find out if the following scenario is possible:

- Include the repository_export.zip file inside my application WAR file.  This way, Guvnor won't be necessary.
- Provide a special upload page just like Guvnor's Import/Export to upload a completely new repository_export.zip file when rules have changed.

I haven't been able to find a way to read a repository_export.zip file with the current API.  They only talk about drl, pkg, etc..etc but no zip files.  I could potentially take the zip file, unzip it to an XML and maybe read this file??

Any ideas would be really helpful.

Regards,
Ilguapo
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Including repository in a WAR file

salaboy
Hi,
I don't think that it will be possible the repository is a JCR repository in 5.3, so there is no point in storing all the meta information from the repository if the only thing you need are the rules. You can always ship the rules inside the web application, provide a way to upload new rules when needed and regenerate the sessions using the new rules. 
Why do you want to have all the repo?


On Wed, Jul 23, 2014 at 1:55 AM, ilguapo <[hidden email]> wrote:
I'm using Drools 5.3.0


I'd like to find out if the following scenario is possible:

- Include the repository_export.zip file inside my application WAR file.
This way, Guvnor won't be necessary.
- Provide a special upload page just like Guvnor's Import/Export to upload a
completely new repository_export.zip file when rules have changed.

I haven't been able to find a way to read a repository_export.zip file with
the current API.  They only talk about drl, pkg, etc..etc but no zip files.
I could potentially take the zip file, unzip it to an XML and maybe read
this file??

Any ideas would be really helpful.

Regards,
Ilguapo



--
View this message in context: http://drools.46999.n3.nabble.com/Including-repository-in-a-WAR-file-tp4030450.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



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Including repository in a WAR file

Toni Rikkola-2
In reply to this post by ilguapo
This is possible, but you will need to add the ability to compile the
repository_export.zip. This means you need to reuse a lot of the Guvnor
codes for resolving enums, package imports, guided rules and so on.  

If I guess our needs correctly. You are better taking a different
approach. Build the repository using Guvnor and then add the import
function for Drools packages. This way you only need the Drools core in
your own application for running these packages and updating them is
easy.

Toni Rikkola

On ti, 2014-07-22 at 17:55 -0700, ilguapo wrote:

> I'm using Drools 5.3.0
>
>
> I'd like to find out if the following scenario is possible:
>
> - Include the repository_export.zip file inside my application WAR file.
> This way, Guvnor won't be necessary.
> - Provide a special upload page just like Guvnor's Import/Export to upload a
> completely new repository_export.zip file when rules have changed.
>
> I haven't been able to find a way to read a repository_export.zip file with
> the current API.  They only talk about drl, pkg, etc..etc but no zip files.
> I could potentially take the zip file, unzip it to an XML and maybe read
> this file??
>
> Any ideas would be really helpful.
>
> Regards,
> Ilguapo
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Including-repository-in-a-WAR-file-tp4030450.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
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Including repository in a WAR file

ilguapo
Thank you for replying Toni and Salaboy.

This is the reason why we want to do that:

-We already have an application that uses Guvnor in production.  The problem is Guvnor is hosted on a different machine which we are losing therefore we thought about an idea of completely eliminating Guvnor by including the repository in the WAR so that we could read it the first time the application starts.  As you know, this is being done by pointing to the Guvnor URL at this time.

-We actually wanted to leave Guvnor in the dev environment so that developers could add more rules to the application whenever necessary by providing an Import feature to read the repository_export.zip file into the application to replace the old repository.

-If we do this, we will only need Guvnor in the dev environment which is controlled by us and will be eliminated from all other environments. (Will reduce a lot of paper work at a government site)

I like Toni's idea of building the repository using Guvnor in the dev environment but how do you read the repository the first time the app starts?  This is done now by getting the package from Guvnor thru a URL.  That was the only reason to store the repository inside the WAR file so that the rules could be read at initialization time.

Any pointers would be really appreciated especially how to update the package which according to Toni is easy :-)

Regards,
Ilguapo



Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Including repository in a WAR file

salaboy
You can build the PKGs in guvnor and then just move the PKGs to a accesible server by the app that will load the rules in those packages. That will do the work IMO.

Regards


On Wed, Jul 23, 2014 at 2:39 PM, ilguapo <[hidden email]> wrote:
Thank you for replying Toni and Salaboy.

This is the reason why we want to do that:

-We already have an application that uses Guvnor in production.  The problem
is Guvnor is hosted on a different machine which we are losing therefore we
thought about an idea of completely eliminating Guvnor by including the
repository in the WAR so that we could read it the first time the
application starts.  As you know, this is being done by pointing to the
Guvnor URL at this time.

-We actually wanted to leave Guvnor in the dev environment so that
developers could add more rules to the application whenever necessary by
providing an Import feature to read the repository_export.zip file into the
application to replace the old repository.

-If we do this, we will only need Guvnor in the dev environment which is
controlled by us and will be eliminated from all other environments. (Will
reduce a lot of paper work at a government site)

I like Toni's idea of building the repository using Guvnor in the dev
environment but how do you read the repository the first time the app
starts?  This is done now by getting the package from Guvnor thru a URL.
That was the only reason to store the repository inside the WAR file so that
the rules could be read at initialization time.

Any pointers would be really appreciated especially how to update the
package which according to Toni is easy :-)

Regards,
Ilguapo







--
View this message in context: http://drools.46999.n3.nabble.com/Including-repository-in-a-WAR-file-tp4030450p4030458.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



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Including repository in a WAR file

ilguapo
Hola Salaboy!

Thanks for your last comment.  I was busy with other stuff but now I'm back with this problem and would like to ask if this scenario would work in your opinion.

The repository_export.zip file is stored on Subversion.  Is there a maven plug-in that will take that file, convert it to an XML file and then compile this file into a PKG file?  After that, we can move that file to a certain area inside the WAR file and then your idea works.

Later for rule changes, a GUI will be provided where they can upload a new PKG file to replace the old rules.

Any ideas will be appreciated.

Muchas gracias!
Horacio


On Jul 23, 2014, at 5:47 PM, salaboy [via Drools] <[hidden email]> wrote:

You can build the PKGs in guvnor and then just move the PKGs to a accesible server by the app that will load the rules in those packages. That will do the work IMO.

Regards


On Wed, Jul 23, 2014 at 2:39 PM, ilguapo <<a href="x-msg://11/user/SendEmail.jtp?type=node&amp;node=4030466&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]> wrote:
Thank you for replying Toni and Salaboy.

This is the reason why we want to do that:

-We already have an application that uses Guvnor in production.  The problem
is Guvnor is hosted on a different machine which we are losing therefore we
thought about an idea of completely eliminating Guvnor by including the
repository in the WAR so that we could read it the first time the
application starts.  As you know, this is being done by pointing to the
Guvnor URL at this time.

-We actually wanted to leave Guvnor in the dev environment so that
developers could add more rules to the application whenever necessary by
providing an Import feature to read the repository_export.zip file into the
application to replace the old repository.

-If we do this, we will only need Guvnor in the dev environment which is
controlled by us and will be eliminated from all other environments. (Will
reduce a lot of paper work at a government site)

I like Toni's idea of building the repository using Guvnor in the dev
environment but how do you read the repository the first time the app
starts?  This is done now by getting the package from Guvnor thru a URL.
That was the only reason to store the repository inside the WAR file so that
the rules could be read at initialization time.

Any pointers would be really appreciated especially how to update the
package which according to Toni is easy :-)

Regards,
Ilguapo







--
View this message in context: http://drools.46999.n3.nabble.com/Including-repository-in-a-WAR-file-tp4030450p4030458.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
<a href="x-msg://11/user/SendEmail.jtp?type=node&amp;node=4030466&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
<a href="x-msg://11/user/SendEmail.jtp?type=node&amp;node=4030466&amp;i=2" target="_top" rel="nofollow" link="external">[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/Including-repository-in-a-WAR-file-tp4030450p4030466.html
To unsubscribe from Including repository in a WAR file, click here.
NAML