11.12.2012 Views

Model-Driven Evolution of Software Architectures - Software and ...

Model-Driven Evolution of Software Architectures - Software and ...

Model-Driven Evolution of Software Architectures - Software and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.8. Transformation 157<br />

rule ResourceUsage {<br />

from s:UML!SimpleState (s.isWait)<br />

to cu: TRS!CapabilityUsage (<br />

capability select(a|a.script.body=s.<br />

outgoing->select(t|t.effect.isClaim).effect.script.body))<br />

}<br />

Listing 7.5:Ruleforresourceusagepattern<br />

callthe getResourceClaimshelperthatrecursivelyfindsall ≪wait≫States<br />

bybackwardstraversal<strong>of</strong>thestatemachineuntila≪release≫Actionis<br />

encountered. A ≪release≫Actionreleasesallclaimedsubsystems. The<br />

≪wait≫StatesinthereturnedsetmatchtheResourceUsagerule<strong>and</strong>the<br />

BehaviourislinkedbyitsrequiresattributetothecorrespondingCapabilityUsageelements.<br />

Resourcesetups Inthetargetmodel,setupsareautomaticallyinsertedby<br />

thegeneric(solving)part<strong>of</strong>theproduct-linearchitecture. Thisisdoneat<br />

run-time,basedonmismatchingbeginState<strong>and</strong>endStateattributes<strong>of</strong>the<br />

CapabilityUsageelement.Tosomeextent,thesecouldbederivedfromthe<br />

explicitlyspecifiedsetupsinthesourcemodel.<br />

Inthischapter,however,wedonotdefineacorrespondingtransformationruleasitdependsheavilyondomainknowledge.Usingourtransformations,setupswillexplicitlyendupinthetargetmodelasjustanother<br />

task<strong>and</strong>behaviour.Assaid,thisensuresthatthemigratedcontrolsystem<br />

mimicsthebehaviour<strong>of</strong>thelegacycontrolsystemexactly,thusresulting<br />

inavalidated<strong>and</strong>acceptablebaseline.<br />

Synchronousexecution ThetargetmodeldefinesprecedencerelationsbetweenthoseTasksthatrequiresynchronisation(withinthesameRequest).Inprinciple,theserelationsfollowfromtheexecutionorder<strong>of</strong>themanufacturingactivities<strong>and</strong>thecorrespondingActionswithinanormalisedstatemachine.Inaddition,(virtual)resourcescanbeusedforexternalsynchronisation.<br />

ForsynchronisationwithinaRequest,predecessorrelationsarecreated<br />

foreverytaskbysearchingforitsset<strong>of</strong>(direct)predecessortasks. For<br />

thiswehavedefinedtwohelpersthatbothoperateontheelementsthat<br />

matchrulesthatcreateTasks.ThefirsthelperisdepictedinListing7.6on<br />

thefollowingpage<strong>and</strong>isdefinedonStateVertexwhereasthesecondone<br />

isdefinedonGuard. ForeachTask,one<strong>of</strong>these getPredecessorshelpers<br />

isinvokedonitscorrespondingStateVertexorGuard. Thesehelpersdeterminewhetherthecurrentelement(self)correspondstoatask.<br />

Ifso,<br />

thiselementisreturned. Otherwise,thehelperisrecursivelyappliedto

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!