<?xml version="1.0" encoding="Windows-1255" ?><Rule name="doReplace" modifier="transactive" scope="protected" sortGroup="true" id="core.gml2:doReplace" sort="27" urn="core.gml2:rules.composition.doReplace.xml" toc="\Rules\Composition rules"><Summary>Replaces a element with another element.</Summary><Parameters signature="transactive rule::<div style="padding:6 0 0 16"><b>doReplace</b>(<i>unit</i>, <i>board</i>, <i>parent</i>, <i>oldElement</i>, <i>newElement</i>) &rarr; Boolean</div>"><Param name="unit" type="core.gml2:Unit!" typeRef="<q ref="core.gml2:Unit">Unit</q>">The unit classifier.</Param><Param name="board" type="core.dev:IBoard!" typeRef="<q ref="core.dev:IBoard">IBoard</q>">The board classifier.</Param><Param name="parent" type="core.gml:GmlObject!" typeRef="<q ref="core.gml:GmlObject">GmlObject</q>">The parent classifier. This is the most immediate ancestor that contains the element to be replaced.</Param><Param name="oldElement" type="core.gml2:Element!" typeRef="<q ref="core.gml2:Element">Element</q>">The old element class or instance to be replaced.</Param><Param name="newElement" type="core.gml2:Element!" typeRef="<q ref="core.gml2:Element">Element</q>">The new replacing element class or instance.</Param></Parameters><Classifiers><Classifier name="unit" type="gml2:Unit" expr="unit"></Classifier><Classifier name="board" type="dev:IBoard" expr="board"></Classifier><Classifier name="parent" type="GmlObject" expr="parent"></Classifier><Classifier name="oldElement" type="gml2:Element" expr="oldElement"></Classifier><Classifier name="newElement" type="gml2:Element" expr="newElement"></Classifier></Classifiers><Return type="Boolean">Returns the rule's success/failure status.</Return><Remarks><h2>Dependencies</h2><table class="WHITE" style="width:auto; margin-top:0" cellspacing="1"><tr><td class="H V"><i>pre-condition:</i> </td><td class=H><q ref="core.gml2:canReplace">canReplace</q> == true </td></tr></table> <h2>Behavior</h2> The behavior can be extended to perform custom actions when an element is replaced.</Remarks><Copyright>(c) SAP AG 2003-2006. All rights reserved.</Copyright> <Topics> </Topics> </Rule>