Drools - Rule Engine Integration with Spring framework | java Techie

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

ความคิดเห็น • 161

  • @amitrofanov82
    @amitrofanov82 4 ปีที่แล้ว +12

    Thank you, Indian colleague. Fast and easy to get explaination of the Concept and Spring integration example.

  • @Prem-1989-official
    @Prem-1989-official 3 หลายเดือนก่อน +1

    Nicely explained Ty so much love from Odisha

  • @arvinttrigger4501
    @arvinttrigger4501 3 ปีที่แล้ว +2

    This guy is a genius ✨

  • @ankittiwary3712
    @ankittiwary3712 5 ปีที่แล้ว +8

    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

  • @rajeshbongurala8491
    @rajeshbongurala8491 3 ปีที่แล้ว +1

    Thanks Buddy... Time saved... Add lombok dependency o avoid setter and getters code

  • @basu.arijit
    @basu.arijit 4 ปีที่แล้ว +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 ปีที่แล้ว +1

      @@Javatechie are you sure?

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว +1

      If it's outside of your project directory not required

  • @siyedyoussef3202
    @siyedyoussef3202 5 ปีที่แล้ว +2

    Thanks very much for the video Sir 👍👍👍

  • @voiceguy554
    @voiceguy554 3 ปีที่แล้ว +1

    Thanks Bud! Much Appreciated!

  • @iamsreekanth
    @iamsreekanth 4 ปีที่แล้ว +1

    Very good explanation and showed all steps. Thank you.

  • @azharmobeen
    @azharmobeen 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      You shouldn't keep your drl file in your code . it should be external to your application

    • @azharmobeen
      @azharmobeen 2 ปีที่แล้ว +1

      @@Javatechie you mean it can be on any remote path?

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว

      Yes

  • @rnt-jy7tl
    @rnt-jy7tl 3 ปีที่แล้ว +1

    can we generate drules dynamically in drl files.Based on UI conditions

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      Not sure about this

  • @kanthrajsetty8569
    @kanthrajsetty8569 ปีที่แล้ว

    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 9 หลายเดือนก่อน

      Yeah, but we can keep it out side of the project and reference them isn't it ?

  • @bhaskarverma9810
    @bhaskarverma9810 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      @@Javatechie I have not got any answer.

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      Dude I replied

  • @pavankumarn.r.9152
    @pavankumarn.r.9152 5 ปีที่แล้ว +1

    Is KieSession thread safe? I.e in concurrent scenario, will order value inserted into KieSession doesn't mix up?

    • @Javatechie
      @Javatechie  5 ปีที่แล้ว

      Hi pavan , Yes it's thread safe

    • @pavankumarn.r.9152
      @pavankumarn.r.9152 5 ปีที่แล้ว

      @@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  5 ปีที่แล้ว

      @@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.

  • @Anshika.Agrawal
    @Anshika.Agrawal 5 ปีที่แล้ว +1

    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  5 ปีที่แล้ว

      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 4 ปีที่แล้ว +1

      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.

  • @abhinavkumar2038
    @abhinavkumar2038 ปีที่แล้ว +1

    Really helpful . Thanks much !!

  • @tejalfegade73
    @tejalfegade73 4 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      No in same drl file we can't but yes either you can create new DRL file or you can use drools decision table

  • @br4676
    @br4676 5 ปีที่แล้ว +1

    very nice sir, thanks for your time for all this, god bless you .

  • @nileshdongre5794
    @nileshdongre5794 3 ปีที่แล้ว +1

    Easy to understand and very helpful. Thanks

  • @trhoangdat
    @trhoangdat 3 ปีที่แล้ว +1

    thank you, very helpful and informative

  • @surendrabisht2523
    @surendrabisht2523 2 ปีที่แล้ว +1

    very clear explanation.

  • @virafkarai4525
    @virafkarai4525 2 หลายเดือนก่อน +1

    Good tutorial. Thank you.

  • @GiovanniMarchi-b6e
    @GiovanniMarchi-b6e ปีที่แล้ว +1

    Thanks Bro, you are awesome!

  • @AlexSouzaSD
    @AlexSouzaSD 3 ปีที่แล้ว +1

    Thanks...you've helped me a lot!

  • @JavaWallah-tp3ue
    @JavaWallah-tp3ue 5 ปีที่แล้ว +1

    Hi sir @Java Techie .......... we can use property file then what is the more advantage of drools

    • @Javatechie
      @Javatechie  5 ปีที่แล้ว

      We can't write conditional statement in properties file Ankit .
      .drl and . properties can't be compare both are completely used for different context

  • @chandhrum9061
    @chandhrum9061 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      @@Javatechie yes bro pls make a video on this..

  • @tusharramteke5257
    @tusharramteke5257 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      That's what the purpose of using drl

  • @sumitkarmakar9098
    @sumitkarmakar9098 7 หลายเดือนก่อน

    What about auditing and history records?? Not recommended for production purpose.

  • @raveensinghe2124
    @raveensinghe2124 2 ปีที่แล้ว +1

    good work

  • @gmmkeshav
    @gmmkeshav ปีที่แล้ว

    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

  • @pamarthiraj
    @pamarthiraj 4 ปีที่แล้ว +1

    I am getting discount 0 for all post requests. What could be the reason ?

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      Check Lombok plugin configure in your IDE or not if not add setter and getter method manually

  • @youngsensei3764
    @youngsensei3764 3 ปีที่แล้ว +1

    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

  • @noob_player_in_the_field
    @noob_player_in_the_field 7 หลายเดือนก่อน

    hey. awesome basic stuff. really helpful. is there any way you can expand this a bit more ?

  • @parthjoardar4549
    @parthjoardar4549 3 ปีที่แล้ว +1

    Thanks buddy.... superb (y)

  • @milanfaizal
    @milanfaizal 3 หลายเดือนก่อน +1

    Thank you. Detailed video

  • @AnkitSharma-fu1jw
    @AnkitSharma-fu1jw ปีที่แล้ว

    How to keep the rules in mysql database and read the rules from there?

  • @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 2 ปีที่แล้ว

      Separation of concern. Business logic can be present everywhere in your code. Having it in one place like a drl file helps easier management

  • @bratwurstfan
    @bratwurstfan 5 ปีที่แล้ว +1

    Thanks! Very clear and in a nutshell

  • @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.

  • @vangapandumurali1878
    @vangapandumurali1878 5 ปีที่แล้ว

    sir how to write multiple conditions in one rule...means if first condition satisfy then inside i want to use another condition?

  • @santanuroy2546
    @santanuroy2546 3 ปีที่แล้ว +1

    The same code I pasted into configuration file. it gives tons of errors even after importing the required librarires.

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      Do mvn update once

  • @ajmalroshan1449
    @ajmalroshan1449 4 ปีที่แล้ว +1

    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 3 ปีที่แล้ว

      Hi @ajmal roshan did you got any solution for your problem

    • @dany09es
      @dany09es ปีที่แล้ว

      @@yaswanthmareddy3930 And you Yaswanth?

  • @JTM_K
    @JTM_K 5 ปีที่แล้ว +2

    Hi Sir, can u show us dynamic data fetched from db, instead of hard coding in .drl file

    • @Javatechie
      @Javatechie  5 ปีที่แล้ว

      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 5 ปีที่แล้ว

      @@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.

  • @veerapavakumarbandi
    @veerapavakumarbandi 5 ปีที่แล้ว +1

    Nice video, explain very well with good example, if you don't mind can you provide live example

  • @sarojsahoo8763
    @sarojsahoo8763 5 ปีที่แล้ว

    Can Drool can handle nested if else and complex condition as well?

    • @Javatechie
      @Javatechie  5 ปีที่แล้ว +1

      Yes we can handle , what I explained in drools its just basic still N number of features are there

  • @noopur30
    @noopur30 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +2

      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

  • @pawanmutalik8295
    @pawanmutalik8295 4 ปีที่แล้ว +1

    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 4 ปีที่แล้ว

      Yes, kJar can be included as a dependency, which u can load by providing its path to pom.xml within kjar

    • @personxyz1840
      @personxyz1840 2 ปีที่แล้ว +1

      @@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

  • @bikash6007
    @bikash6007 7 หลายเดือนก่อน

    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?

  • @vishnumurali522
    @vishnumurali522 5 ปีที่แล้ว +1

    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..

  • @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?

  • @SanthoshKumar-or7wd
    @SanthoshKumar-or7wd 3 ปีที่แล้ว +1

    Why can’t we write the condition in database functions?

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      Database function ?

  • @bathulanagendra4621
    @bathulanagendra4621 5 ปีที่แล้ว +1

    Sir if we change any rule in drl file,do we need to restart the application.

    • @Javatechie
      @Javatechie  5 ปีที่แล้ว +1

      No not required , we shouldn't keep drl file in our project directory, it should be place some shared directory

    • @saurabh945644
      @saurabh945644 5 ปีที่แล้ว +2

      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

  • @sarojsahoo8763
    @sarojsahoo8763 5 ปีที่แล้ว +1

    Thank u so much dude for the awesome content

  • @ayeshabadepeer1593
    @ayeshabadepeer1593 5 หลายเดือนก่อน

    Can you also make video for debugging of .drl files

  • @AliHussain-qs1qw
    @AliHussain-qs1qw 3 ปีที่แล้ว

    how we can DMN insteal of DRL ?

  • @epurisreeja8569
    @epurisreeja8569 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      Definitely will do epuri

  • @LoveShaminiGovind
    @LoveShaminiGovind 3 ปีที่แล้ว +2

    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

  • @nikupanda1105
    @nikupanda1105 4 ปีที่แล้ว +1

    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

  • @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 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      Very Interesting , I didn't tried this will let you know if I can

  • @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?

  • @rohitramaswamy8131
    @rohitramaswamy8131 ปีที่แล้ว +1

    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?

  • @chiranjeevi009
    @chiranjeevi009 3 ปีที่แล้ว +1

    Hi Sir, how to debug .drl file?

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      No we can't , you can debug only code

  • @riyaza9958
    @riyaza9958 3 ปีที่แล้ว +1

    Very informative... But pls explain each and every line, we will be get more info.

  • @kapilsharma-un9mu
    @kapilsharma-un9mu 4 ปีที่แล้ว

    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

  • @akki4u
    @akki4u 4 ปีที่แล้ว +1

    Nice tutorial

  • @justingeorge2443
    @justingeorge2443 3 ปีที่แล้ว +1

    Good !!

  • @santhoshkeleti8480
    @santhoshkeleti8480 4 ปีที่แล้ว +1

    How to compare dates

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      Convert it to string and then compare

    • @santhoshkeleti8480
      @santhoshkeleti8480 4 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      Java Techie I have saved and restarted the server even it is not working it is giving zero only

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      Please share your code in GitHub so that I can check this out

  • @akashkharade2259
    @akashkharade2259 ปีที่แล้ว

    Great video as usual. Can you help with debugging drools? What would you suggest? Thanks

    • @lostinchennai7929
      @lostinchennai7929 8 หลายเดือนก่อน

      Hi , I'm stuck with debug drools as well .. got any lead ?

  • @hix0071
    @hix0071 4 ปีที่แล้ว

    Good work. Keep it up.

  • @tusharkadam6231
    @tusharkadam6231 3 ปีที่แล้ว +1

    Thanks a lot Sir

  • @raulgloco
    @raulgloco 2 ปีที่แล้ว +1

    I love you. Thanks.

  • @vinaytandel4539
    @vinaytandel4539 3 ปีที่แล้ว

    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

  • @柯少廷
    @柯少廷 4 ปีที่แล้ว

    Nice tutorial.

  • @miguelbalvin5211
    @miguelbalvin5211 ปีที่แล้ว

    it is not clear how you get the internal atributes of DroolsConfig (KieContainer etc etc etc)

  • @sweetysparkles1866
    @sweetysparkles1866 4 ปีที่แล้ว

    Very clear. thank you

  • @Lumary
    @Lumary 5 ปีที่แล้ว +2

    very helpful! :)

  • @reiserthomas
    @reiserthomas 3 ปีที่แล้ว +1

    Wolle Rose kaufen?

  • @nikhil5894
    @nikhil5894 4 ปีที่แล้ว +1

    Thankyou

  • @ukyo1541
    @ukyo1541 3 ปีที่แล้ว +1

    Coming

  • @saurabh945644
    @saurabh945644 5 ปีที่แล้ว +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.

  • @BRUCEWAYNE-bc5sd
    @BRUCEWAYNE-bc5sd 15 วันที่ผ่านมา

    Kie version

  • @bjelinski1
    @bjelinski1 ปีที่แล้ว

    please get some text-to-speech software, this accent is painful.