![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: fnGetSourcePath Topic Summary: Created On: 17-Jun-2005 15:41 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
function "string fnGetSourcePath(string CpsModNameFull)" returns the full name of the source module associated with the specified CPS module, so long as it is a CPS module and there is a source module.
I'm pretty darn sure this function opens link module "Change Proposal System/Change Proposal Links" looking for the CpsModNameFull in the 'source' of the linkset, and if so returning the name of the target of the link module. I have reason to suspect this function also closes either the source or the target or both. Anybody have the source code for this function? Can anybody verify whether it ever closes module? - Louie |
|
![]() |
|
![]() |
|
/*
+-----------------------------------------------------------------------------+ | | | Function : fnOpenModule | | | | Description: Attempts to open invisibly a specified module in a particular | | edit mode. | | | | It also sets a boolean to indicate whether or not the module | | was already open. This is typically used in fnCloseModule to | | determine whether or not it should actually be closed. | | | | It is assumed that this function will have a corresponding | | partner call to fnCloseModule. | | | | Returns : Valid module handle if successful, otherwise null. | | | +-----------------------------------------------------------------------------+ */ Module fnOpenModule(string sModulePath, int iEditMode, bool &bAlreadyOpen) { Module mRetval = null // validate module path if (exists(module sModulePath)) { noError // get current edit state bAlreadyOpen = open(module sModulePath) // Open module in specified mode if (iEditMode == I_EDIT_MODE) { mRetval = edit(sModulePath, false) } else if (iEditMode == I_SHARE_MODE) { mRetval = share(sModulePath, false) } else if (iEditMode == I_READ_MODE) { mRetval = read(sModulePath, false) } // Return null on error if (lastError != null) { mRetval = null } else { filtering off sorting off } } return mRetval } /* +-----------------------------------------------------------------------------+ | | | Function : fnCloseModule | | | | Description: Attempts to save and close a given module depending on the | | given boolean parameters. | | | | It is assumed that this function will have a corresponding | | partner call to fnOpenModule. | | | +-----------------------------------------------------------------------------+ */ void fnCloseModule(Module &m, bool bSave, bool bAlreadyOpen) { if (m != null) { noError // Save if requested, and if module is open for edit/share if (bSave && (isEdit(m) || isShare(m))) { save(m) } // Close the moduel if it was not already open if (!bAlreadyOpen) { close(m) m = null } lastError } } /* +-----------------------------------------------------------------------------+ | | | Function : fnGetSourcePath | | | | Description: Returns the absolute path for the source module associate | | with the specified proposal module. | | | | It uses the 'Change Proposal Links' module to determine the | | appropriate module - assuming that the given path represents | | the source end of a linkset. | | | | If does not then it should not be considered as part of the | | active change proposal system. | | | | Returns : An absolute module location, otherwise null. | | | +-----------------------------------------------------------------------------+ */ string fnGetSourcePath(string sCPModulePath) { string sRetval = null // verify location if (exists(module sCPModulePath)) { bool bAlreadyOpen // open read only Module mCPLinks = fnOpenModule(S_MOD_CPLINKS_PATH(), I_READ_MODE, bAlreadyOpen) // validate handle if (mCPLinks != null) { Object oLinkset // process linksets for oLinkset in mCPLinks do { // check link target if (probeAttr_(oLinkset, S_ATTR_SOURCE) == sCPModulePath) { sRetval = probeAttr_(oLinkset, S_ATTR_TARGET) break } } fnCloseModule(mCPLinks, false, bAlreadyOpen) } } return sRetval } ------------------------- Dave +44 (0)23 9270 5711 david.robbins@astrium.eads.net ~~~~~~~~~~~~~~~~~~~~ EADS Astrium, Anchorage Road Portsmouth. Hampshire. UK PO3 5PU |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
fnGetSourcePath
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.