25+ Drools Interview Questions and Answers [BEST & NEW]-2020
Drools Interview Questions and Answers

25+ Tricky SAP BI/BW Interview Questions with SMART ANSWERS

Last updated on 03rd Jul 2020, Blog, Interview Questions

About author

Rakshan (Sr Technical Director )

(5.0) | 16547 Ratings 2429

Drools is a business rule management system (BRMS) with a forward and backward chaining inference based rules engine, more correctly known as a production rule system, using an enhanced implementation of the Rete algorithm.

KIE (Knowledge Is Everything) is the new umbrella name to drools,optaPlanner, jBPM, Guvnor, uberFire and related technologies.

Drools supports the Java Rules Engine API (Java Specification Request 94) standard for its business rule engine and enterprise framework for the construction, maintenance, and enforcement of business policies in an organization, application, or service.

1. What does Drool mean?

Ans:

Drools is Business Rule Management System (BRMS) provided by JBoss Community for implementing complex applications with an automatic behaviors based on rules. The framework is based on an extension of Rete pattern-matching algorithm.

2. What does Drool Workbench, Expert, and Fusion?

Ans:

  • Drools Workbench is a web user interface for an authoring and management.
  • Drools Expert is a business rule engine.
  • Drools Fusion is complex event processing feature.

3. What does features of the JBoss Enterprise Web Platform?

Ans:

The JBoss Enterprise Web Platform is a software infrastructure that supports to running of BRMS components.

4. What does features of drools?

Ans:

Drools is open-source Business Rules Management Software (BRMS) written in a Java that provides users with the variety of features like as Business Rule Engine, Web authoring, Rules Management Application, and runtime support for a Decision Model and Notation models.

5. What does MVEL Dialect?

Ans:

MVEL is an expression language for the Java-based applications. It supports the field and method/getter access. It is based on the Java syntax.

6. What does JBoss Enterprise BRMS?

Ans:

JBoss Enterprise BRMS is the business rule management system and reasoning engine for a business policy and rules development, access, and change management. JBoss Enterprise (JBoss) BRMS is a productized version of Drools that includes enterprise-level capabilities. JBoss Rules is also productized version of Drools, but JBoss Enterprise BRMS is flagship product.

7. What exactly is Rule?

Ans:

Rules are the pieces of knowledge often expressed as, When some conditions occur,then do the some tasks.

8. What does accumulating in DRL Drools?

Ans:

Accumulate is a conditional element that was added to Drools in version 4.0. It is used to iterate over a list of objects and aid in data validation in Java operations.

Ex. accumulate (Counter() ; $cnt : count())

9. Explain KIE?

Ans:

KIE is an acronym denoting Everything is based on knowledge. It represents the idea that knowledge equals power. A new method is used to build the Knowledge Base and a Knowledge Session starting with Drools 6.0. A set of procedures and rules are managed using an interface called the knowledge base. Since creating rules is more costly, the knowledge base’s primary function is to store and reuse existing rules. Rules are contained inside package org. drools.KnowledgeBase. These are commonly referred to as a knowledge definitions or knowledge. The knowledge base provides the methods for creating a Session.

10. Which Drools attributes have you used?

Ans:

JBoss Enterprise BRMS is productized version of a Drools and it has an enterprise-level support.

11. What does  Knowledge Session?

Ans:

The knowledge session is retrieved from a knowledge base. It is main interface for interacting with the Drools Engine. The knowledge session can be of a two types:

  • A AStateless Knowledge Session
  • A Stateful Knowledge Session

12. How does drools work?

Ans:

The Drools rule engine stores, analyses, and evaluates data in order to execute defined business rules or decision models. The basic function of Drools rule engine is to match incoming data, or facts, to conditions of rules and determine whether and how to execute rules.

13. How does write rules in Drools?

Ans:

  • Package − Each Rule starts with the package name. The package acts as namespace for Rules.
  • Import statement − Whatever facts want to apply the rule on, those facts needs to be imported. For example, com.
  • Rule Definition − It consists of a Rule Name, the condition, and the Consequen

14. What does insert in Drools?

Ans:

“insert” inserts a new Facts into Drools Working Memory. There are more different ways to put these Facts elsewhere, one of which would be to have code in RHS call a helper class that can persists an object.

15. What does standard supported by drool?

Ans:

Drool supports an enterprise framework for enforcement, construction, and maintenance for a business policies along with the JSR-94 standards for a business rule engine.

16. What does components of JBoss Enterprise version?

Ans:

  • JBoss enterprise version has following components
  • JBoss Enterprise application of a SOA platform
  • A Business Rules Engine
  • JBoss Enterprise web platform
  • A Business Rules Manager

17. What does features of the JBoss Enterprise Application Platform?

Ans:

  • Eclipse-based IDE is available using the JBoss developer studio
  • A java persistence using a hibernate
  • Supports the Java EE and web services standards
  • Object request broker using the JacORB for interoperability with CORBA objects.

18.What does Drool flow?

Ans:

Drool flow provides a workflow capabilities to drool platform. Workflow describes the order of steps that require to be executed. Drool flow allows the users to execute and monitor business logic.

19. What does decision tables?

Ans:

Decision tables are the tables that are based on Excel in drools. These tables’ logic may be altered and understood by non-technical people.As.drl file is difficult to manage, therefore, decision table is good option that can be simply managed by a non-programmers.

    Subscribe For Free Demo

    [custom_views_post_title]

    20. What does Drools stateful Vs Stateless knowledge session?

      Aspect Stateful Session Stateless Session
    Memory Handling

    Retains working memory

    Does not retain memory
    Performance Slower due to memory upkeep Faster due to no memory
    Context Iterative rule evaluation/modification One-time rule evaluation

    21. How does implement backward chaining in Drools?

    Ans:

    In background chaining, the initial user makes a choice and then tracks a series of events to see if it is true or false. It is also referred to as a derivation queries and drools implements that through the query construct.

    22. Which Drools attribute have used?

    Ans:

    Salience: Drools used the salience in order to figure out which drool to fire first.

    No-loop: An Indefinite looping is avoided by using the no-loop attribute.

    Update statement: The update statements let rules engine if any fact is modified.

    23. What does Drools Recursive Rules?

    Ans:

    A Recursion in Drools is fibonacci series. It is implemented using a keywords insert and modifies.

    24. List out the different execution control statements used in drools?

    Ans:

    Agenda-group: This is optional keyword. If rule is not assigned to any agenda group, by default it belongs to a main agenda.

    Activation-group: It is the reserved keyword in drl file. Both single rule or the multiple rules can belong to particular activation group.

    Rule flow-group: It behaves more similar to agenda-group, it is primarily used for a rules used in jBPM process flows.

    25. How does Drool different from the other programming languages?

    Ans:

    Unlike the other programming languages, Drool offers the several modifications to be applied to coding and does not work on certain set of patterns. A Conventional programming languages do not provide any management solution for a businesses which is main feature of Drool.

    26. What does benefits of using rule engines in a business project management?

    Ans:

    • Following are advantages of using the rule engines in business project management:

    High flexibility: Knowledgebase lets can adjust effectively about choices when they are evolving.

    Easy to learn: Rules are easy to understand as compared to the procedural code.

    Reduced intricacy: Rules handle an expanding multifaceted nature as utilize predictable business rules.

    Reusability: A Business rules can be reused.

    27. What does Drools process?

    Ans:

    Drool process is the framework that provides the flow of work along with the various business processes.

    28. What are the features of JBoss Enterprise Application or SOA Platform?

    Ans:

    In Drools, can use “$” before every variable to ensure that there is no difference between POJO class and variables of a rules.

    29. What does Drool planner?

    Ans:

    Drool planner is also called the automated planning that optimizes a process during the NP-hard planning issues.

    30. What does JBPM do?

    Ans:

    JBPM is the lightweight workflow engine written in Java and allows to execute a business processes with latest BPMN 2.0 specification. It runs on any Java environment have as an application or service.

    Course Curriculum

    Get On-Demand Drools Training & Become An Expert Drools

    • Instructor-led Sessions
    • Real-life Case Studies
    • Assignments
    Explore Curriculum

    31. What does global in DRL file?

    Ans:

    Global is the keyword used while defining any variable which would be visible to all rules in a DRL file. A global variable can be used with the any type of object. Global must be used more carefully with the DRL file because any changes in a global variable are not notified to working memory.

    32. Distinguish Difference between StringBuffer class and StringBuilder class?

    Ans:

    StringBuffer: StringBuffer is a synchronized ie. two threads cannot call the method at a same time Less efficient as compared to the StringBuilder

    StringBuilder: StringBuilder is an unsynchronized ie. two threads can call method at a same time Better than a StringBuffer

    33. Which tool is used to manage a complex event processing in Drools?

    Ans:

    Drool fusion is used for an event processing and a temporal reasoning.

    34. What does use of dialect in Drools?

    Ans:

    Dialect is used to write a Java code in the rules and points to Getter and Setters of variables of POJO (plain old Java objects).

    35. What does pattern matching?

    Ans:

    Pattern matching is the process of matching any new or existing facts which can be done against the production rules. The complete pattern matching is performed by Inference Engine.

    There are more algorithms used to perform a pattern matching;

    • Linear
    • Treat
    • Rete
    • Leaps.

    36. Can work with the custom UI instead of using a Guvnor Rule?

    Ans:

    It is feasible to construct the DRL using the same model and store the rules in a database using a bespoke domain model. This helps render the Guvnor redundant in custom environment.

    37. What does Drools run time?

    Ans:

    A Drools runtime is the collection of JARs on your file system that represent a one specific release of the Drools project JARs. To create runtime, must point the IDE to the release ofchoice.

    38. Does Drools support Python?

    Ans:

    This is the python package that allow to interact with the REST API exposed by KIE Server instance powered by the Drools.

    39. How does Drools work internally?

    Ans:

    Drools is a Rule Engine that uses rule-based approach to implement and Expert System. Expert Systems are knowledge-based systems that employ a knowledge representation to transform fresh information into a foundational understanding that may be used in reasoning.

    40. What does production memory in Drools?

    Ans:

    Production memory: Location in a Drools engine where rules are kept.

    Working memory: A stateful object which contains the objects acted upon by business rules.

    41. What does two types of dialect?

    Ans:

    Regional Dialect : A regional dialect is a subgroup variation of the language linked with a certain geographical place.

    Ethnic dialect : A subgroup variety of the language that is associated with particular ethnic group is termed an ethnic dialect.

    42.What does Drools Planner?

    Ans:

    Drools Planner or automated planning optimizes a process including the NP-hard planning problems. Drools Planner is the lightweight, embeddable planning engine that optimizes a planning problems.

    43. What does provided by Drools?

    Ans:

    The basic Business Rules Engine (BRE) and Web Authoring and Rules Management Application (Drools Workbench) are both provided by Drools, together with an Eclipse IDE plugin for core projects.

    44. What does use of global variable?

    Ans:

    Global variable can be used for the any type of object and there won’t be any mismatch.

    45. What does not advisable in use of global variables

    Ans:

    Changing global value inside a rule is not advisable. Instead a value should be set from the application using a working memory interface.

    46. What are the Recursion in Drools’ most crucial components?

    Ans:

    The three most important parts of in the process of implementation of a recursive rules in Drools are inserting akeywords in ‘then’ part, not keyword used in ‘when’ part, and ‘breaking condition’.

    47. What would be breaking condition in Fibonacci series?

    Ans:

    The breaking condition in the Fibonacci series would be (sequence==1).

    48. What does important components of enterprise version?

    Ans:

    Below are the important components of an enterprise version;

    JBoss enterprise web platform: This contains a software infrastructures and BRMS components.

    JBoss Enterprise Application Platform: This consists of a software infrastructures, and run only BRMS components.

    49. What framework integrate Drools with?

    Ans:

    Have integrated Drools with the Spring Framework.

    Course Curriculum

    Best JOB Oriented Drools Certification Training from Real-Time Experts

    Weekday / Weekend BatchesSee Batch Details

    50. What does Runtime in Drools?

    Ans:

    Drools Runtime is used in an instructing the editor for running program with specific version of Drools jar, And can also run the application with different Drools Runtime.

    51. What does terms used by Drools?

    Ans:

    Terms used by drools are:

    • Rules – Here can specify conditions.
    • Facts – Here rules acts.
    • Session – It holds all rules and other sources.
    • Agenda – Here all activation are waiting to be fired.
    • Activations – It is placed in an agenda where all rules are fired.

    52. What does advantages of using Drools?

    Ans:

    Declarative Programming:Declarative in nature, helps in solving problem statement and giving validation is more easy with drools.

    Logic and Data Separation:Helps in clearing the separation of Domain Objects and Business logic.

    53. What does condition in rules?

    Ans:

    • Rule can contain more conditions and patterns such as –
    • Account (balance == 200)
    • Customer (name == “Amol”)

    54.What does agenda events?

    Ans:

    Agenda events are events that are fired by a rule engine as it is processing rules. There are four various types of agenda events:

    • before-activation,
    • after-activation,
    • before-deactivation,
    • after-deactivation.
    • Every type of event is fired at different point in rule processing cycle.

    55. What does Java class and object are in relation to Drools?

    Ans:

    In Drools, a Java class is the template that can be used to create objects. An object is the specific instance of a class, and it contains all data and behavior defined by the class. Can think of a class as blueprint, and an object as a house that has been built from blueprint.

    56. Distinguish differences between JBoss Rules 5.0 and Drools 6.0?

    Ans:

    JBoss Rules 5.0 was community version of the Drools rule engine, and was renamed to the Drools 6.0 when it was integrated into Red Hat JBoss BRMS product. Some key differences between two versions include:

    • Drools 6.0 supports the integration with Red Hat JBoss BPM Suite for a process management, whereas JBoss Rules 5.0 did not.
    • Drools 6.0 includes the web-based console for a rule authoring and management, whereas JBoss Rules 5.0 did not.

    57. Which annotation is used for defining a global variables in Drools?

    Ans:

    The @global annotation is used for defining a global variables in Drools. Global variables are variables that are available from anywhere in the rule engine and may be used to hold information that has to be shared between several rules.

    58. How can add new facts to an existing knowledge base?

    Ans:

    Can add a new facts to an existing knowledge base by using “insert” command. This command will add new fact to the knowledge base and make it available for use in the rules.

    59. What does best way to handle exceptions when using Drools?

    Ans:

    The best way to handle the exceptions when using Drools is to use try-catch block around any code that could potentially throw the exception. This will ensure that exception is caught and handled appropriately, and that Drools engine does not get interrupted.

    60. What does significance of @From annotation in Drools?

    Ans:

    The @From annotation is used to specify a source of data that rule should be applied to. This is important in the Drools because it allows to specify exactly which data objects are rule should be run on, and which objects can be safely ignored. This can help to improve the performance and avoid errors.

    61. What does advantages of using Drools Rule Engine over the other similar solutions?

    Ans:

    The Drools Rule Engine is designed to be more efficient and easy to use. It is very scalable,so it can be used in the variety of different situations. The Drools Rule Engine is furthermore more adaptable, making it simple to modify it to meet the requirements of any specific application.

    62. What happens when two conflicting rules fire at a same time?

    Ans:

    In Drools, when two conflicting rules fire at a same time, rule with the higher salience is given priority and is executed first.

    63. What does purpose of the “when” block in a rule?

    Ans:

    The “when” block is used to specify a conditions that must be met in order for rule to be triggered. This is where put the conditions that need to be met in order for a rule to fire.

    64. What does Drool’s performance versus other rule engines like Jess or CLIPS?

    Ans:

    Drools offers the great deal of flexibility and power when compared to the other rule engines. It is more easy to use and configure, and it has lot of features that make it more attractive for use in the wide variety of applications.

    Drools Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

    65. How would debug a rule that isn’t working as expected?

    Ans:

    The first step would be to check a rule syntax to make sure that there are no errors. After that, would want to test the rule by running it on known set of data to see if expected results are produced. If the rule still is not working as expected, then would need to debug it by tracing through code to see where the issue is occurring.

    66. What does working memory in Drools?

    Ans:

    Working Memory: Place where the facts are stored. Facts can be inserted/updated/removed from a working memory. Inference Engine: It matches Rules in Rule Base with the Facts in a Working Memory . Drool uses a Rete Algorithm to perform this matching.

    67. How do write a drool file?

    Ans:

    Drools – Rules Writing

    Package: Each Rule starts with the package name. The package acts as namespace for Rules.

    Import statement: Whatever facts want to apply the rule on, those facts needs to be imported. For example, com.

    Rule Definition: It consists of a Rule Name, the condition, and Consequence.

    68.Difference between update and modify in Drools?

    Ans:

    • Update Notifies a engine that a fact was changed from one or more sets.
    • Modify Groups several property set modifications and notifies a engine in one operation

    69. When not to use Drools?

    Ans:

    A memory-constrained environment, if the project is a one-time effort that will not be reused or maintained over time. Drools has a steep learning curve. As a result, developers must be cognizant of syntax and rule execution.

    70. What does UPDATE method in Drools?

    Ans:

    In Drools when invoke update() or modify() on given object it will trigger revaluation of all patterns of matching object type in knowledge base.

    71.What does eval do in Drools?

    Ans:

    Using the eval is first and foremost a code smell in a Drools and an indication that solution should be rethought.

    72. How does test Drools rules?

    Ans:

    • Create KIE session.
    • Load rules into a session.
    • Load facts into a session.
    • “Execute” session.
    • Capture resulting working memory and return it.

    73.What does Drools run time?

    Ans:

    A Drools runtime is the collection of JARs on file system that represent a one specific release of the Drools project JARs. To create runtime, must point the IDE to the release of the choice.

    74. What does operator precedence in Drools?

    Ans:

    Operator precedence in a Drools (largely) follows Java operator precedence. Ands (&) are evaluated before ors (|), which are evaluated before a logical ands (&&), which are evaluated before a logical ors (||). Either of these rules may be activated, depending on the model.

    75. What does alternative to Drools?

    Ans:

    Decisimo is the powerful platform that allows to make business decisions more efficiently. It allows to easily create and update decision tables and rule sets, and tailor them to needs. The platform has drag-and drop builder that allows to design decision flows.

    76.What does Drools framework in Java?

    Ans:

    The Business Rules Management System (BRMS) solution is called Drools. It provides the fundamental Business Rules Engine (BRE), full runtime support for Decision Model and Notation (DMN) models at Conformance level 3, an Eclipse IDE plugin for core development, and the Drools Workbench online writing and rules management tool.

    77. Where does are Drools rules stored?

    Ans:

    The rules are stored in Postgres database table called RULES_TBL and loaded into the Drools at runtime.

    78. What does rule based engine for Drools?

    Ans:

    A rules engine (RE) is the module that automates a management of certain highly variable processes. The fundamental concept consists of separating objects that are involved in processes from logic that implements those processes. The logic is defined by a writing rules.

    79. What does rule engine of Docker Drools?

    Ans:

    Drools is the Business Rules Management System(BRMS). It provides the rule engine to that helps to separate a business logic from code. And can write the code in drl file or excel file and use it in program. But drools provides much better way of doing this.

    80. What does different types of Drools?

    Ans:

    Types of the Drool tool are:

    • Drools Guvnor
    • Drools Flow
    • Drools Fusion
    • Drools Expert
    • Drools, Planner.

    81. How does Drools work?

    Ans:

    The Drools rule engine stores, analyses, and evaluates data in order to carry out the defined business rules or decision models. A Drools rule engine’s primary duty is to compare incoming data, or facts, to the requirements of rules in order to decide if and how to execute rules.

    82. What does Algorithms used for Pattern Matching ?

    Ans:

    • Rete Algorithm
    • Leaps Algorithm
    • Linear Algorithm
    • Treat Algorithm.

    83. What does Disadvantages of Rules Engine?

    Ans:

    • Lots of learning effort requires by a developers to know this method of programming
    • Rule engine is not secure method to troubleshoot issues.
    • Needs to understand working of rule engine to consumes more memory
    • There are the wide set of rules for complex branching.

    84. What does Rule Engine?

    Ans:

    Drools is Rule Engine or Production Rule System that uses rule-based approach to implement and Expert System. Expert Systems are knowledge-based systems that use the knowledge representation to process acquired knowledge into knowledge base that can be used for reasoning.

    85. What does Applications of Drools?

    Ans:

    • Validate a timesheets of employees and make payrolls.
    • Simplify the claim settlements of employees for insurance and others.
    • Manage sales pipeline from first contact to sale’s closing.

    86. Why using Drools Rule Engine ?

    Ans:

    • Logic and Data Separation
    • Speed and Scalability
    • Centralization of Knowledge
    • Tool Integration
    • Understandable Rules.

    87. What does Drools Guvnor?

    Ans:

    It provides us with the centralized repository with a layer of user authentication in which can store and manage our rules, processes, models, and other entities related to the knowledge bases.

    89. What does Drools categories?

    Ans:

    Drools can be divided into 2 catagories:

    Authoring: It refers to creation of Rules files (.DRL files).

    Runtime: It means creation of working memory as well as handling of activation.

    90. What does Backward vs.Forward Chaining?

    Ans:

    There are two methods of an execution for rule system:

    Forward Chaining: To begin, with forward chaining, begin to analyze data and make the way towards a specific conclusion/decision.

    Backward Chaining: First take a decision and then check if decision is true or not by backtracking through the sequence of events or facts.

    91. What does Bpm?

    Ans:

    BPM as control field is the obligation of every strategic government manager. It’s to ensure that enterprise performs properly of their middle business methods. This includes the expertise what values business enterprise provides and how the ones are finished. This means analyzing, documenting and improving a way that humans and structures paintings collectively.

    92. What does Features Of Jboss Enterprise Web Platform?

    Ans:

    The JBoss Enterprise Web Platform is a software infrastructure that supports a walking of BRMS additives.

    93. What does Features Of Jboss Enterprise Application Or Soa Platform?

    Ans:

    It is utility software program structure in machine that helps going for a walks of BRMS additives.

    94. Who Use Business Rules Engine?

    Ans:

    Drools experts use Business Rules Engine thru Rete set of rules and Drools Rule Language (DLR).

    95. Is Graphical Process Designer (gpd) Only Useable In Eclipse? Is There Way To Use It Standalone?

    Ans:

    The jBPM GPD is eclipse plugin that goals utilization by more than one roles. Both the enterprise analyst and developer are capable of use identical device in extraordinary ways. The main reason why suppose it is essential to combine those in a one unmarried surroundings is because in more groups, these roles are executed by one person.

    96. What does advantages of jBPM?

    Ans:

    jBPM is lightweight, fully open-source and written in a Java language.

    jBPM makes a possible to model complex workflows using a graphical designer. The graphical designer helps the non-developers to design business processes and provides the much better view of the state of process at runtime.

    jBPM Workflow definitions contain a workflow graph along with Java code which performs the actions triggered by a workflow. New workflows definitions do not affect existing processes.

    97. Distinguish Difference between Drools Vs.jBPM

    Ans:

    And can use Drools for local decisions that only require the handful of rules.

    jBPM is the business management suite which makes an interaction between humans and services into the machine that fulfills a well-defined, complex business process goal.

    98. What does Workbench in jBPM?

    Ans:

    The workbench is the web-based application that combines all of the web-based tools into a one configurable solution.

    99. What does Process Designer in jBPM?

    Ans:

    The web-based jBPM Designer enables business processes to be modelled in a web-based setting. It’s designed with business users in mind and provides a drag-and-drop graphical editor for examining and altering business processes. The round-tripping between the Eclipse editor and web-based designer is supported. Additionally, it aids in process simulation.

    100. What are the features of jBPM?

    Ans:

    jBPM offers graphical process modeling, a powerful workflow engine, integration with rule engines, and seamless connections to external systems. It enables task assignment, monitoring, and analytics, while supporting customization and security, along with adaptability to various cloud environments, all backed by an active open-source community.

    Are you looking training with Right Jobs?

    Contact Us
    Get Training Quote for Free