[rules-users] Drools API for uploading Model JAR into package

Jervis Liu jliu at redhat.com
Sat Sep 25 03:22:07 EDT 2010


Hi, take a look into AssetFileServlet.java 
(http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/server/files/AssetFileServlet.java). 
You can send an HTTP Post request to this servelt to upload your jar. 
Just make sure you provide all parameters required by this servlet (see 
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/packages/AssetAttachmentFileWidget.java. 
The URL is sth like http://localhost:8080/drools-guvnor/asset.

Dont forget to add Basic Authentication header in your HTTP request, as 
this servlet requires authentication.

Cheers,
Jervis

Vincent Legendre wrote:
> Hi,
>
> May be you can use the WebDav part of Guvnor, just like the Eclipse 
> plugin does to synchronise files.
> But I don't know if Guvnor will then be updated automatically, or if 
> you must go into package configuration and validate.
>
> May be you can create a new servlet (or update an existing) that post 
> the jar and invoke validation in the same action.
>
>
> Le 24/09/2010 06:09, Swapnil Sawant a écrit :
>>
>> Hi,
>>
>> When we use “Upload Jar Model” option in Guvnor and then use this 
>> uploaded Fact model to create rules on Guvnor GUI, we have to 
>> “actually upload” this model JAR everytime (even when a new field is 
>> added to this Model) using Guvnor GUI.
>>
>> My question is that is there any API by which I can upload this JAR 
>> to the corresponding package without actually going to Guvnor GUI for 
>> JAR uploading?
>>
>> In Short what I want is :
>>
>> In java program, I would create Fact Model JAR dynamically. Then I 
>> wish to upload this JAR into the package through Java program 
>> (without using Upload Jar Model in Guvnor GUI). After these steps, 
>> then I would actually go to Guvnor GUI just for creation/modification 
>> of rule corresponding to uploaded JAR model.
>>
>> Are there any APIs for achieving this “uploading of Model JAR to 
>> package directly” so that I can start using it for rules 
>> creation/updation ?
>>
>> Thanks & Regards,
>>
>> Swapnil Sawant
>>
>>
>> ------------------------------------------------------------------------
>> This Email may contain confidential or privileged information for the 
>> intended recipient (s) If you are not the intended recipient, please 
>> do not use or disseminate the information, notify the sender and 
>> delete it from your system.
>>
>> ______________________________________________________________________
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>   




More information about the rules-users mailing list