Java API Call to Insert a Rule in DRL File

177 views
Skip to first unread message

Wigglesworth Moses

unread,
Apr 6, 2023, 4:08:50 AM4/6/23
to Drools Usage
Hi All,
I need to Insert a Rule Created in Runtime in the Existing DRL File (available in KIE Server) using Java API Call.
I have got an approach to do the same which is specified below
1.Create a Rule in Runtime
2.Load the DRL File from  KIE  Server
3.Update the DRL File (By adding the rule created in the existing DRL File) in KIE Server

Kindly Check and confirm whether the Above Approach is achievable.

Note :
1.I need to do the Same for the CRUD Operations from my Application to KIE Server
using Java API Call.

2.The DRL File must be available only in the KIE Server but not in my Project Directory.

I have specified the maven dependencies used in my project related to drools and KIE Server

1.kie-server-client-7.73.0.Final
2.kie-api-7.73.0.Final

Thanks in Advance for the Reply

Regards,
Wigglesworth

Rhett S

unread,
Apr 13, 2023, 9:22:36 PM4/13/23
to drools...@googlegroups.com
the way I've seen this done, is by updating the DRL file, building a new kjar. then, have your custom drools application load the new jkar at execution time. we call this 'hotswapping kjars'
it can also be done by restarting your container (in kubernetes: kubectl rollout restart). at restart, the updated external kjar is loaded to memory.
Rhett

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/54d4d29f-6b2e-4072-a772-84a63232c78en%40googlegroups.com.

Wigglesworth Moses

unread,
Apr 14, 2023, 12:04:18 AM4/14/23
to drools...@googlegroups.com
Rhett S,
Thanks for the Reply.I do have some doubts.I have listed below

1.Is there any way  to insert , update , delete and read the rules into / from the drl/decision table in run time which is available in jbpm server?

2.Can we automate the process of Uploading a decision table/drl file at run time from our local directory to jbpm server where my drools project is available?

3.Can we automate the process of Building and Deploying Drools project which is located at the jbpm server at run time?

4.multiple users wants to insert multiple rule in a single drl/decision table in jbpm server at the same time, Can this be done in ease?

5.Can we pass an action from a drl/decision table as a condition to another drl/decision table?

6.I need to read and fetch rules from drl/decision table which is available in jbpm server.Is there any way that I get the conditions and actions of all rules?

7.Can Drools Replace Database i.e can it perform crud operation,etc... In run time and from remote server?


Thanks in advance for your reply.....

Regards,
Wigglesworth 



Wigglesworth Moses

unread,
Apr 14, 2023, 2:15:54 PM4/14/23
to drools...@googlegroups.com
Dear Rhett,
Note :
Query 1 to 3 and 5 needs to be done programmatically(Java,Shellscripting)

Query 4 needs to be done from my application UI

Query 6,7 is general


Thanks in advance for your guidance

Regards,
Wigglesworth 

Richa Singh

unread,
Apr 20, 2023, 11:31:16 AM4/20/23
to Drools Usage
Dear Rhett,

Your Kubernetes solution is very interesting. We have a similar use case where we are generating a drool file and creating a kjar and pushing it via maven to docker container in Azure.
There are couple of issues we are struggling with :
1. Security vulnerabilities in the kie libraries
2. Scanner not loading the jar.

Will it be possible to share your docker file 

thanks
Richa
Reply all
Reply to author
Forward
0 new messages