Enterprise Informatization LECTURE



Similar documents
BPMN by example. Bizagi Suite. Copyright 2014 Bizagi

A methodology for graphical modeling of business rules

HPC Portal Development Platform with E-Business and HPC Portlets

Integration of an open source rule engine to enhance the IHTSDO Workbench testing

How To Design An Information System

Java Application Developer Certificate Program Competencies

Rule based programming with Drools

How To Use Guvnor On Linux (Web) (Webapp) (Dnu) (Gpl) (Netware) (Demo) (Powerpoint) (Orgode) (Proper) (Programming) (Server

HPC PORTAL DEVELOPMENT PLATFORM

Process Modeling using BPMN 2.0

Quick Guide Business Process Modeling Notation (BPMN)

BPMN Business Process Modeling Notation

Software Engineering Techniques

Business Process Modeling Information Systems in Industry ( )

Programming and Software Development CTAG Alignments

Chapter 13: Program Development and Programming Languages

Building Web Services with Apache Axis2

Chapter 13: Program Development and Programming Languages

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Technical Report. Implementation and Performance Testing of Business Rules Evaluation Systems in a Computing Grid. Brian Fletcher x

Koen Aers JBoss, a division of Red Hat jbpm GPD Lead

User Application: Design Guide

Modeling Guidelines Manual

JBoss Enterprise BRMS Platform 5 BRMS Business Process Management Guide

AP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities

CACHÉ: FLEXIBLE, HIGH-PERFORMANCE PERSISTENCE FOR JAVA APPLICATIONS

IBM Certified BPM Application Developer IBM Business Process Manager Express or Standard Edition V8.5.5

Drools at Intermountain Healthcare. Herman Post Homer Warner Center 5/9/2011

Creating a Simple Business Collaboration Scenario With a BPMS

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Programming Database lectures for mathema

Facebook Twitter YouTube Google Plus Website

Automating Business Processes Using SharePoint Designer

BPMN 2.0 Descriptive Constructs

IBM Operational Decision Manager Version 8 Release 5. Getting Started with Business Rules

Moving from CS 61A Scheme to CS 61B Java

BIS 3106: Business Process Management. Lecture Two: Modelling the Control-flow Perspective

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

Implementing and Maintaining Microsoft SQL Server 2008 Integration Services

Open Source Business Rules Management System Enables Active Decisions

IBM Rational Web Developer for WebSphere Software Version 6.0

TIBCO Business Studio iprocess Implementation Guide. Software Release February 2012

Eclipse Web Tools Platform. Naci Dai (Eteration), WTP JST Lead

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

Audit TM. The Security Auditing Component of. Out-of-the-Box

Drools Complex Event Processing with Twitter4J. Toshiya Kobayashi Red Hat Senior Software Maintenance Engineer

Flexible Engineering Process Automation Process: Continuous Integration & Test

BIRT Application and BIRT Report Deployment Functional Specification

EMC Documentum Business Process Suite

CTI Higher Certificate in Information Systems (Engineering)

Oracle BPM 11g. Hands-On Workshop Lab Guide

1. What are Data Structures? Introduction to Data Structures. 2. What will we Study? CITS2200 Data Structures and Algorithms

Visual Programming of Logic, Motion, and Robotics

Rules and Business Rules

Introduction to Programming System Design. CSCI 455x (4 Units)

SOA Enabled Workflow Modernization

What is Enterprise Architect? Enterprise Architect is a visual platform for designing and constructing software systems, for business process

An introduction to creating JSF applications in Rational Application Developer Version 8.0

JRules 6.0. from ILOG

Mobile App Design Project #1 Java Boot Camp: Design Model for Chutes and Ladders Board Game

2667A - Introduction to Programming

ActiveVOS Server Architecture. March 2009

IBM Business Process Manager Version 8 Release 5. Hiring Tutorial

Course MS10975A Introduction to Programming. Length: 5 Days

Oracle WebLogic Server 11g Administration

Windows Scheduled Task and PowerShell Scheduled Job Management Pack Guide for Operations Manager 2012

CONFIGURATION AND APPLICATIONS DEPLOYMENT IN WEBSPHERE 6.1

Information Systems Analysis and Design CSC John Mylopoulos. Software Architectures Information Systems Analysis and Design CSC340

TeamCity A Professional Solution for Delivering Quality Software, on Time

Algorithms, Flowcharts & Program Design. ComPro

Business Process Management

Building an Agile PLM Web Application with JDeveloper and Agile 93 Web Services

CERTIFIED MULESOFT DEVELOPER EXAM. Preparation Guide

Monitoring BPMN-Processes with Rules in a Distributed Environment

JIRA Administration Best Practices

#820 Computer Programming 1A

The Business Process Model

Oracle BPA Suite: Model and Implement Business Processes Volume I Student Guide

A Rules Engine Experiment: Lessons Learned on When and How to use a Rules-Based Solution

IBM WebSphere Operational Decision Management Improve business outcomes with real-time, intelligent decision automation

Instructional Design Framework CSE: Unit 1 Lesson 1

Java (12 Weeks) Introduction to Java Programming Language

BCS Higher Education Qualifications. Professional Graduate Diploma in IT. Programming Paradigms Syllabus

Business Process Modeling with BPMN. Dr. Darius Šilingas Head of Solutions Department

How To Apply Software Archeology To Your Development Process

Software Development In the Cloud Cloud management and ALM

Integration of Application Business Logic and Business Rules with DSL and AOP

Building the European Biodiversity. Observation Network (EU BON)

Oracle SOA Suite Then and Now:

Business Process Modeling with Structured Scenarios

Installation and Configuration Manual

Masters programmes in Computer Science and Information Systems. Object-Oriented Design and Programming. Sample module entry test xxth December 2013

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

IBM Business Process Manager Version 8 Release 5. Hiring Tutorial IBM

Transcription:

Enterprise Informatization LECTURE Piotr Zabawa, PhD. Eng. IBM/Rational Certified Consultant e-mail: pzabawa@pk.edu.pl www: http://www.pk.edu.pl/~pzabawa/en 07.10.2011

Lecture 2 Business Process Modeling with the aid of BPMN in Jboss Drools environment

Literature Software Engineering Section This lecture (Lecture 2) was created on the basis of the following books: Bali M., Drools JBoss Rules 5.0. Developers Guide, Packt Publishing 2009. and on the basis of JBoss Drools documentation. Browne P., JBoss Drools Business Rules, Packt Publishing 2009.

BPMN2 diagram elements Only the elements of BPMN2 available in JBossDrools 5.1 will be presented here in order to make Drools learning curve more steep. Next part of the lecture is dedicated to configuration of Drools in Eclipse. Simple projects creation is also explained. The more advanced example a banking case-study is also elaborated to illustrate all practical problems specific for working with Drools as well as their solutions.

Start/End Software Engineering Section Start the only process or sub-process starting point. No entry point, exactly one exit point. End one of possibly many process or sub-process ends. Exactly one enrty point, no exit points.

Gateways Software Engineering Section Diverge (Split) the place of process splitting into many paths (flows, branches). AND flow into all branches at the same time OR flow into all branches recognized as true XOR only one branch must be chosen Converge (Join) place of joining many branches into one AND continuation after finishing all branches XOR continuation after finishing the first branch

Tasks Software Engineering Section Rule covers the group of business rules for exetution during this task Script a code block for execution during this task User Task task that requires manual business process handling by a business worker Subprocess the process element used for decomposition of complex process or reused

Service Tasks Software Engineering Section Log - built into Drools file logging service Email built into Drools e-mail notification service

Events Software Engineering Section Timer event triggered by timer Error event triggered by an error Message event triggered by a message

Sub-Process Software Engineering Section Sub-Process used for modeling subprocesses embeded in a process. Subprocess has access to all its parent process data but not vice-versa. Like a process it must have one starting point and may have many end points.

Multiple Instances Software Engineering Section Multiple Instances used to mark multiple execution of a subprocess placed in this container.

Advanced model sample

Advanced model sample

Advanced model sample

Disadvantages of traditional approach Disadvantages of traditional approach: Software Engineering Section if (customer.getlevel() == Level.Gold){ // coś dla Gold } else if (customer.getlevel==level.silver){ if (customer.getaccounts()==null){ // coś dla Silver, który nnie ma rachunku??? } else{ for(account account : customer.getaccounts()) if (account.getbalance<0){ // coś dla Silver mającego konto z debetem } else if (account.getbalance>=0 and account.getbalance()<=1000){} else if (account.getbalance>1000 and account.getbalance()<=100000){} else if (account.getbalance>100000 and account.getbalance()<=500000){} // } } How to handle business logic changes in such a structural code?

Solution of the problem It is better to decompose the structural problem into a set of independent conditions: if Customer(level==Level.Silver) and no Account if Customer(level==Level.Silver) and has Account debit if Customer(level==Level.Silver) and has Account less then 1000 //

Motivation for business rules Advantages Disadvantages When not to apply

Business rules - advantages Easy for understanding by business analyst and new developer Easy to focus on the problem s essence what not how Ease of introduction, deletion of rules Ease of change introduction to the rules High algorithm efficiency Ease of transformation of business analysts requirements into rules

Business rules - advantages Ease of unified mechanism usage while adding orthogonal business responsibilities (compare to Aspect Oriented Programming) for example audit, reporting, event logging Ease of reuse (the same rule in many processes) Independence of sequential processing of rules (in contrast to imperative languages like C++/Java/C#) Ease of rules exectution from processes and/or execution of processes from rules (Drools)

Business rules - advantages Independent lifecycles. Rules and processes are extracted from object-oriented software into separate frequently changing artifacts. Independent change management processes. Ease of embedding Drools in applications

Business rules - disadvantages Mental problems among the programmers different way of thinking in case of declarative languages Difficulties in finding and elimination of errors in rules/processes Diffilulties in full debugging of rules without deep knowledge of business rules engine s detailed way of working

Business rules - advantages High memory resources requirement Theoretical danger of recursion (especially in case of modeling to-be) in case of changing common data by at least two rules. In such case we do not know what is wrong process design or rule implementation.

Business rules when not? If less then 20 rules If business logic changes rarely If business rules are simple and/or are working on one object ony If in pseudo-code the nesting level of conditional instructions is less then 3 If software is created temporarely and will not evolve If there are not enough resources to handle business rules

Drools Software Engineering Section This software is BLiP (Business Logic integration Platform). We will be using only three of them: Drools Expert silnik reguł biznesowych Drools Flow silnik procesów biznesowych Drools Fusion zdarzenia biznesowe

Drools IDE installation Software Engineering Section The installation steps of the whole JBossTools IDE containing Drools plugins as well as Java EE WTP platform are desribed on: www.pk.edu.pl/~pzabawa/en/business Drools configuration is described in the following document: Konfiguracja środowiska developerskiego Drools

Opisana w pliku: Software Engineering Section Konfiguracja środowiska developerskiego Drools JBossDrools_01_RuntimeSetting.pdf

Drools_HelloWorld samples That are the most simplified samples jst to start with Drools designed to show some useful mechanisms available in Drools engines. Some of them are related to different problems of greetings. They could constitute a base for making experiments with development environment as well as modeling business processes. Futher these introductory mechanisms will be extendet into more complex examples referring to banking systems.

Drools_HelloWorld samples quick overview and start HelloWorld01_ProcessOnly created with the aid of wizard; contains a process with an action and runner class HelloWorld02_RuleOnly created with the aid of wizard; contains rules and runner class HelloWorld03_ProcessAndRule created manualy on the basis of previous two samples; contains both process and rules as well as changed runner class HelloWorld04_ProcessAndDSLRule previous sample adapted to business analysts expectations via application of DSL (Domain-Specific Language)

Drools_HelloWorld samples events and statistical analysis HelloWorld05_RulesAndEvents simple programm showing how to write an event-driven greeting HelloWorld06_StatefullSession more complex sample showing how to make statistical analysis of facts located in knowledge base with the aid of Drools query HelloWorld07_DroolsTypeDeclaration quite complex sample which contains statistical analysis of business events (no time frames) HelloWorld08_DRL2JavaPropagation previous sample enriched by access to native Drools class with the aid of Java reflection

Drools_HelloWorld samples events in time axe (CEP) HelloWorld09_? uzupełnić! HelloWorld10_? uzupełnić! Software Engineering Section

Przykłady Drools_HelloWorld architektura HelloWorld11_BusinessRulesEngine przykład pokazujący jak w sposób nie naiwny korzystać w aplikacji z silnika reguł biznesowych ukrytego za interfejsem uzupełnić! HelloWorld12_BusinessProcessEngine przykład ilustrujący możliwość ukrycia przed aplikacją procesu biznesowego za interfejsem uzupełnić! Software Engineering Section

New project creation instructions The way of creation of a new project containing a process is described in the file: JBossDrools_02_ProjectCreationWizard.pdf

Drools_HelloWorld samples The way of execution of a sample containing a process is described in the following file: JBossDrools_03_ProjectWorkflowExecution.pdf

Business rules engine concept Sample simple business rule: package droolsbook; rule basic rule when // condition(s) albo LHS Account ( balanace < 100 ) then // consequence albo RHS System.out.println( Account balance is less then 100 ); end

Business rules engine concept Sample cont. fact as a Java (POJO) bean: package droolsbook; public class Account{ } private long balance; public long getbalance(){ return balance; } public void setbalance(long balance){ } this.balance = balance; @Override public boolean equals(final Object other){// } @Override public int hashcode(){// } @Override public String tostring(){// } Software Engineering Section

Business rules engine concept Description based on the previous sample. The client class performs the following steps: Creates knowledge base object Places resources in this object (business rules in this case) Creates session object (statefull or stateless) Creates an object of Account class Places Account class object in session object Runs rules Builder design pattern is used for Drools objects creation. More detailed information can be found in Drools_HelloWorld samples. Software Engineering Section

Business rules engine concept Description of Drools engine reation: Drools tries to fit each fact (Accoun here) placed in knowledge base session to each condition of each rule located in knowledge base in such a way that these facts fulfill these rules. This process is called pattern matching. If a particular fact fulfills all conditions of a particular rule, then the consequence of this rule is executed for this fact. This way the functionality of a fact is moved from application business logic to the business rule. We can say that we controll objects functionality from oustide.

Business rules engine concept Description of Drools engine reation cont.: If there is more facts and rule conditions of a particular rule are related to more then one fact, then business rules engine fits fact sets in such a way that it finds all combinations of facts that fulfill the rule conditions as a whole facts set. Then the consequence of this rule is executed for each set of facts that fullfilled the rule condition.

Business rules engine concept Rules consequences execution order: The order of rule consequences execution for particluar fats set is not determined the rule engine makes such a decision for us (compare to remarks related to engine disadvantages). There are however some mechanisms in Drools that haelp to influence in some extent to the execution order: Agenda Rule priorities (salience) Rules grouping (activation-group) or (agenda-group) Ruleflow (ruleflow-group)

Business rules language A rule may contain many conditions Account ( balance == 200) Customer (name == John ) A rule can declare variables (declaration only the engine substitutes data) $account : Account ( $type : type ) A rule can use declared variable (for each Account class object we find all Customer class objects with the acount field being previously found Account class object) $account : Account() Customer ( account == $account )

Business rules language Native Java types and other String Regular expression Date Boolean Enum Comments Single line # or // /* block */ Packages and import Software Engineering Section

Business rules language Global variables (declaration, passing to session, consumption in rule) Dialects Java default mvel useful due to shortened notation of rules

Business rules language Operators in rule conditions And Or Not Exists Eval return value restriction (fact method call surrounded by elipses) Inline eval Nested accessors Software Engineering Section

Business rules language Operators in rules conditions cont. This Queues actions Contains Not contains Member of Not member of from

Business rules language Methods in rule consequences Modify (modifies a fact in a session) Insert (places a anew fact in a session) Retract (removes a fact from a session)

Business rules language Rule attributes salience no-loop dialect

The end