Drools - Rule Engine Integration with Spring framework | java Techie

  Рет қаралды 93,003

Java Techie

Java Techie

5 жыл бұрын

This video will explain you how to integrate Drool Rule engine with Spring Boot application , where we can separate our rules from business logic
#SpringBoot #Drools #RuleEngine
GitHub:
github.com/Java-Techie-jt/spr...
Blogs:
javagyanmantra.wixsite.com/we...
Facebook:
/ 919464521471923
guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie

Пікірлер: 158
@amitrofanov82
@amitrofanov82 3 жыл бұрын
Thank you, Indian colleague. Fast and easy to get explaination of the Concept and Spring integration example.
@Javatechie
@Javatechie 3 жыл бұрын
Thanks Alex
@iamsreekanth
@iamsreekanth 4 жыл бұрын
Very good explanation and showed all steps. Thank you.
@nileshdongre5794
@nileshdongre5794 3 жыл бұрын
Easy to understand and very helpful. Thanks
@br4676
@br4676 5 жыл бұрын
very nice sir, thanks for your time for all this, god bless you .
@bratwurstfan
@bratwurstfan 4 жыл бұрын
Thanks! Very clear and in a nutshell
@siyedyoussef3202
@siyedyoussef3202 5 жыл бұрын
Thanks very much for the video Sir 👍👍👍
@sarojsahoo8763
@sarojsahoo8763 5 жыл бұрын
Thank u so much dude for the awesome content
@trhoangdat
@trhoangdat 2 жыл бұрын
thank you, very helpful and informative
@arvinttrigger4501
@arvinttrigger4501 3 жыл бұрын
This guy is a genius ✨
@AlexSouzaSD
@AlexSouzaSD 3 жыл бұрын
Thanks...you've helped me a lot!
@voiceguy554
@voiceguy554 3 жыл бұрын
Thanks Bud! Much Appreciated!
@sweetysparkles1866
@sweetysparkles1866 4 жыл бұрын
Very clear. thank you
@abhinavkumar2038
@abhinavkumar2038 Жыл бұрын
Really helpful . Thanks much !!
@hix0071
@hix0071 4 жыл бұрын
Good work. Keep it up.
@ankittiwary3712
@ankittiwary3712 5 жыл бұрын
Hi sir we need more videos on micro services and kindly upload videos on real time payment integeration like instamojo or razorpay using spring boot as backend
@surendrabisht2523
@surendrabisht2523 2 жыл бұрын
very clear explanation.
@Lumary
@Lumary 4 жыл бұрын
very helpful! :)
@rajeshbongurala8491
@rajeshbongurala8491 3 жыл бұрын
Thanks Buddy... Time saved... Add lombok dependency o avoid setter and getters code
@user-gj2yd6fl8y
@user-gj2yd6fl8y 7 ай бұрын
Thanks Bro, you are awesome!
@veerapavakumarbandi
@veerapavakumarbandi 4 жыл бұрын
Nice video, explain very well with good example, if you don't mind can you provide live example
@parthjoardar4549
@parthjoardar4549 3 жыл бұрын
Thanks buddy.... superb (y)
@tusharkadam6231
@tusharkadam6231 3 жыл бұрын
Thanks a lot Sir
@user-xg3bx2du5j
@user-xg3bx2du5j 3 жыл бұрын
Nice tutorial.
@akki4u
@akki4u 4 жыл бұрын
Nice tutorial
@raulgloco
@raulgloco 2 жыл бұрын
I love you. Thanks.
@raveensinghe2124
@raveensinghe2124 2 жыл бұрын
good work
@vangapandumurali1878
@vangapandumurali1878 4 жыл бұрын
sir how to write multiple conditions in one rule...means if first condition satisfy then inside i want to use another condition?
@govindrajk4276
@govindrajk4276 3 жыл бұрын
Can you please upload a video for multiple decision tables in spread sheet. I have sent you the samples and bug. Would be good if you could inspect and provide your views. Thanks. G
@justingeorge2443
@justingeorge2443 3 жыл бұрын
Good !!
@vinaytandel4539
@vinaytandel4539 2 жыл бұрын
It is quite interesting. Can we pass multiple objects in the .drl file and set the conditions. For example, I will pass Customer and Transaction objects and put conditions as "If customerObject.customerType = "VIP" and "transactionObject.transactionAmount > 5,000" then give the discount of "8%". And also is it possible to set a ladder of conditions including AND, OR etc. Kindly assist
@harshitamathur4541
@harshitamathur4541 Жыл бұрын
Helpful tutorial. Can you also tell how can we run only one rule from drl file that is instead of using fireAllRules() can we run one particular rule?
@nikhil5894
@nikhil5894 3 жыл бұрын
Thankyou
@noob_player_in_the_field
@noob_player_in_the_field 2 ай бұрын
hey. awesome basic stuff. really helpful. is there any way you can expand this a bit more ?
@gayatriv4230
@gayatriv4230 2 жыл бұрын
Hello, I get this error in trying to start my spring boot app. My excel sheet is in the same resources folder and is in .xls format. “Failed to open Excel stream, please check that the content is xls97 format”. Please help.
@pawanmutalik8295
@pawanmutalik8295 4 жыл бұрын
this was very helpful. thank you so much. Do you have an example for creating a KJAR by keeping the rules external to the application and the then integrating it with spring using kie-ci? Thanks in advance
@Javatechie
@Javatechie 4 жыл бұрын
No I never tried this
@vipuldawar88
@vipuldawar88 3 жыл бұрын
Yes, kJar can be included as a dependency, which u can load by providing its path to pom.xml within kjar
@personxyz1840
@personxyz1840 2 жыл бұрын
@@Javatechie exactly that is what needed, if drools file is inside application there is no point of having conditions in java file or drools file we have to rebuild and deploy app when rules changes.
@Javatechie
@Javatechie 2 жыл бұрын
Yes it should be external to your application always
@tejalfegade73
@tejalfegade73 4 жыл бұрын
Hi, Is it possible to work with multiple object in drl file like orderObject? Example :- based on condition from first object, i need to call the method for second object.
@Javatechie
@Javatechie 4 жыл бұрын
No in same drl file we can't but yes either you can create new DRL file or you can use drools decision table
@kapilsharma-un9mu
@kapilsharma-un9mu 3 жыл бұрын
The import org.kie cannot be resolved KieSession cannot be resolved to a type getting this error when i try to run project please help
@AliHussain-qs1qw
@AliHussain-qs1qw 3 жыл бұрын
how we can DMN insteal of DRL ?
@sumitkarmakar9098
@sumitkarmakar9098 2 ай бұрын
What about auditing and history records?? Not recommended for production purpose.
@Anshika.Agrawal
@Anshika.Agrawal 4 жыл бұрын
What if we want to add a totally new field in the drl file which is not present in the POJO class but due to business requirement change we have to add it dynamically, how can we do that? Dynamically in the sense that if we update drl file it should generate fields in the POJO class and everywhere else automatically so that we don't have to change the code.
@Javatechie
@Javatechie 4 жыл бұрын
Hi Anishika , interesting question I don't think we have such features in drools mechanism Yes partially we can overcome this issue , by using drool decision table instead of file . I will upload video on same in this weekend
@pran66866
@pran66866 3 жыл бұрын
You can keep all POJOs in a separate entity project. Refer that in Rule Engine project through maven dependancy. So whenever you want to modify/add fields update the POJO and publish it. Keep the version same so you dont have to modify Rule engine POM file.
@epurisreeja8569
@epurisreeja8569 5 жыл бұрын
Hi sir i need more videos on drools .Because i was trying hot deployment of drool files.so can u provide any videos depends related to KieFileSystems and Kie scanner And Kie builder
@Javatechie
@Javatechie 5 жыл бұрын
Definitely will do epuri
@JavaWallah-tp3ue
@JavaWallah-tp3ue 4 жыл бұрын
Hi sir @Java Techie .......... we can use property file then what is the more advantage of drools
@Javatechie
@Javatechie 4 жыл бұрын
We can't write conditional statement in properties file Ankit . .drl and . properties can't be compare both are completely used for different context
@AnkitSharma-fu1jw
@AnkitSharma-fu1jw Жыл бұрын
How to keep the rules in mysql database and read the rules from there?
@akashkharade2259
@akashkharade2259 Жыл бұрын
Great video as usual. Can you help with debugging drools? What would you suggest? Thanks
@lostinchennai7929
@lostinchennai7929 4 ай бұрын
Hi , I'm stuck with debug drools as well .. got any lead ?
@basu.arijit
@basu.arijit 4 жыл бұрын
If I change some value in .DRL file, do I need to restart the server to take effect?
@Javatechie
@Javatechie 4 жыл бұрын
No not required
@ajaychowdarykandula2230
@ajaychowdarykandula2230 3 жыл бұрын
@@Javatechie are you sure?
@Javatechie
@Javatechie 3 жыл бұрын
If it's outside of your project directory not required
@kanthrajsetty8569
@kanthrajsetty8569 8 ай бұрын
Hi @Javatechie , here in the example drools file is part of application. if i want to change the rule it needs a re-deployment of the micro service.?
@sweetysrivastava4995
@sweetysrivastava4995 4 ай бұрын
Yeah, but we can keep it out side of the project and reference them isn't it ?
@ajmalroshan1449
@ajmalroshan1449 4 жыл бұрын
Hi, instead of creating .drl files manually, can we create it dynamically using custom UI (am not looking for the tools like kie-workbench , i need to modify and edit using my custom UI in my front end side).Hope you will get back to me with some hints at least.
@yaswanthmareddy3930
@yaswanthmareddy3930 2 жыл бұрын
Hi @ajmal roshan did you got any solution for your problem
@dany09es
@dany09es Жыл бұрын
@@yaswanthmareddy3930 And you Yaswanth?
@azharmobeen
@azharmobeen 2 жыл бұрын
Hi thanks for shring this, but I have a simple a question, you said we should use drool engine so that we no need to change the hard code conditions BUT you also simply move if-else conditions to *.drl file and it's inside resources folder if we need to change we need to build and redeploy this service right ? then what's the advantage ? I'm not getting it. Please explain
@Javatechie
@Javatechie 2 жыл бұрын
You shouldn't keep your drl file in your code . it should be external to your application
@azharmobeen
@azharmobeen 2 жыл бұрын
@@Javatechie you mean it can be on any remote path?
@Javatechie
@Javatechie 2 жыл бұрын
Yes
@youngsensei3764
@youngsensei3764 3 жыл бұрын
I don't understand the difference between hard coding the conditions in java or using drools instead. You're still hardcoding all the actions and results. Does the drools engine just process at a much superior speed?
@Javatechie
@Javatechie 3 жыл бұрын
This drl file should be kept in outside project directory and whenever you want to change condition directly you can do that in file so no need to change anything in code
@shubhamshukla7855
@shubhamshukla7855 2 ай бұрын
how to handle multiple rule engine files for different use case
@bikash6007
@bikash6007 3 ай бұрын
Do anyone know about Jitting issue in Drools? Why it occurs and how to resolve it? Is there any resources to get more information about Jitting issue in Drools?
@SrinivasReddy-me7mm
@SrinivasReddy-me7mm 3 жыл бұрын
In drl file also we are hardcoding the discount value in ur given example.so how is it different from java. We have to redeploy the code again na
@saideepullal4453
@saideepullal4453 Жыл бұрын
Separation of concern. Business logic can be present everywhere in your code. Having it in one place like a drl file helps easier management
@ayeshabadepeer1593
@ayeshabadepeer1593 27 күн бұрын
Can you also make video for debugging of .drl files
@sarojsahoo8763
@sarojsahoo8763 4 жыл бұрын
Can Drool can handle nested if else and complex condition as well?
@Javatechie
@Javatechie 4 жыл бұрын
Yes we can handle , what I explained in drools its just basic still N number of features are there
@santanuroy2546
@santanuroy2546 2 жыл бұрын
The same code I pasted into configuration file. it gives tons of errors even after importing the required librarires.
@Javatechie
@Javatechie 2 жыл бұрын
Do mvn update once
@gmmkeshav
@gmmkeshav 9 ай бұрын
What about date wise logic like for big billion days at 12 am on a particular date it should start like exactly on 00:00:00
@rnt-jy7tl
@rnt-jy7tl 3 жыл бұрын
can we generate drules dynamically in drl files.Based on UI conditions
@Javatechie
@Javatechie 3 жыл бұрын
Not sure about this
@tusharramteke5257
@tusharramteke5257 3 жыл бұрын
I am just wondering how discount is calculated, you are just setting the discount to 10,8,15, how it is taking discount from the price? kindly answer
@Javatechie
@Javatechie 3 жыл бұрын
That's what the purpose of using drl
@pavankumarn.r.9152
@pavankumarn.r.9152 4 жыл бұрын
Is KieSession thread safe? I.e in concurrent scenario, will order value inserted into KieSession doesn't mix up?
@Javatechie
@Javatechie 4 жыл бұрын
Hi pavan , Yes it's thread safe
@pavankumarn.r.9152
@pavankumarn.r.9152 4 жыл бұрын
@@Javatechie I'm creating new KieStateless session for each request before firing rules..Threads are getting blocked in concurrent scenario..only data/facts change for each request, rules remains same..Am I'm doing properly or do I need to create one statelesssession during startup and use it for all requests just changing facts?
@Javatechie
@Javatechie 4 жыл бұрын
@@pavankumarn.r.9152 let me check this scenario
@mayurupadhyay3216
@mayurupadhyay3216 4 жыл бұрын
@@pavankumarn.r.9152 are you able explore this and resolved the issue? I had same concern as we would be using it in production env with multiple vms / server.
@mayurupadhyay3216
@mayurupadhyay3216 4 жыл бұрын
@@pavankumarn.r.9152 are you able explore this and resolved the issue? I had same concern as we would be using it in production env with multiple vms / server.
@pamarthiraj
@pamarthiraj 3 жыл бұрын
I am getting discount 0 for all post requests. What could be the reason ?
@Javatechie
@Javatechie 3 жыл бұрын
Check Lombok plugin configure in your IDE or not if not add setter and getter method manually
@mayurupadhyay3216
@mayurupadhyay3216 4 жыл бұрын
Can you also create a video for deployment the same project to extrnal VM or server? How to setup drools based project in the clustered env?
@Javatechie
@Javatechie 4 жыл бұрын
Hi Mayur, am not much aware on deployment stuff definitely I will try to explore this
@mayurupadhyay3216
@mayurupadhyay3216 4 жыл бұрын
@@Javatechie sure.. thanks!
@mayurupadhyay3216
@mayurupadhyay3216 4 жыл бұрын
@@Javatechie Have you got a chance to explore?
@miguelbalvin5211
@miguelbalvin5211 Жыл бұрын
it is not clear how you get the internal atributes of DroolsConfig (KieContainer etc etc etc)
@riyaza9958
@riyaza9958 2 жыл бұрын
Very informative... But pls explain each and every line, we will be get more info.
@JTM_K
@JTM_K 4 жыл бұрын
Hi Sir, can u show us dynamic data fetched from db, instead of hard coding in .drl file
@Javatechie
@Javatechie 4 жыл бұрын
In .drl file we need to provide when , given and then that should be hardcode else how it will evaluate condition ? I guess you might getting confused if am not wrong
@JTM_K
@JTM_K 4 жыл бұрын
@@Javatechie Sir, what I meant was if I wanted to validate age for using Guns as an example.I have the Person object which has the age. but the age limit is currently hardcodod in .drl (eg:18). In Future I want to make this 18 to 22 in my program, and I want to config this only from db side.
@bathulanagendra4621
@bathulanagendra4621 5 жыл бұрын
Sir if we change any rule in drl file,do we need to restart the application.
@Javatechie
@Javatechie 5 жыл бұрын
No not required , we shouldn't keep drl file in our project directory, it should be place some shared directory
@saurabh945644
@saurabh945644 4 жыл бұрын
You can check this, you don't need to use the DRL files, rules can be updated/added through rest requests as well as persisted into db. github.com/algostructures/DroolsRuleEngine
@nikupanda1105
@nikupanda1105 4 жыл бұрын
While setting up drools config its showing error in all the import statements for import.org.kie.*.......Kindly guide if possible. Thanks in advance
@Javatechie
@Javatechie 4 жыл бұрын
After adding dependency then run mvn clean install once
@rohitramaswamy8131
@rohitramaswamy8131 Жыл бұрын
i am using intellij- it is not letting me download the plug in. anhyone else having this problem?
@Javatechie
@Javatechie Жыл бұрын
What version you are using?
@ukyo1541
@ukyo1541 3 жыл бұрын
Coming
@bhaskarverma9810
@bhaskarverma9810 3 жыл бұрын
Which drools version we have to use in Java11?
@Javatechie
@Javatechie 3 жыл бұрын
Check the latest one in Maven central repository. It has backward compatibility so you can use any lower version as well
@bhaskarverma9810
@bhaskarverma9810 3 жыл бұрын
@@Javatechie I have not got any answer.
@Javatechie
@Javatechie 3 жыл бұрын
Dude I replied
@noopur30
@noopur30 5 жыл бұрын
Hi, I am in QA team and the dev side has a code to do some calculations on the basis of rules that they have present in database. We are trying to have automation around these calculations on the basis of the rules. Can we use drool to have our automation around those calculations?
@Javatechie
@Javatechie 5 жыл бұрын
Yes Of course we can , you can specify rules in either excel sheet or in drl file then you can process it as per your business
@noopur30
@noopur30 5 жыл бұрын
@@Javatechie Okay thanks. And it is compatible with maven projects too, right?
@noopur30
@noopur30 5 жыл бұрын
@@Javatechie Also, we are working on intellij CE
@Javatechie
@Javatechie 5 жыл бұрын
@@noopur30 yes it's compatible with Maven and if you are using intellij it's really cool you can find better features
@noopur30
@noopur30 5 жыл бұрын
@@Javatechie But is says the support is not available yet. youtrack.jetbrains.com/issue/IDEA-24348
@SanthoshKumar-or7wd
@SanthoshKumar-or7wd 2 жыл бұрын
Why can’t we write the condition in database functions?
@Javatechie
@Javatechie 2 жыл бұрын
Database function ?
@vishnumurali522
@vishnumurali522 5 жыл бұрын
How can i make drool file to deploy automatically without restarting the server in SpringBoot if i made any changes in that .drl file?
@Javatechie
@Javatechie 5 жыл бұрын
Add devtools or spring loader . But I don't think we need to restart server for drl file changes because it should external application
@vishnumurali522
@vishnumurali522 5 жыл бұрын
@@Javatechie As I am using in intellig Idea & using local drl file.once I run the application it will perform the rule specified at that time only.But if we r using the Dev tools it's also the same the IDE itself redeploy the application.But if in the case of production it will work??
@Javatechie
@Javatechie 5 жыл бұрын
Hi Vishnu , always drl file should be external to your application , so.any changed you are doing in drl file , it will auto reload I believe .
@vishnumurali522
@vishnumurali522 5 жыл бұрын
@@Javatechie github.com/vishnu2497/Drool-sample.git can u pls check this sample application..
@vishnumurali522
@vishnumurali522 5 жыл бұрын
@@Javatechie Even it is a external to my application it will loaded once in the ksession then it will do all the calculations based on that ksession only.So How can it take the newly updated value/rules?? There is very big confussion in this topic..
@CraftMojo777
@CraftMojo777 5 жыл бұрын
How to read from drl file, if we make some configuration Web Gui , so that user can change from that form instead change from drl file inside the code
@Javatechie
@Javatechie 5 жыл бұрын
Drl file always we should keep outside the project
@CraftMojo777
@CraftMojo777 5 жыл бұрын
@@Javatechie Thanks for the answer. Btw, I'm curious how we can make the users change the value by it self , let say we have a user friendly web gui for them.
@Javatechie
@Javatechie 5 жыл бұрын
Ok you want user should update drl from UI ?
@CraftMojo777
@CraftMojo777 5 жыл бұрын
@@Javatechie yes, correct. How do we read those conf from user UI?
@Javatechie
@Javatechie 5 жыл бұрын
Very Interesting , I didn't tried this will let you know if I can
@reiserthomas
@reiserthomas 3 жыл бұрын
Wolle Rose kaufen?
@chandhrum9061
@chandhrum9061 Жыл бұрын
Bro how to set up drools workbench and integrate with springboot application. Pls tell me..
@Javatechie
@Javatechie Жыл бұрын
Bro I'm not aware about this feature. Let me check and update
@chandhrum9061
@chandhrum9061 Жыл бұрын
@@Javatechie yes bro pls make a video on this..
@chiranjeevi009
@chiranjeevi009 3 жыл бұрын
Hi Sir, how to debug .drl file?
@Javatechie
@Javatechie 3 жыл бұрын
No we can't , you can debug only code
@santhoshkeleti8480
@santhoshkeleti8480 4 жыл бұрын
How to compare dates
@Javatechie
@Javatechie 4 жыл бұрын
Convert it to string and then compare
@santhoshkeleti8480
@santhoshkeleti8480 4 жыл бұрын
Java Techie if I change any thing in excel file it is not working like I have changed the discount percentage. It is giving 0% for all requests
@Javatechie
@Javatechie 4 жыл бұрын
No it shouldn't behave like this after changes Excel did you saved it ?
@santhoshkeleti8480
@santhoshkeleti8480 4 жыл бұрын
Java Techie I have saved and restarted the server even it is not working it is giving zero only
@Javatechie
@Javatechie 4 жыл бұрын
Please share your code in GitHub so that I can check this out
@saurabh945644
@saurabh945644 4 жыл бұрын
I have created a project taking your example, where we can update the rules even when application is running using rest calls and also shadring the drools engine to get better performance while saving new rules. github.com/algostructures/DroolsRuleEngine, please have look if any suggestions let me know.
@bjelinski1
@bjelinski1 Жыл бұрын
please get some text-to-speech software, this accent is painful.
[KieLive#17] Understanding DRL (Drools Rule Language)
1:08:11
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 38 МЛН
哈莉奎因以为小丑不爱她了#joker #cosplay #Harriet Quinn
00:22
佐助与鸣人
Рет қаралды 8 МЛН
Это реально работает?!
00:33
БРУНО
Рет қаралды 3,3 МЛН
Microservices and Rules Engines - a blast from the past - Udi Dahan
52:48
What are Business Rules?
13:59
IBM Technology
Рет қаралды 18 М.
#5 What is Spring Boot?
12:12
Telusko
Рет қаралды 46 М.
Лучший браузер!
0:27
Honey Montana
Рет қаралды 1,1 МЛН
Как противодействовать FPV дронам
44:34
Стратег Диванного Легиона
Рет қаралды 117 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 9 МЛН
Ускоряем ваш TV🚀
0:44
ARTEM_CHIBA
Рет қаралды 379 М.
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН