Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: fnGetSourcePath
Topic Summary:
Created On: 17-Jun-2005 15:41
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 17-Jun-2005 15:41
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 20-Jun-2005 10:41
User is offline View Users Profile Print this message


Dave Robbins

Posts: 36
Joined: 9-Dec-2003

/*
+-----------------------------------------------------------------------------+
| |
| 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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.