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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.8. Transformation 155<br />

SystemDefinition<strong>and</strong>Request TheSystemDefinitionrootelementinatarget<br />

modelcontainsallrequiredelementsthatdefinethedomainspecificpart<strong>of</strong><br />

anSMCcontroller.Assuch,thiselementcorrespondstoacompletesource<br />

model.<br />

ARequestencompassesrulesthatdeterminehowthatparticularmanufacturingrequest,suchasourunloadwaferfromFigure7.6onpage142,isplanned.Planningrulesinvolveaset<strong>of</strong>Tasks<strong>and</strong>correspondingpredecessorrelations.Additionally,aTaskcanbeanAndTaskoranOrTask.Inthesourcemodel,acompletestatemachineisusedtospecifyhowamanufacturingrequestistobeexecuted.So,wecreateaRequestelementinthe<br />

targetmodelforeveryStateMachineinthesourcemodel.<br />

Listing7.4onthenextpageshowstheATLspecification<strong>of</strong>thismapping.<br />

The RequestrulegeneratesaRequestelementforeveryStateMachinein<br />

thesourcemodel.ThisRequestcontainstaskswhicharecreatedbyother<br />

rules.Aswillbeexplainedlater,StatesorGuardsinthesourcemodelmay<br />

mapto Tasksinthetargetmodel. Becausethetasksinourtargetmodel<br />

maybecompositeinwhichcasetheyownothertasks,weshouldtakecare<br />

nottoselectallmodelelementsinthecompletestatemachinethatmap<br />

toaTask.Instead,foraRequestwediscardallStatesorGuardsinsidea<br />

CompositeStateotherthanthetop,<strong>and</strong>onpathsthatareonlyconditionally<br />

enabled(i.e.,byatransition’sguard).Tothisend,wedefinedtwoadditional<br />

generichelpers.First, rootOfSubTreetakesaset<strong>of</strong>statesasargument<strong>and</strong><br />

recursivelyselectsthe‘first’state<strong>of</strong>thatset(i.e.,theonewithoutincoming<br />

transitionsfromotherstatesintheset). Second, getTask<strong>Model</strong>Elementsis<br />

appliedtothat‘first’StatetocollectallmodelelementsthatmaptoaTask.<br />

Inessence,thishelpertakesaset<strong>of</strong>states<strong>and</strong>traversesthissetasa<br />

state‘tree’startingfromtheState(orGuard)itisappliedto,<strong>and</strong>bypassing<br />

CompositeStates<strong>and</strong>conditionalpaths.Duringthistraversalitcollectsall<br />

modelelementsitencountersthatmaptoaTask(i.e.,GuardsorStates).<br />

The SystemDefinitionrulegeneratesaSystemDefinitionelementthat<br />

correspondstothecompletesourcemodel.The behaviours, resources<strong>and</strong><br />

capabilityfeatures<strong>of</strong>theSystemDefinitionelementareboundtotheresult<strong>of</strong>otherrules.<br />

Inparticularfor behaviours<strong>and</strong> resourceswehadto<br />

usethe resolveTemphelperasthesearenotcreatedbythedefaulttarget<br />

elements<strong>of</strong>theinvolvedrules. Inthiscase,therelevantsourcemodelelementsareselectedbytwohelpersthataredefinedinthecontext<strong>of</strong>the<br />

transformationmoduleitself: behaviourStatesgivesallthesourcemodelelements(SimpleStates)thatmaptoaBehaviour,<strong>and</strong><br />

resourceActionsgives<br />

allthesourcemodelelements(≪claim≫Actions)thatmaptoaResource.<br />

TherequestfeatureisboundtotheelementscreatedbytheRequestrulefor<br />

allStateMachinesinthesourcemodel.

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

Saved successfully!

Ooh no, something went wrong!