Drools is a Rule Engine that uses the rule-based approach to implement an Expert System
The inference engine matches the rules against the facts (objects) in memory and can match the next set of rules based on the changed facts.
Please use the presentation and the source code referred in the presentation to get started on what a rule engine is and how to use JBoss Drools for inference based rules using the Java programming language.
MongoDB World 2015 - A Technical Introduction to WiredTigerWiredTiger
MongoDB 3.0 introduces a new pluggable storage engine API and a new storage engine called WiredTiger. The engineering team behind WiredTiger team has a long and distinguished career, having architected and built Berkeley DB, now the world's most widely used embedded database. In this talk we will describe our original design goals for WiredTiger, including considerations we made for heavily threaded hardware, large on-chip caches, and SSD storage. We'll also look at some of the latch-free and non-blocking algorithms we've implemented, as well as other techniques that improve scaling, overall throughput and latency. Finally, we'll take a look at some of the features we hope to incorporate into WiredTiger and MongoDB in the future.
MongoDB World 2015 - A Technical Introduction to WiredTigerWiredTiger
MongoDB 3.0 introduces a new pluggable storage engine API and a new storage engine called WiredTiger. The engineering team behind WiredTiger team has a long and distinguished career, having architected and built Berkeley DB, now the world's most widely used embedded database. In this talk we will describe our original design goals for WiredTiger, including considerations we made for heavily threaded hardware, large on-chip caches, and SSD storage. We'll also look at some of the latch-free and non-blocking algorithms we've implemented, as well as other techniques that improve scaling, overall throughput and latency. Finally, we'll take a look at some of the features we hope to incorporate into WiredTiger and MongoDB in the future.
데브시스터즈의 Cookie Run: OvenBreak 에 적용된 Kubernetes 기반 다중 개발 서버 환경 구축 시스템에 대한 발표입니다.
Container orchestration 기반 개발 환경 구축 시스템의 필요성과, 왜 Kubernetes를 선택했는지, Kubernetes의 개념과 유용한 기능들을 다룹니다. 아울러 구축한 시스템에 대한 데모와, 작업했던 항목들에 대해 리뷰합니다.
*NDC17 발표에서는 데모 동영상을 사용했으나, 슬라이드 캡쳐로 대신합니다.
Postgres expert Saurabh Shelar goes through the features and a live demo of EDB Postgres Failover Manager (EFM). You don’t want to miss this!
EDB Postgres Failover Manager (EFM) is a high-availability module from EnterpriseDB that enables a Postgres Master node to automatically failover to a Standby node in the event of a software or hardware failure on the Master.
Saurabh will cover key features of EDB Postgres Failover Manager and Demo Failover scenarios.
Highlights Include:
- Tuneable Properties for User Environment
- Supported Failover Scenarios
- A step by step demo
Action Jackson! Effective JSON processing in Spring Boot ApplicationsJoris Kuipers
JSON processing plays an important role in nearly all applications nowadays, and Jackson is the de-facto standard library for that. Most developers are therefore familiar with using it for simple (un)marshalling purposes, but never go beyond the basics. In this session Joris will show how to effectively configure and use Jackson, focusing on Spring Boot applications. Boot provides a lot of support for configuring ObjectMappers, which you can use directly but are also used internally by the framework for e.g. handling HTTP requests/responses or message conversion. Topics will include tuning mappings, using modules, applying views and using alternative parsing options like JSON Pointer and JsonPath, all illustrated through live demos. Don’t miss out on this presentation and become an Action Jackson yourself!
JSONB in PostgreSQL is one of the main attractive feature for modern
application developers, no matter what some RDBMS purists are thinking.
People often use simple one-column-json schema for their projects and rely
on ability of database to store,index and query json. Postgres has long
history of supporting the non-structured data and has pioneered the
adoption of JSON by relational databases, so eventually JSON became and
official feature (SQL/JSON) of SQL standard.
MongoDB WiredTiger Internals: Journey To TransactionsMydbops
MongoDB has adapted transaction feature (ACID Properties) in MongoDB 4.0. This talk focuses on the internals of how MongoDB adapted the ACID properties with Weird Tiger Engine. Weird tiger offers more future possibilities for MongoDB. This tech talk was presented at Mydbops Database Meetup on 27-04-2019 by Manosh Malai Senior Devops/NoSQL Consultant with Mydbops and Ranjith Database Administrator with Mydbops.
You may be hearing a lot of buzz around functional programming. For example, Java 8 recently introduced new features (lambda expressions and method references) and APIs (Streams, Optional and CompletableFutures) inspired from functional ideas such as first-class functions, composition and immutability.
However, what does this mean for my existing codebase?
In this talk we show how you can refactor your traditional object-oriented Java to using FP features and APIs from Java 8 in a beneficial manner.
We will discuss:
- How to adapt to requirement changes using first-class functions
- How you can enhance code reusability using currying
- How you can make your code more robust by favouring immutability over mutability
- How you can design better APIs and reduce unintended null pointer exceptions using an optional data type"
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개if kakao
황민호(robin.hwang) / kakao corp. DSP개발파트
---
최근 Spring Cloud와 Netflix OSS로 MSA를 구성하는 시스템 기반의 서비스들이 많아지는 추세입니다.
카카오에서도 작년에 오픈한 광고 플랫폼 모먼트에 Spring Cloud 기반의 MSA환경을 구성하여, API Gateway도 적용하였는데 1년 반 정도 운영한 경험을 공유할 예정입니다. 더불어 MSA 환경에서는 API Gateway를 통해 인증을 어떻게 처리하는지 알아보고 OAuth2 기반의 JWT Token을 이용한 인증에 대한 이야기도 함께 나눌 예정입니다.
데브시스터즈의 Cookie Run: OvenBreak 에 적용된 Kubernetes 기반 다중 개발 서버 환경 구축 시스템에 대한 발표입니다.
Container orchestration 기반 개발 환경 구축 시스템의 필요성과, 왜 Kubernetes를 선택했는지, Kubernetes의 개념과 유용한 기능들을 다룹니다. 아울러 구축한 시스템에 대한 데모와, 작업했던 항목들에 대해 리뷰합니다.
*NDC17 발표에서는 데모 동영상을 사용했으나, 슬라이드 캡쳐로 대신합니다.
Postgres expert Saurabh Shelar goes through the features and a live demo of EDB Postgres Failover Manager (EFM). You don’t want to miss this!
EDB Postgres Failover Manager (EFM) is a high-availability module from EnterpriseDB that enables a Postgres Master node to automatically failover to a Standby node in the event of a software or hardware failure on the Master.
Saurabh will cover key features of EDB Postgres Failover Manager and Demo Failover scenarios.
Highlights Include:
- Tuneable Properties for User Environment
- Supported Failover Scenarios
- A step by step demo
Action Jackson! Effective JSON processing in Spring Boot ApplicationsJoris Kuipers
JSON processing plays an important role in nearly all applications nowadays, and Jackson is the de-facto standard library for that. Most developers are therefore familiar with using it for simple (un)marshalling purposes, but never go beyond the basics. In this session Joris will show how to effectively configure and use Jackson, focusing on Spring Boot applications. Boot provides a lot of support for configuring ObjectMappers, which you can use directly but are also used internally by the framework for e.g. handling HTTP requests/responses or message conversion. Topics will include tuning mappings, using modules, applying views and using alternative parsing options like JSON Pointer and JsonPath, all illustrated through live demos. Don’t miss out on this presentation and become an Action Jackson yourself!
JSONB in PostgreSQL is one of the main attractive feature for modern
application developers, no matter what some RDBMS purists are thinking.
People often use simple one-column-json schema for their projects and rely
on ability of database to store,index and query json. Postgres has long
history of supporting the non-structured data and has pioneered the
adoption of JSON by relational databases, so eventually JSON became and
official feature (SQL/JSON) of SQL standard.
MongoDB WiredTiger Internals: Journey To TransactionsMydbops
MongoDB has adapted transaction feature (ACID Properties) in MongoDB 4.0. This talk focuses on the internals of how MongoDB adapted the ACID properties with Weird Tiger Engine. Weird tiger offers more future possibilities for MongoDB. This tech talk was presented at Mydbops Database Meetup on 27-04-2019 by Manosh Malai Senior Devops/NoSQL Consultant with Mydbops and Ranjith Database Administrator with Mydbops.
You may be hearing a lot of buzz around functional programming. For example, Java 8 recently introduced new features (lambda expressions and method references) and APIs (Streams, Optional and CompletableFutures) inspired from functional ideas such as first-class functions, composition and immutability.
However, what does this mean for my existing codebase?
In this talk we show how you can refactor your traditional object-oriented Java to using FP features and APIs from Java 8 in a beneficial manner.
We will discuss:
- How to adapt to requirement changes using first-class functions
- How you can enhance code reusability using currying
- How you can make your code more robust by favouring immutability over mutability
- How you can design better APIs and reduce unintended null pointer exceptions using an optional data type"
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개if kakao
황민호(robin.hwang) / kakao corp. DSP개발파트
---
최근 Spring Cloud와 Netflix OSS로 MSA를 구성하는 시스템 기반의 서비스들이 많아지는 추세입니다.
카카오에서도 작년에 오픈한 광고 플랫폼 모먼트에 Spring Cloud 기반의 MSA환경을 구성하여, API Gateway도 적용하였는데 1년 반 정도 운영한 경험을 공유할 예정입니다. 더불어 MSA 환경에서는 API Gateway를 통해 인증을 어떻게 처리하는지 알아보고 OAuth2 기반의 JWT Token을 이용한 인증에 대한 이야기도 함께 나눌 예정입니다.
The RuleML Perspective on Reaction Rule StandardsAdrian Paschke
Presentation about Reaction RuleML at the Ontology, Rules, and Logic Programming for Reasoning and Applications (RulesReasoningLP) Session at the Ontolog Forum, 9 January 2014
Obtener información sobre la actividad de la red y mantenerse al tanto del registro del firewall es una tarea desafiante ya que la herramienta de seguridad genera una gran cantidad de registros de tráfico. Presentamos Firewall Analyzer, un software de gestión de configuraciones y análisis de registros que permite a los administradores de redes comprender cómo se usa el ancho de banda en su red. Firewall Analyzer es independiente del proveedor y es compatible con casi todos los firewalls de red de código abierto y comercial como Check Point, Cisco, Juniper, Fortinet, Palo Alto y más.
Pl sql office hours data setup and teardown in database testingDeeptiBandari
Testing pl/sql code and challenges that come with setting up and tearing down of data required for tests. Also has soe tips and techniques to overcome the challenges
# Overview of Oracle Database Fundamentals
## Introduction to Oracle, Triggers, and Wrapping
Oracle Database is a powerful and widely used relational database management system (RDBMS). It provides a robust platform for managing large volumes of data efficiently. Key features of Oracle include its ability to handle complex queries, support for multi-user environments, and a comprehensive suite of security measures.
**Triggers** are procedural code executed automatically in response to certain events on a particular table or view in a database. They are essential for maintaining data integrity and enforcing business rules. **Wrapping** in Oracle refers to the process of encoding PL/SQL source code to protect it from unauthorized viewing and tampering.
## Functions/Responsibilities of a DBA
A Database Administrator (DBA) is responsible for the overall management and maintenance of a database system. Key responsibilities include:
- **Installation and Configuration**: Setting up Oracle databases, including installing the software and configuring database instances.
- **Performance Monitoring**: Continuously monitoring database performance to ensure optimal operation and identifying potential issues.
- **Backup and Recovery**: Implementing and managing backup procedures to protect data against loss and ensuring the ability to recover data in case of hardware failures or other disasters.
- **Security Management**: Ensuring that the database is secure from unauthorized access by managing user permissions and roles.
- **Troubleshooting**: Diagnosing and resolving database issues, including performance bottlenecks, connectivity problems, and data corruption.
## Oracle Product Details
Oracle offers a range of products and editions to meet different needs, from small applications to large enterprise systems. Key products include:
- **Oracle Database Standard Edition**: Suitable for small to medium-sized businesses, offering essential database features at a lower cost.
- **Oracle Database Enterprise Edition**: Provides advanced features, including high availability, performance optimization, and security enhancements, ideal for large enterprises.
- **Oracle Cloud**: Oracle's cloud services, including Autonomous Database, which offers self-driving, self-securing, and self-repairing capabilities.
## Oracle Files, System, and User Processes
Oracle database architecture consists of several key components:
- **Control Files**: These files contain metadata about the database structure, including the database name, timestamps, and pointers to data files and redo log files.
- **Data Files**: Store the actual data within the database.
- **Redo Log Files**: Record all changes made to the data, enabling recovery in case of a failure.
- **System Processes**: Manage tasks such as memory allocation, I/O operations, and process scheduling.
- **User Processes**: Handle interactions between the user applications and the database.
Similar to JBoss Drools - Pure Java Rule Engine (20)
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
2. Agenda
2
1. Introduction to Knowledge based Rule Engine
2. Basics of Drools rules
3. Drools Operators
4. Drools Conditional Elements
5. The problem - Fire Alarm Management System
6. Drools Demo
7. How to control execution of rules - timers
8. Drools integration into Java - using knowledge agent,
changeset
9. Introduction to decision tables
10. Introduction to Drools Flow for workflow
11. A very brief introduction to Drools Guvnor, Fusion and
Planner
3. Rule Engine?
3
Drools is a Rule Engine that uses the rule-
based approach to implement an Expert
System
A Production Rule is a two-part structure using
First Order Logic for reasoning over
knowledge representation.
The inference engine matches the rules
against the facts (objects) in memory
when
<conditions>
then
<actions>;
4. Rule Engine?
4
•The rules are loaded into production memory and are available at all times
•Facts are asserted into the Working Memory where they may then be modified
or retracted.
•The Agenda manages the execution order of the conflicting rules using a
conflict resolution strategy.
•The rules might be in conflict when more than 1 rule matches the same set of
facts in working memory
5. Backward Vs Forward Chaining
5
A forward chaining engine looks at the facts
and derives a conclusion
Consider a scenario of medical diagnosis => If
the patient’s symptoms are put as facts into
working memory, then we can diagnose him with
an ailment.
When
nasal congestion
&& fever
&& body ache
Then
Influensa
Working memory
1. body ache
2. Fever
3. Nasal
congestion
INFLUENZA
6. Backward Vs Forward Chaining
6
A backward chaining engine has the “goal”
specified and the engine tries to satisfy it.
Consider the same scenario of medical diagnosis =>
if there is an epidemic of a certain disease, this AI
could presume a given individual had the disease
and attempt to determine if its diagnosis is correct
based on available information.
Goal
Influensa
Sub-goal
nasal congestion
fever
body ache
Working memory
1. body ache
2. fever
NO INFLUENZA
7. Drools Basics
7
Knowledge Sessions
Stateless
Doesn’t maintain reference to objects after first call and can be thought of as plain
functions
Typical use cases include validation, routing etc
Stateful
Longer lived, maintain reference to objects and allow iterative changes over time
Typical use cases include diagnostics, monitoring etc
In contrast to a Stateless Session, the dispose() method must be called afterwards
to ensure there are no memory leaks.
Facts
Facts are objects that are inserted/modified/retracted from working memory AND is
the data on which the rules act.
"logicalInsert" => Here the fact is logically inserted, this fact is dependant on the truth
of the "when" clause. It means that when the rule becomes false the fact is
automatically retracted.
A rule while firing can change the state of the working memory thereby causing other
rules to fire.
8. Sample Drools Rule
8
When part
package com.anil.drools.service
import com.anil.drools.model.Fire;
import com.anil.drools.model.Alarm;
global Logger LOGGER;
rule "Raise the alarm when there is at least 1 Fire"
salience 100
lock-on-active true
when
exists Fire()
then
insert (new Alarm());
LOGGER.debug( "Raised the alarm because at least 1
Fire() object exists in the session" );
end
Rule Name
Attributes
Then part
Package Name
(Must be 1st element if
declared)
Import java types
(referenced by rules)
Global variables
9. Rule Attributes
9
Rule attributes provide a declarative way to
influence the behavior of the rule.
no-loop
When a rule's consequence modifies a fact it may cause the rule
to activate again, causing an infinite loop.
lock-on-active
This is a stronger version of no-loop, because the change could
now be caused not only by the rule itself but by other rules too.
Salience
Salience is a form of priority where rules(all of whom match) with
higher salience values are given higher priority when ordered in
the Activation queue.
agenda-group
Only rules in the agenda group that has acquired the focus are
allowed to fire.
Refer to Drools documentation for additional attributes
10. Drools Operators
10
< <= > >=
Person( firstName < $otherFirstName )
[not] matches (against Java regex)
Cheese( type matches "(Buffalo)?S*Mozarella" )
[not] contains (check field within array/collection)
CheeseCounter( cheeses contains "stilton" )
soundslike
// match cheese "fubar" or "foobar"
Cheese( name soundslike 'foobar' )
str
Message( routingValue str[startsWith] "R1" )
[not] in
Cheese( type in ( "stilton", "cheddar", $cheese ) )
11. Drools Conditional Elements
11
and / or
Cheese( cheeseType : type ) and Person( favouriteCheese ==
cheeseType )
Cheese( cheeseType : type ) or Person( favouriteCheese ==
cheeseType )
not
not Bus(color == "red")
exists
exists Bus(color == "red")
forall
forall( $bus : Bus( type == 'english')
Bus( this == $bus, color = 'red' ) )
eval
eval( p1.getList().containsKey( p2.getItem() ) )
12. Drools Conditional Elements
12
from
$order : Order()
$item : OrderItem( value > 100 ) from $order.items
collect
$system : System()
$alarms : ArrayList( size >= 3 ) from collect( Alarm( system ==
$system, status == 'pending' ) )
accumulate
$order : Order()
$total : Number( doubleValue > 100 ) from accumulate( OrderItem(
order == $order, $value : value ), sum( $value ) )
weeklyVariance : Number( ) from accumulate (Number(
valueReturned : doubleValue) from ruleVO.varianceList,
sum(valueReturned))
13. The Problem!!
13
Fire Alarm Mgmt System
Everyone is happy if there is no fire
If there is fire in any room, set an alarm
If there is fire in a room, turn ON sprinkler for that
room
Once the fire extinguishes, turn OFF sprinkler for
that room
If there is NO fire and sprinklers are off; tell
everyone to get back to being happy
15. Using Timers
15
Rules support both interval and cron based
timers modeled on Quartz.
rule "Send SMS every 15 minutes"
timer (cron:* 0/15 * * * ?)
when
$a : Alarm( on == true )
then
channels[ "sms" ].insert( new Sms( $a.mobileNumber, "The alarm is
still on" );
end
16. More On Deploying
16
Changesets
Configuration to build the knowledgebase
Use an XML that contains a list of resources and
can contain reference to another changeset
(recursive changesets)<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-
api/src/main/resources/change-set-1.0.0.xsd' >
<add>
<resource source='http://fqng-app02-dev-jboss:8080/drools-
guvnor/org.drools.guvnor.Guvnor/package/fqAlarmWorkflow/LATEST'
type='PKG' basicAuthentication=‘enabled’ username=‘admin’ password=‘’/>
</add>
</change-set>
17. Knowledge Agents
17
The Knowlege Agent provides automatic loading,
caching and re-loading of resources and is configured
from a properties files OR
KnowledgeAgentConfiguration.
A KnowledgeAgent object will continuously scan all
the added resources, using a default polling interval
of 60 seconds(can be changd) and, when some last
modification date is updated, it will applied the
changes into the cached Knowledge Base using the
new resources.
For polling to occur, the polling and notifier services
must be started.
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
18. Decision Tables
18
Managing rules in a spreadsheet format
In a decision table each row is a rule, and
each column in that row is either a condition or
action for that rule.
RuleSet com.anil.drools.decisiontable
Import
com.anil.drools.model.decisiontable.Driver,
com.anil.drools.model.decisiontable.Policy
Variables
Notes Decision tables for policy prices
RuleTable policy prices
POLICY NAME CONDITION CONDITION CONDITION CONDITION ACTION ACTION
$driver : Driver $policy : Policy
age >=$1 && age<=$2 locationRiskProfile numberOfPriorClaims policyType $policy.setPolicyBasePrice($param); System.out.println("$param");
Name Driver Age Bracket Location Risk Profile Number of Prior Claims Insurance Policy Type Base $ price Reason
Young Safe driver
18,24 LOW 1 COMPREHENSIVE 490.00 1 prior claims
18,24 MED FIRE_THEFT 56.00 Fire theft medium
18,24 MED COMPREHENSIVE 700.00 Comprehensive medium
18,24 LOW 2 FIRE_THEFT 250.00 2 prior claims
18,24 LOW 0 COMPREHENSIVE 400.00 Safe driver discount
Mature Drivers
25,60 LOW 1 COMPREHENSIVE 420.00 mature - 1 prior claims
25,60 MED FIRE_THEFT 37.00 mature - Fire theft medium
25,60 MED COMPREHENSIVE 645.00 mature - Comprehensive medium
25,60 LOW 2 FIRE_THEFT 234.00 mature - 2 prior claims
25,60 LOW 0 COMPREHENSIVE 356.00 mature - Safe driver discount
19. Drools Flow
19
Drools flow is used in conjuction with Drools Expert to
specify the flow of business rules.
The nodes are specified by the ruleflow-group rule
attribute.
As of Drools 5, Drools flow is going to be combined with
jBPM and is renamed as jBPM 5.0.
20. Other Drools Offerings
20
Guvnor
Guvnor is the Drools business rule management
system that allows people to manage rules in a multi
user environment, it is a single point of truth for your
business rules, allowing change in a controlled
fashion, with user friendly interfaces.
The Guvnor combined with the core drools engine
and other tools forms the business rules manager.
The data can be stored with multiple persistence
schemas (file, database etc) using the JackRabbit
JCR (Java content repository) as the underlying
implementation.
Guvnor offers versioning of rules, authentication and
authorization to limit users to what they can do.
21. Other Drools Offerings
21
Planner
Drools Planner optimizes planning problems. It solves use cases,
such as:
Employee shift rostering: rostering nurses, repairmen, …
Agenda scheduling: scheduling meetings, appointments, maintenance jobs,
advertisements, …
Educational timetabling: scheduling lessons, courses, exams, conference
presentations, ...
Fusion
Drools Fusion supports complex event processing
It deals with the tasks of handling multiple events nearly at real-
time with the goal of identifying the meaningful events within the
event cloud.
Events, from a Drools perspective are just a special type of fact.
In this way, we can say that all events are facts, but not all facts
are events.
Stateless Knowledge Session examples
1. Validation - Is this person eligible for a mortgage?
2. Calculation - Compute a mortgage premium.
3. Routing and Filtering - Filter incoming messages, such as emails, into folders. Send incoming messages to a destination.
Stateful Knowledge Session examples
1. Monitoring - Stock market monitoring and analysis for semi-automatic buying.
2. Diagnostics - Fault finding, medical diagnostics
3. Logistics - Parcel tracking and delivery provisioning
4. Compliance - Validation of legality for market trades.
Globals are not inserted into the Working Memory, and therefore a global should never be used to establish conditions in rules except when it has a constant immutable value.
If multiple packages declare globals with the same identifier they must be of the same type and all of them will reference the same global value.
All operators have normal Java semantics except for == and !=. The == operator has null-safe equals() semantics i.e. it is equivalent to equals() method.
Soundslike - checks whether a word has almost the same sound (using English pronunciation) as the given value.
str - This operator str is used to check whether a field that is a String starts with or ends with a certain value. It can also be used to check the length of the String.
forall - forall evaluates to true when all facts that match the first pattern match all the remaining patterns. In the above rule, we "select" all Bus objects whose type is "english". Then, for each fact that matches this pattern we evaluate the following patterns and if they match, the forall CE will evaluate to true.
eval - The conditional element eval is essentially a catch-all which allows any semantic code (that returns a primitive boolean) to be executed.
from - from will iterate over all objects in the collection and try to match each of them individually. The rule gets fired for each item that is matched.
collect - Allows us to reason over a collection of objects. In the above example, the rule will look for all pending alarms in the working memory for each given system and group them in ArrayLists. If 3 or more alarms are found for a given system, the rule will fire. The result pattern of collect can be any concrete class that implements the java.util.Collection interface and provides a default no-arg public constructor.
accumulate - Allows a rule to iterate over a collection of objects, executing custom actions for each of the elements, and at the end it returns a result object. Drools ships with the following built-in accumulate functions:
average
min
max
count
sum
collectList
collectSet
You can build your own accumulate functions by implementing org.drools.runtime.rule.AccumulateFunction interface and add a line to the configuration file or set a system property to let the engine know about the new function.
Please refer to the “drools-Example” project for the demo.