To jest stara wersja strony!
UML_URML
Piotr Przybycin pit4@o2.pl
Design rbs examples with URML.
Spotkania
080415
-
opis instalacji strelki, w tym ew. błędy, niedoróbki, usterki
opis uwag, co do projektowania Therm w strelce:
czy w urml da się zrealizować całość przykładu?
czy sa jakieś ograniczenia urml co do składni, semantyki?
czy sa jakieś mechanizmy ułatwiające potem integrację z większą aplikacją w Javie, w której nasz therm byłby systemem decyzyjnym, a w Javie np. klasy wizualizujące decyzję
Jak jest realizowana integracja w drools?
Projekt
Wstęp
URML jest językiem opartym na diagramie klas języka UML. Został stworzony aby ułatwić tworzenie dokumentacji wymagań systemów w sposób mniej techniczny, a bardziej wizualny.
Podstawowym jego rozszerzeniem w stosunku do diagramu klas języka UML, jest możliwość modelowania reguł ( derivation rules, production rules and reaction rules ). Reguły są reprezentowane graficznie jako kółka z identyfikatorami, natomiast zależności w postaci strzałek reprezentujących:
warunki, wyzwalacze, akcje, czy wnioski.
Narzędziem, które umożliwia modelowanie systemów w języku URML jest Strelka, stworzona przez REWERSE Working Group I1.
Przykład
Spróbujemy teraz zamodelować w URML-u jakiś przykład.
Naszym przykładem będzie hekate_case_thermostat.
Model wykonany przy użyciu programu Stralka.
Eksport do R2ML-u
Przy użyciu Strelki możemy również w bardzo prosty sposób uzyskać zapis naszych reguł w standardzie R2ML.
Wystarczy kliknać prawym przyciskiem myszy na daną regułę a następnie wybrać „Preview R2ML”.
Przykładowy kod R2ML dla reguły DR_bizh:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<r2ml:RuleBase xsi:schemaLocation=„http://oxygen.informatik.tu-cottbus.de/R2ML/0.4/R2ML.xsd” xmlns:dc=„http://purl.org/dc/elements/1.1/” xmlns:r2mlv=„http://www.rewerse.net/I1/2006/R2ML/R2MLV” xmlns:xs=„http://www.w3.org/2001/XMLSchema” xmlns:r2ml=„http://www.rewerse.net/I1/2006/R2ML” xmlns:soap=„http://www.w3.org/2001/12/soap-envelope” xmlns:xsi=„http://www.w3.org/2001/XMLSchema-instance”>
<r2mlv:Vocabulary>
<r2mlv:Class r2mlv:ID="Day">
<r2mlv:Attribute r2mlv:ID="IDday">
<r2mlv:range>
<r2mlv:Datatype r2mlv:ID="xs:integer"/>
</r2mlv:range>
</r2mlv:Attribute>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Weekend">
<r2mlv:superClass>
<r2mlv:Class r2mlv:ID="Day"/>
</r2mlv:superClass>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Workday">
<r2mlv:superClass>
<r2mlv:Class r2mlv:ID="Day"/>
</r2mlv:superClass>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Hour">
<r2mlv:Attribute r2mlv:ID="IDhour">
<r2mlv:range>
<r2mlv:Datatype r2mlv:ID="xs:integer"/>
</r2mlv:range>
</r2mlv:Attribute>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Notbizh"/>
<r2mlv:Class r2mlv:ID="Bizh"/>
<r2mlv:Class r2mlv:ID="Month">
<r2mlv:Attribute r2mlv:ID="IDmonth">
<r2mlv:range>
<r2mlv:Datatype r2mlv:ID="xs:integer"/>
</r2mlv:range>
</r2mlv:Attribute>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Autumn">
<r2mlv:superClass>
<r2mlv:Class r2mlv:ID="Month"/>
</r2mlv:superClass>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Winter">
<r2mlv:superClass>
<r2mlv:Class r2mlv:ID="Month"/>
</r2mlv:superClass>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Spring">
<r2mlv:superClass>
<r2mlv:Class r2mlv:ID="Month"/>
</r2mlv:superClass>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Summer">
<r2mlv:superClass>
<r2mlv:Class r2mlv:ID="Month"/>
</r2mlv:superClass>
</r2mlv:Class>
<r2mlv:Class r2mlv:ID="Thermostat">
<r2mlv:Attribute r2mlv:ID="temp">
<r2mlv:range>
<r2mlv:Datatype r2mlv:ID="xs:float"/>
</r2mlv:range>
</r2mlv:Attribute>
</r2mlv:Class>
</r2mlv:Vocabulary>
<r2ml:DerivationRuleSet>
<r2ml:DerivationRule r2ml:ruleID="DR_bizh">
<r2ml:conditions>
<r2ml:ObjectClassificationAtom r2ml:classID="Hour" r2ml:isNegated="false">
<r2ml:ObjectVariable/>
</r2ml:ObjectClassificationAtom>
<r2ml:qf.Conjunction>
<r2ml:DatatypePredicateAtom r2ml:datatypePredicateID="swrlb:greaterThanOrEqual" r2ml:isNegated="false" xmlns:swrlb="http://www.w3.org/2003/11/swrlb">
<r2ml:dataArguments>
<r2ml:TypedLiteral r2ml:datatypeID="xs:integer" r2ml:lexicalValue="9"/>
<r2ml:AttributeFunctionTerm r2ml:attributeID="IDhour">
<r2ml:contextArgument>
<r2ml:ObjectVariable r2ml:classID="Hour"/>
</r2ml:contextArgument>
</r2ml:AttributeFunctionTerm>
</r2ml:dataArguments>
</r2ml:DatatypePredicateAtom>
<r2ml:DatatypePredicateAtom r2ml:datatypePredicateID="swrlb:lessThanOrEqual" r2ml:isNegated="false" xmlns:swrlb="http://www.w3.org/2003/11/swrlb">
<r2ml:dataArguments>
<r2ml:TypedLiteral r2ml:datatypeID="xs:integer" r2ml:lexicalValue="16"/>
<r2ml:AttributeFunctionTerm r2ml:attributeID="IDhour">
<r2ml:contextArgument>
<r2ml:ObjectVariable r2ml:classID="Hour"/>
</r2ml:contextArgument>
</r2ml:AttributeFunctionTerm>
</r2ml:dataArguments>
</r2ml:DatatypePredicateAtom>
</r2ml:qf.Conjunction>
<r2ml:ObjectClassificationAtom r2ml:classID="Workday" r2ml:isNegated="false">
<r2ml:ObjectVariable/>
</r2ml:ObjectClassificationAtom>
</r2ml:conditions>
<r2ml:conclusion>
<r2ml:ObjectClassificationAtom r2ml:classID="Bizh">
<r2ml:ObjectVariable/>
</r2ml:ObjectClassificationAtom>
</r2ml:conclusion>
</r2ml:DerivationRule>
</r2ml:DerivationRuleSet>
</r2ml:RuleBase>
Sprawozdanie
Materiały