Krzysztof Kluza kluza@agh.edu.pl, Grzegorz J. Nalepa gjn@agh.edu.pl
context Person inv: self.supervisor.grade.value > self.grade.value
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.
The production rule is typically represented as:
if [condition-list] then [action-list]
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
Example of detailed business rule from http://www.agilemodeling.com/artifacts/businessRule.htm
The description defines the rule exactly (text, flow charts, UML activity diagrams, OCL, ILOG rules language, BRML…).
UServ Financial Services case study:
Proposed model of ARD is based on component diagrams. ARD contains diferent kind of UML dependencies such as:
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.
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:
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:
Proposed representation:
Questions…