To jest stara wersja strony!
MIW 2009 XTT_DROOLS
Cel projektu
Analyze how to design Drools rules with XTT2
Wyszukiwanie systemów Drools
Przykład reguł
rule "Platinum Priority"
when
customer : Customer( subscription == "Platinum" )
ticket : Ticket( customer == customer, status == "New" )
then
ticket.setStatus( "Escalate" );
modify ( ticket ) {setStatus( "Escalate" )}
end
Przykład reguł w XML-u
<?xml version="1.0"?>
<rule-set>
<!-- Ensure stock price is not too high-->
<rule name="Stock Price Low Enough">
<!-- Params to pass to business rule -->
<parameter identifier="stockOffer">
<class>StockOffer</class>
</parameter>
<!-- Conditions or 'Left Hand Side'
(LHS) that must be met for
business rule to fire -->
<!-- note markup -->
<java:condition>
stockOffer.getRecommendPurchase() == null
</java:condition>
<java:condition>
stockOffer.getStockPrice() < 100
</java:condition>
<!-- What happens when the business
rule is activated -->
<java:consequence>
stockOffer.setRecommendPurchase(
StockOffer.YES);
printStock(stockOffer);
</java:consequence>
</rule>
</rule-set>
Testowanie
test1
test2
Modelowanie diagramów
ARD
TPH