Visual Business Rules and Process Modeling
Outline
Intro
Basics
Challenges
Rules in UML
BPMN & BR
HeKatE
ARD & XTT rep
metamodel
future work
Introduction
abstract level of design
-
programming paradigms → different design paradigms
knowledge vs. software engineering
declarative vs. procedural, etc.
UML Trajectory
Example of Booch class diagram | Example of OMT object diagram |
| |
Unified Modeling Language (UML) Today
general-purpose modeling language in the field of software engineering,
13 types of diagrams,
includes a set of graphical notation techniques to create abstract models of specific systems.
model - representation of something, constructed and used for a particular purpose,
metamodel - a model that represents a modeling language,
MOF
MOF Layers
Layers | Content | Example |
| metamodeling lang specification | Meta-Object Facility (MOF) |
| model of metalanguage (language specification) | SQL, UML, XML specifications |
| metadata, syntax & semantic desc | db schema, class model, DTD (def of XML document) |
| data | data in DB, objects (instances), XML documents |
The Object Constraint Language (OCL)
language
declarative language for describing rules that apply to UML models,
a constraint language (OCL 1.4)
+ general object query language (OCL 2.0)
part of
OMG UML standard (may be used with any MOF),
makes a Meta-Object Facility model more precise,
example:
The academic grade of a persons supervisor must be greater than the academic grade of the supervised person.
context Person
inv: self.supervisor.grade.value > self.grade.value
Selected challenges
UML/MOF → lang + metalang level. universal
if MOF is a universal metalang, what about EBNF
suitability for process modeling
suitability for knowledge modeling with rules
Grammars vs MOF
Grammar2MOF example
program: (vardefinition | assignment)*
vardefinition: type IDENT !SEMICOLON
type: (INT | FLOAT)
assignment: IDENT !BECOMES expression !SEMICOLON
expression: (IDENT | NUMBER) (PLUS expression)?
a UML-Based Rule Modeling Language (URML)
developed by the REWERSE Working Group I1,
allows visual rule modeling based on UML class models,
-
Strelka – a tool for making graphical URML models.
URML examples (DR)
A bachelor is a male that is not a husband.
URML examples (PR)
If the reservation date of a rental is 5 days before the start date of a rental, then grant the rental a discount of 10.
URML summary
-
extends UML class diagrams,
single rules,
non-standard → tool support ( Strelka - plugin for Fujaba),
rules serialized to R2ML,
in the future translations: R2ML ↔ OCL and R2ML↔OWL/SWRL
The Production Rule Representation (PRR) [specification Beta 1]
A production rule is a statement of programming logic that specifies the execution of one or more actions in the case that its conditions are satisfied.
PRR should improve the modeling of production rules, especially with respect to UML,
PRR should allow interoperability across different vendors providing production rule implementations.
The production rule is typically represented as:
if [condition-list] then [action-list]
Example of PRR from specification Beta 1:
rule noCDItem {
when {
?customer1: Customer();
?shoppingCart1: ShoppingCart(customer == ?customer1);
not Item(type == ItemType.CD ; shoppingCart == ?shoppingCart1);
} then {
modify ?customer1{ hyperlinkToCD = true; }
}
}
Rule noCDItem
ruleVariable:
?customer: Customer = Customer->any()
?sCart: ShoppingCart = ShoppingCart->any(c:customer|c=?customer)
?cdItems: Set = ?sCart.items->select(e:items|e.type=ItemType.CD)
Condition:
?cdItems.isEmpty()
Action:
?customer.hyperlinkToCD = true
PRR Summary
no common agreement about the syntax of PRR,
different syntaxes, but common metamodel ⇒ translation between different syntaxes,
no defined PRR syntax ⇒ can be URML.
The Business Process Modeling Notation (BPMN)
a graphical notation for specifying business processes in a Business Process Diagram (BPD),
is intuitive to business users and able to represent complex process semantics,
provides a mapping between the graphics of the notation to the underlying constructs of execution languages, particularly Business Process Execution Language.
Example of elements
Example of usage BPMN
BMPN summary
notation dedicated for business org (semantic for business org),
only one diagram BPD, but many artifacts → allows specify even complex processes,
formal notation → simulation, optimalization & error detection,
automatic generation of
BPEL4WS (Business Process Execution Language for Web Services) code,
lack of security support for data structure, users hierarchy and access to data.
Business rules
describe the operations, definitions and constraints that apply to an organization in achieving its goals,
four categories of BR according to Business Rules Group:
definitions of business terms,
facts relating terms to each other,
constraints,
derivations.
BR Example
BR representation
The lower bound must be a non-negative integer literal.
lowerBound()->notEmpty() implies lowerBound() >= 0
UServ
UServ Financial Services case study:
a benchmark case study from the Business Rules Forum,
provides a full service portfolio of financial products of Insurance Company,
contains many business rules and Business Process Models,
-
UServ BR in URML
Example for Eligibility Business Rules / Automobile Eligibility / Potential Theft Category eg.
UServ Business Rules
UServ Business Process Model
HeKatE
Our goals/tasks
ARD & XTT representation in UML,
ARD & XTT rules on UML diagrams presentation,
integration of software & knowledge engineering methods.
ARD
Proposed model of ARD is based on component diagrams.
ARD contains diferent kind of UML dependencies such as:
«derive» specifies a derivation relationship among model elements, where one of them can be computed from the another,
«refine» specifies a refinement relationship among model elements at different levels of development; refinement can be used to model transformation from one to another phase of a sequential model development,
«trace» specifies a trace relationship among model elements represents the same concept in different models; it is mainly used for tracking changes across models.
ARD example (1)
Example of ARD diagram:
<graphviz file=“hekate:therm-a8.dot”></graphviz>
UML model of that ARD diagram:
ARD example (2)
Exemplary fragment of TPH diagram showing «trace» dependecy in model:
TPH
TPH diagram | UML model of TPH diagram |
| |
XTT
Proposed model of XTT is based on activity diagrams, which are related to flow diagrams and can illustrate the activities taking place in the system.
Algorithm step 1
All input attributes become input parameters and output attribute becomes output parameter of an activity
(for the sake of transparency the diagram can be divided into partitions with a swimlane).
Algorithm step 2
For each attribute (activity parameter), if there is more than one unique value in the XTT add a decision node
and for every unique value of attribute needs to be added:
the control flow with guard condition (with that unique value),
if the value occurs frequently, the flow is finished with a fork node with number of outputs equal to the number of times the value appears in XTT table.
Algorithm step 3
For each rule (a row in XTT) draw a join node with the number of inputs equal to the number of input parameters and one output. For each join node:
inputs are connected using an adequate flow (in accordance with the values of attributes in the rule),
outputs are connected (using a flow) with the action having a value corresponding to the output attribute in the rule:
directly, if the value of attribute occurred in XTT only once,
otherwise through a merge node.
Algorithm step 4
Outputs of all actions are merged in a merge node and a flow is lead to output parameter of activity.
XTT th table representation example
Activity diagram for XTT th table: |
| |
Thermostat Case
Activity diagram for the whole XTT of thermostat:
Evaluation
Proposed representation:
shows both structure of dependecies in ARD and process of rules processing in XTT,
doesn't extend UML diagrams (like URML),
allows serialization to XMI.
Future work
Thank you