Automatically add an id on the transitions to allow a finer granularity for the deltas.

SVN:trunk[3287]
This commit is contained in:
Denis Flaven
2014-07-24 12:46:56 +00:00
parent 2108a74f87
commit 357ae4abb1

View File

@@ -215,6 +215,9 @@ class ModelFactory
$this->oMenus = $this->oDOMDocument->CreateElement('menus');
$this->oRoot->AppendChild($this->oMenus);
$this->oCombodo = $this->oDOMDocument->CreateElement('combodo');
$this->oRoot->AppendChild($this->oCombodo);
foreach($aRootNodeExtensions as $sElementName)
{
$oElement = $this->oDOMDocument->CreateElement($sElementName);
@@ -428,7 +431,17 @@ class ModelFactory
$oUserRightsNode->SetAttribute('_created_in', $sModuleName);
}
}
// Adjust the XML to transparently add an id (=stimulus) on all life-cycle transitions
// which don't already have one
$oNodeList = $oXPath->query('/itop_design/classes//class/lifecycle/states/state/transitions/transition/stimulus');
foreach($oNodeList as $oNode)
{
if ($oNode->parentNode->getAttribute('id') == '')
{
$oNode->parentNode->SetAttribute('id', $oNode->textContent);
}
}
$oDeltaRoot = $oDocument->childNodes->item(0);
$this->LoadDelta($oDocument, $oDeltaRoot, $this->oDOMDocument);
}