Test Input Adapter Reference

prevnext


Test Input Adapter Reference

This chapter provides reference material for the test inputs applications programming interface (API), including examples that use code from the RequisitePro adapter. For information about specific declarations, see the following header file:

...Rational Test\rtsdk\c\include\testinputapi.h


Summary of TIA Functions

The Test Inputs Adapter (TIA) functions are summarized in the following table.

Note:

Function Definition
TIConnect() Connects to the test input source.
TIConnectEx() Connects to the test input source and supports additional parameters for connection options.
TIDisconnect() Disconnects from the test input source.
TIExecuteNodeAction() Executes the specified action against the specified test input node.
TIExecuteSourceAction() Executes the specified action against the test input source.
TIGetChildren() Fills an array with the children of a specified parent node.
TIGetConfiguration() Returns a pointer to a buffer that contains a configuration for the test input source.
TIGetFilterEx() Returns a pointer to a filter for the test input source.
TIGetIsFunctionSupported() Indicates whether a specific function is supported by the adapter for an active connection.
TIGetModifiedSince() Fills an array with input elements modified since a specified date.
TIGetNeedsValidation() Determines whether an input element requires validation.
TIGetNode() Returns information about the specified node.
TIGetNodeActions Returns a pointer to an array of test input actions.
TIGetRoots() Fills an array with root elements extracted from the input source.
TIGetSourceActions() Returns a pointer to an array of actions that can be applied to the test input source.
TIGetSourceIcon() Points to the location of the 16 x 16 bitmap containing the icon that represents the input source in Test Input view.
TIGetTypeIcon() Points to the location of the bitmap file of the icon that identifies nodes of a specified type.
TISetConfiguration() Sets the configuration for the test input source based on the specified configuration buffer.
TISetFilter() Filters display of test input elements.
TISetFilterEx() Sets the filter for the test input source based on the specified filter buffer.
TIShowProperties() Displays the property page or dialog box of an input element.
*TIGetIsChild() Not currently supported.
*TIGetIsModified() Not currently supported.
*TIGetIsModifiedSince() Determines whether an input element has been modified since a specified date.
*TIGetIsNode() Determines whether a specified input element exists.
*TIGetIsParent() Determines whether an input element is a parent node.
*TIGetIsValidSource() Determines whether a specified input source exists.
*TIGetModified() Fills an array of structures with input elements that have been modified since the last call to TIGetModified().
*TIGetName() Extracts the user-readable name of an input element.
*TIGetParent() Finds the parent node of an input element.
*TIGetType() Extracts the name of the type of an input element.
*TIGetTypes() Fills an array with an identifier for each type of input element.
*TISetValidationFilter() Filters operations according to validation status.
*TIShowSelectDialog() Displays the selection dialog for choosing elements from the input source.


Using the Type Node Structure

Many of the functions in this API make use of parameters of type Node, which is defined as:

struct Node
{
	 char Name[TI_MAX_NAME];
	 char NodeID[TI_MAX_ID];
	 char Type[TI_MAX_TYPE];
	 BOOL IsOnlyContainer;
	 BOOL NeedsValidation;
} NodeType;

Name is the name of the input element displayed in the test input view.

NodeID is the unique identifier for this input element, assigned by the adapter.

Type is used for associating this input element with a type (for test inputs that subdivide into types).

If IsOnlyContainer is set to TRUE, the input element contains other test input elements and cannot have test cases associated with it.

If NeedsValidation is set to TRUE, the input element needs to be tested.


Note on Memory Allocation

The TIA that you develop is responsible for allocating memory for functions that use pointer-to-pointer parameters, for example TIGetRoots(). TestManager is responsible for deallocating the memory.


TIConnect()

Connects to the test input source.


Syntax

HRESULT TIConnect(const TCHAR ConnectInfo[TI_MAX_PATH], const 
TCHAR UserID[TI_MAX_ID], TCHAR SourceID[TI_MAX_ID], TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
ConnectInfo input. A string that specifies the location of the test input source, often defined as a path.
UserID input. A string that identifies the current tester.
SourceID output. A string that identifies the input source. The ID is used in subsequent calls to the adapter.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

This call has been superseded by TIConnectEx().

After the connection to an input source has been established, the TIA assigns a unique identifier SourceID, which can be any string of characters. TestManager uses this identifier for subsequent calls to the adapter. Be sure to document the format of this string. This is particularly important when there are multiple, simultaneous connections.


Example

//********************************************************************
HRESULT TIConnect(const TCHAR ConnectInfo[TI_MAX_PATH], const TCHAR 
UserID[TI_MAX_ID], TCHAR SourceID[TI_MAX_ID], TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; 

	 // Look in the connection map to determine whether a connection with
	 // the specified RQS file is already established.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(ConnectInfo, (void *&)pContext);

	 // If there is no active connection for the specified ReqPro
	 // Project, attempt to connect.
	 if (!pContext)
	 {
	 	 CFileStatus FileStatus;
	 	 // Determine whether a ReqPro RQS project file exists.
	 	 if (CFile::GetStatus(ConnectInfo, FileStatus) == TRUE)
	 	 {
	 	 	 try
	 	 	 {
	 	 	 
	 	 	 	 /* CODE OMITTED: Establish a connection to the ReqPro
	 	 	 	 project using the ReqPro COM Server.*/	 	 	 	 	 	 	 	 	 	 	 	 
	 	 	 
	 	 
	 	 	 	 // If the connection was successful, add the new connection
	 	 	 	 // context to the connection map.	 	 	 	 	 	 	 	 	 	 	 
	 	 	 	 m_ProjectConnections.SetAt(ConnectInfo, pContext);

	 	 	 	 // Use the ConnectionInfo as the SourceID. 
	 	 	 	 _tcscpy(SourceID, ConnectInfo);
	 	 	 }
	 	 	 catch (_com_error &e)
	 	 	 {
	 	 	 	 // If ReqPro COM Server throws an exception, return the
	 	 	 	 // error using a built in error processing routine.
	 	 	 	 PopulateErrorDescription(IDS_ERROR_UNABLE_TO_CONNECT,
	 	 	 	 e.WCode(), e.ErrorMessage(), ErrorDescription);
	 	 	 }
	 	 else
	 	 {
	 	 	 // The RQS file does not exist, return the appropriate error
	 	 	 // code.
	 	 	 rc = TI_ERROR_INVALID_CONNECTINFO;
	 	 }
	 }
	 // The connection already exists.
	 else
	 {
	 	 _tcscpy(SourceID, ConnectInfo);
	 }

	 return rc;
}


See Also

TIConnectEx(), TIDisconnect()


TIConnectEx()

Creates a connection to a test input source. This method supersedes TIConnect(); it supports additional parameters for connection options.


Syntax

HRESULT TIConnectEx(const TCHAR ConnectInfo[TI_MAX_PATH], const 
TCHAR UserID[TI_MAX_ID], const TIConnectOption 
*pConnectOptions, int nOptions, TCHAR SourceID[TI_MAX_ID], 
TCHAR ErrorDescription[TI_MAX_ERROR])

Element Description
ConnectInfo input. A string that specifies the location of test inputs, often defined as a path.
UserID input. A string that identifies the A string that identifies the current tester.
pConnectOption input. An array of test input source connection options that the user defined using TestManager.
nOptions input. The number of connection options.
SourceID output. A string that identifies the input source. The ID is used in subsequent calls to the adapter.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

The TIA calls this function before calling any other function. After the connection to an input source has been established, the TIA assigns a unique identifier SourceID, which can be any string of characters. TestManager uses this identifier for subsequent calls to the adapter. SourceID must remain valid until TIDisconnect() is called.


Example

//********************************************************************
HRESULT TIConnectEx(const char ConnectInfo[TI_MAX_PATH], const char 
UserID[TI_MAX_ID], const struct TIConnectOption *pConnectOptions, int 
nOptions, char SourceID[TI_MAX_ID], char 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS;

	 // Look in the connection map to determine whether a connection
	 //	 with the specified RQS file is already established.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(ConnectInfo, (void *&)pContext);

	 // If there is no active connection for the specified ReqPro
	 // Project, attempt to connect.
	 if (!pContext)
	 {
	 	 CFileStatus FileStatus;
	 	 // Determine whether a ReqPro RQS project file exists.
	 	 if (CFile::GetStatus(ConnectInfo, FileStatus) == TRUE)
	 	 {
	 	 	 try
	 	 	 {
	 	 	 	 // If ReqPro used connection options, which it does not
	 	 	 	 for (int i=0; i<nOptionCount; i++)
	 	 	 	 {
	 	 	 	 	 // Then process the connection options
	 	 	 	 }

	 	 	 	 /* CODE OMITTED: Establish a connection to the ReqPro
	 	 	 	 	 	 project using the ReqPro COM Server.*/

	 	 	 	 // If the connection was successful, add the new connection
	 	 	 	 // context to the connection map.	 	 	 	 	 	  	  	  	  	  	  	  	  	  	  	  
	 	 	 	 m_ProjectConnections.SetAt(ConnectInfo, pContext);

	 	 	 	 // Use the ConnectionInfo as the SourceID.
	 	 	 	 _tcscpy(SourceID, ConnectInfo);
	 	 	 }
	 	 	 catch (_com_error &e)
	 	 	 {
	 	 	 	 // If ReqPro COM Server throws an exception, return the
	 	 	 	 // error using a built in error processing routine.
	 	 	 	 PopulateErrorDescription(IDS_ERROR_UNABLE_TO_CONNECT,
	 	 	 	 e.WCode(), e.ErrorMessage(), ErrorDescription);
	 	 	 }
	 	 } 
	 	 else
	 	 {
	 	 	 // The RQS file does not exist, return the appropriate error
	 	 	 // code.
	 	 	 rc = TI_ERROR_INVALID_CONNECTINFO;
	 	 }
	 }
	 // The connection already exists.
	 else
	 {
	 	 _tcscpy(SourceID, ConnectInfo);
	 }

	 return rc;
}

See Also

TIConnect(), TIDisconnect()


TIDisconnect()

Disconnects from the test input source.


Syntax

HRESULT TIDisconnect(const TCHAR SourceID[TI_MAX_ID], TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

After TestManager calls TIDisconnect(), no further calls to this input source are allowed without another call to TIConnect() or TIConnectEx().


Example

//********************************************************************
HRESULT TIDisconnect(const TCHAR SourceID[TI_MAX_ID], TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; 

	 // Look in the connection map to determine whether a connection with
	 // the specified RQS file is already established. Note that the
	 // ReqPro adapter also uses the path of the RQS file as the
	 // SourceID.

	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(ConnectInfo, (void *&)pContext);

	 // If the context was found, then continue.
	 if (pContext)
	 {
	 	 /* CODE OMITTED: Close connection to the ReqPro Project by using
	 	 	 the ReqPro COM Server.*/

	 	 // Remove the connection from the list of active connections.
	 	 m_ProjectConnections.RemoveKey(SourceID);
	 }
	 return rc;
}

See Also

TIConnect(), TIConnectEx()


TIExecuteNodeAction()

Executes the specified action against the specified test input node.


Syntax

HRESULT TIExecuteNodeAction(const TCHAR SourceID[TI_MAX_PATH], 
const TCHAR Node[TI_MAX_ID], int nActionID, long 
lWindowContext, TCHAR ErrorDescription[TI_MAX_ERROR])


Element Description
SourceID input. The handle identifying the connection to the test input source.
Node output.
nActionID input. The ID of the action to be executed.
lWindowContext input. A handle to a window that can be the parent of a dialog displayed by this function.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Example

//********************************************************************
HRESULT TIExecuteNodeAction(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR Node[TI_MAX_ID], int nActionID, long lWindowContext, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
     AFX_MANAGE_STATE(AfxGetStaticModuleState());

     HRESULT rc = TI_SUCCESS;

     CConnectionContext *pContext=0;

     // lookup the context information for the specified SourceID
     CString sSourceID = SourceID;
     m_ServerConnections.Lookup (sSourceID, (void *&)pContext);

     if (pContext == 0)
          return TI_ERROR_INVALID_SOURCEID;

     switch (nActionID)
     {
          case 0:
               /* CODE OMITED: Execute custom action 1. */
               break;
          case 1:
               /* CODE OMITED: Execute custom action 2. */
               break;
	 
          default:
               rc = TI_ERROR;
               _tcscpy(*ErrorDescription,
	 	 	 	 	 	 _T("Unrecognized action received"));
               break;
     }
     return rc;

}


See Also

TIGetSourceActions(), TIGetNodeActions(), TIExecuteSourceAction()


TIExecuteSourceAction()

Executes the specified action against the test input source.


Syntax

HRESULT TIExecuteSourceAction(const TCHAR 
SourceID[TI_MAX_PATH], int nActionID, long lWindowContext, 
TCHAR ErrorDescription[TI_MAX_ERROR])


Element Description
SourceID input. The handle identifying the connection to the test input source.
nActionID input. The ID of the action to be executed.
lWindowContext input. A handle to a window that can be the parent of a dialog displayed by this function.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Example

//********************************************************************
HRESULT TIExecuteSourceAction(const TCHAR SourceID[TI_MAX_ID], int 
nActionID, long lWindowContext, TCHAR ErrorDescription[TI_MAX_ERROR])
{
     AFX_MANAGE_STATE(AfxGetStaticModuleState());

     HRESULT rc = TI_SUCCESS;

     CConnectionContext *pContext=0;

     // lookup the context information for the specified SourceID
     CString sSourceID = SourceID;
     m_ServerConnections.Lookup (sSourceID, (void *&)pContext);

     if (pContext == 0)
          return TI_ERROR_INVALID_SOURCEID;

     switch (nActionID)
     {
          case 0:
               /* CODE OMITED: Execute custom action 1. */
               break;
          case 1:
               /* CODE OMITED: Execute custom action 2. */
               break;
	 
          default:
               rc = TI_ERROR;
               _tcscpy(*ErrorDescription,
	 	 	 _T("Unrecognized action received"));
               break;
     }
     return rc;

}

See Also

TIGetSourceActions(), TIGetNodeActions(), TIExecuteNodeAction()


TIGetChildren()

Fills an array with the children of a specified parent node.


Syntax

HRESULT TIGetChildren(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR NodeID[TI_MAX_ID], struct Node *pChildNodes[], long 
*plNodeCount, TCHAR ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies a parent node.
pChildNodes output. A pointer to a structure containing the child elements of parent NodeID.
plNodeCount output. A pointer to the number of child elements in pChildNodes.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.

For the definition of type Node, see "Using the Type Node Structure."


Return Values

This function typically returns TI_SUCCESS when the function completes successfully and returns TI_ERROR_INVALID_SOURCEID if the input source was incorrectly identified.


Comments

This function fills pChildNodes with child elements of a parent node specified by NodeID. If the parent has no children, pChildNodes is empty.

You assign the total number of elements written to pChildNodes to plNodeCount.


Example

//********************************************************************
HRESULT TIGetChildren(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], struct Node *pChildNodes[], long* plNodeCount, 
TCHAR ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; 

	 struct Node *pNodeArray=0;
	 *plNodeCount = 0;
	 *pChildNodes = 0;
	 CConnectionContext *pContext=0;

	 // Lookup the connection information for the ReqPro Project
	 // identified by SourceID.
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);
	 
	 // Determine whether a connection exists with the specified
	 // SourceID.
	 if (pContext)
	 {
	 	 CPtrArray PtrArray;

	 	 /* CODE OMITTED: Obtain a collection of child requirements using
	 	 	 ReqPro COM server and store the data for each child requirement
	 	 	 in an instance of class CReqInfo. CReqInfo is a ReqPro adapter
	 	 	 specific class which stores info about each ReqPro
	 	 	 requirement. The instances of CReqInfo are stored in a
	 	 	 pointer array (CPtrArray).*/
	 	 
	 	 // Allocate enough Node data structures for all the children in
	 	 // the point array. 
	 	 pNodeArray = new struct Node[PtrArray.GetSize()];

	 	 // Populate the array of Nodes with the data returned by using
	 	 // the ReqPro COM server.
	 	 for (long lIndex=0; lIndex < PtrArray.GetSize(); lIndex++)
	 	 {
	 	 	 // Get an instance of CReqInfo.
	 	 	 CReqInfo *pReqInfo = (CReqInfo *)PtrArray.GetAt(lIndex);
	 	 	 
	 	 	 // Copy the requirement name.
	 	 	 _tcscpy(pNodeArray[lIndex].Name, (const 	 char *)
	 	 	 pReqInfo->m_sName);

	 	 	 // Copy the Container and NeedsValidation attributes.
	 	 	 pNodeArray[lIndex].IsOnlyContainer = pReqInfo->m_bContainer;
	 	 	 pNodeArray[lIndex].NeedsValidation =
	 	 	 pReqInfo->m_bNeedsValidation;

	 	 	 // Copy the Requirement NodeID (which is a GUID for a ReqPro
	 	 	 // requirement).
	 	 	 _tcscpy(pNodeArray[lIndex].NodeID, pReqInfo->m_sGUID);

	 	 	 char szNodeType[TI_MAX_TYPE+1];
	 	 
	 	 /* CODE OMITTED: Obtain the name of the requirement type by using
	 	 	 the ReqPro COM server.*/
	 	 
	 	 	 // Copy the name of requirement type into the node structure.
	 	 	 _tcscpy(pNodeArray[lIndex].Type, (char *) szNodeType);

	 	 	 delete pReqInfo;
	 	 } 

	 	 // Set the return pointer for the node array.
	 	 *pChildNodes = pNodeArray;

	 	 // Set the count for the number of returned nodes.
	 	 *plNodeCount = PtrArray.GetSize();
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIGetParent()


TIGetConfiguration()

Returns a pointer to a buffer that contains a configuration for the test input source.


Syntax

HRESULT TIGetConfiguration(const TCHAR SourceID[TI_MAX_PATH], 
long lWindowContext, TCHAR **pConfigurationBuffer, int 
*pnConfigurationBufferLength, TCHAR ErrorDescription)

Element Description
SourceID input. The handle identifying the connection to the test input source.
lWindowContext input. A string that identifies an input element.
pConfigurationBuffer output. A pointer to the buffer that contains the streamed configuration.
pnConfigurationBufferLength output. The length of the configuration buffer.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

Typically, the adapter displays a user interface to collect the configuration data.

TestManager is responsible for persisting the data.


Example

//********************************************************************
 HRESULT TIGetConfiguration(const TCHAR SourceID[TI_MAX_ID], long 
lWindowContext, TCHAR **pConfigurationBuffer, int* 
pnConfigurationBufferLength, TCHAR ErrorDescription[TI_MAX_ERROR])
{
     AFX_MANAGE_STATE(AfxGetStaticModuleState());

     HRESULT rc = TI_SUCCESS;

     CConnectionContext *pContext=0;

     // lookup the context information for the specified SourceID
     CString sSourceID = SourceID;
     m_ServerConnections.Lookup(sSourceID, (void *&)pContext);

     if (pContext == 0)
     return TI_ERROR_INVALID_SOURCEID;

     *pFilterBuffer = new char[_MAX_PATH];

     CWnd ParentWnd;
     ParentWnd.FromHandle((HWND)lWindowContext);

     /* You have to create a class (A dialog with an embedded
     list control to perform configuration selection is used here) */
     CSelectConfigDialog Dialog(pContext, &ParentWnd);

     if (Dialog.DoModal() == IDOK)
     {
          _tcscpy(*pConfigurationBuffer,
	 	 	 	 	 Dialog.m_sSelectedConfigurationName);
          *pnConfigurationBufferLength =
	 	 	 	 	 Dialog.m_sSelectedConfigurationName.GetLength();
     }
     else
     {
          // Put in blanks to indicate no filter set
          CString sEmpty;
          _tcscpy(*pConfigurationBuffer, sEmpty);
          *pnConfigurationBufferLength = sEmpty.GetLength();
     }

     return rc;
}


See Also

TISetConfiguration()


TIGetFilterEx()

Returns a pointer to a buffer that contains a filter for the test input source.


Syntax

HRESULT TIGetFilterEx(const TCHAR SourceID[TI_MAX_PATH], 
longlWindowContext, TCHAR **pFilterBuffer, int 
*pnFilterBufferLength, TCHAR ErrorDescription[TI_MAX_ERROR])


Element Description
SourceID input. The handle identifying the connection to the test input source.
lWindowContext input. A handle to a window that can be the parent of a dialog displayed by this function.
pFilterBuffer output. A pointer to the buffer that contains the streamed filter.
pnFilterBufferLength output. The length of the filter buffer.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

The filter is returned as a stream of characters.

The data is interpreted only by the adapter.

Typically, the adapter displays a user interface to collect the filter data.

TestManager is responsible for persisting the data.


Example

//********************************************************************
HRESULT TIGetFilterEx (const TCHAR SourceID[TI_MAX_PATH], long 
lWindowContext, TCHAR **pFilterBuffer, int *pnFilterBufferLength, 
TCHAR ErrorDescription[TI_MAX_ERROR] )
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());
	 HRESULT rc = TI_SUCCESS;


	 	 CConnectionContext *pContext=0;

	 	 // lookup the context information for the specified SourceID
	 	 CString sSourceID = SourceID;
	 	 m_ServerConnections.Lookup(sSourceID, (void *&)pContext);

	 	 if (pContext == 0)
	 	 	 return TI_ERROR_INVALID_SOURCEID;

	 	 /* The rest of this code simply displays a dialog that shows the
	 	 filter options. It assumes that the dialog saves the filter
	 	 settings to the Context pointer. */
	 	 if (pContext->m_lpDispatchProject)
	 	 {
	 	 	 try
	 	 	 {
	 	 	 	 CFilterDialog FilterDialog(pContext, NULL);
	 	 	 	 if (FilterDialog.DoModal() == IDOK)
	 	 	 	 {
	 	 	 	 	 *pnFilterBufferLength =
	 	 	 	 	 pContext->GetFilterSettings(pFilterBuffer);
	 	 	 	 }
	 	 	 	 else
	 	 	 	 	 rc = TI_ERROR;
	 	 	 	 FilterDialog.DestroyWindow();
	 	 	 }
	 	 	 catch (_com_error)
	 	 	 {
	 	 	 	 rc = TI_ERROR;
	 	 	 }
	 	 }
	 else 
	 	 	 rc = TI_ERROR_INVALID_SOURCEID;
	 }
return rc;
}

See Also

TISetFilterEx()


TIGetIsChild()

Note: This function is not currently called.

Determines whether an input element is a child node.


Syntax

HRESULT TIGetIsChild(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR NodeID[TI_MAX_ID], BOOL* pbIsChild, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
pbIsChild output. A pointer to a Boolean value that specifies whether the node is a child.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

Set the Boolean value pbIsChild to TRUE if the element identified in NodeID is a child. Set the value to FALSE if the element is not a child.


See Also

TIGetIsParent()


TIGetIsFunctionSupported()

Indicates whether a specific function is supported by the adapter for an active connection.


Syntax

HRESULT TIGetIsFunctionSupported(const TCHAR 
SourceID[TI_MAX_PATH], long lFunctionID, BOOL *pbSupported, 
TCHAR ErrorDescription[TI_MAX_ERROR])


Element Description
SourceID input. The handle identifying the connection to the test input source.
lFunctionID input. The constant definition of the function.
pbSupported output. A Boolean indicating whether the specified function is supported.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

The lFunctionID argument can be one of the following:

TI_FUNCTION_TIClearFilter
TI_FUNCTION_TIConnect
TI_FUNCTION_TIConnectEx
TI_FUNCTION_TIDisconnect
TI_FUNCTION_TIExecuteNodeAction
TI_FUNCTION_TIExecutionSourceAction
TI_FUNCTION_TIGetChildren
TI_FUNCTION_TIGetConfiguration
TI_FUNCTION_TIGetFilterEx
TI_FUNCTION_TIGetIsChild
TI_FUNCTION_TIGetIsModified
TI_FUNCTION_TIGetIsNode
TI_FUNCTION_TIGetIsParent
TI_FUNCTION_TIGetIsValidSource
TI_FUNCTION_TIGetModified 
TI_FUNCTION_TIGetModifiedSince
TI_FUNCTION_TIGetName
TI_FUNCTION_TIGetNeedsValidation
TI_FUNCTION_TIGetNode
TI_FUNCTION_TIGetNodeActions
TI_FUNCTION_TIGetParent
TI_FUNCTION_TIGetRoots
TI_FUNCTION_TIGetSourceActions
TI_FUNCTION_TIGetSourceIcon
TI_FUNCTION_TIGetType 
TI_FUNCTION_TIGetTypeIcon
TI_FUNCTION_TIGetTypes
TI_FUNCTION_TISetConfiguration
TI_FUNCTION_TISetFilter
TI_FUNCTION_TISetFilterEx
TI_FUNCTION_TISetValidationFilter 
TI_FUNCTION_TIShowProperties
TI_FUNCTION_TIShowSelectDialog

Example

//********************************************************************

 HRESULT TIGetIsFunctionSupported(const TCHAR SourceID[TI_MAX_ID], 
const TCHAR NodeID[TI_MAX_ID], long lFunctionID, BOOL *pbIsSupported, 
TCHAR ErrorDescription[TI_MAX_ERROR])
{
     AFX_MANAGE_STATE(AfxGetStaticModuleState());

     /* The following is a sample for a minimal adapter with no source
	 	 	 control support. */

     switch (lFunctionID)
     {
          case TI_FUNCTION_TIConnect:
          case TI_FUNCTION_TIDisconnect:
          case TI_FUNCTION_TIEdit:
          case TI_FUNCTION_TIGetIcon:
          case TI_FUNCTION_TIGetName:
          case TI_FUNCTION_TINew:     
          case TI_FUNCTION_TISelect:
          case TI_FUNCTION_TIShowProperties:
               *pbIsSupported = TRUE;
	 	 break;
          default:
              *pbIsSupported = FALSE;
	 	 break;
     }

     return TI_SUCCESS;
}

TIGetIsModified()

Note: This function is not currently called.

Determines whether an input element has been modified since the last call to TIGetModified().


Syntax

HRESULT TIGetIsModified(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR NodeID[TI_MAX_ID], BOOL* pbIsModified, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
pbIsModified output. A pointer to a Boolean value that specifies whether the input element has been modified.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

An element is considered modified if certain properties have changed, particularly properties that affect the way the element is associated with or validated by test cases -- for example, the element's type or its user-readable name.

Set the Boolean value pbIsModified to TRUE if the element has been modified since the last call to TIGetModified(), and set the value to FALSE if the element has not been modified.


See Also

TIGetModified(), TIGetIsModifiedSince()


TIGetIsModifiedSince()

Note: This function is not currently called.

Determines whether an input element has been modified since a specified date.


Syntax

HRESULT TIGetIsModifiedSince(const TCHAR SourceID[TI_MAX_ID], 
const TCHAR NodeID[TI_MAX_ID], struct tm tmDate, BOOL* 
pbIsModified, TCHAR ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
tmDate input. The date, defined in time.h, which is part of the C-language Standard Library.
pbIsModified output. A pointer to a Boolean value that specifies whether the input element has been modified.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.

For the definition of type Node, see "Using the Type Node Structure."


Return Values

This function typically returns one of the following values:


Comments

An element is considered modified if certain properties have changed, particularly properties that affect the way the element is associated with or validated by test cases -- for example, the element's type or its user-readable name.


See Also

TIGetIsModified()


TIGetIsNode()

Note: This function is not currently called.

Determines whether a specified input element exists.


Syntax

HRESULT TIGetIsNode(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR NodeID[TI_MAX_ID], BOOL* pbIsNode, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
pbIsNode output. A pointer to a Boolean value that specifies whether the input element exists.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

Set the Boolean value pbIsNode to TRUE if the element is there, and set the value to FALSE if the element is not there.


Example

//********************************************************************
HRESULT TIGetIsNode(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], BOOL* pbIsNode, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS;
	 *pIsNode = FALSE;

	 // Look in the connection map to determine whether a connection with
	 // the specified RQS file exists. Note that the ReqPro adapter also
	 // uses the path of the RQS file as the SourceID.

	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(ConnectInfo, (void *&)pContext);

	 if (pContext)
	 {
	 /* CODE OMITTED: Determine whether specified NodeID is valid and set
	 	 value of *pIsNode based on its validity.*/
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIGetIsChild(), TIGetIsParent()


TIGetIsParent()

Determines whether an input element is a parent node.


Syntax

HRESULT TIGetIsParent(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR NodeID[TI_MAX_ID], BOOL* pbIsParent, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
pbIsParent output. A pointer to a Boolean value that specifies whether the input element is a parent node in a hierarchical tree.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

Set the Boolean value pbIsParent to TRUE if the specified input element (NodeID) is a parent. Set the value to FALSE if the input element is not a parent.


Example

//********************************************************************
HRESULT TIGetIsParent(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], BOOL* pIsParent, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; // 

	 // Look in the connection map to determine whether a connection with
	 // the specified RQS file exists. Note that the ReqPro adapter also
	 // uses the path of the RQS file as the SourceID.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);

if (pContext)
	 {
	 
	 /* CODE OMITTED: Determine if specified NodeID is a parent and set
	 	 value of *pbIsParent.*/
	 
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIGetIsChild(), TIGetIsNode()


TIGetIsValidSource()

Note: This function is not currently called.

Determines whether the specified test input source exists.


Syntax

BOOL TIGetIsValidSource(const TCHAR SourceID[TI_MAX_ID])

Element Description
SourceID input. The handle identifying the connection to the test input source.


Return Values

This function returns a value of TRUE if the input source exists and returns a value of FALSE if the input source is not valid.


Example

//********************************************************************

BOOL TIGetIsValidSource(const TCHAR SourceID[TI_MAX_ID])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 BOOL bValidSource = FALSE;

	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);

	 if (pContext)
	 	 bValidSource = TRUE;

	 return bValidSource;
}

See Also

TIConnect(), TIDisconnect()


TIGetModified()

Note: This function is not currently called.

Fills an array of structures with input elements that have been modified since the last call to TIGetModified().


Syntax

HRESULT TIGetModified(const TCHAR SourceID[TI_MAX_ID], struct 
Node ModifiedNodes[], long* plNodeCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
ModifiedNodes output. An array containing elements that have been modified since the last invocation of this call.
plNodeCount output. A pointer to a long integer that specifies the number of elements assigned to ModifiedNodes.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.

For the definition of type Node, see "Using the Type Node Structure."


Return Values

This function typically returns one of the following values:


Comments

This function determines which elements have been modified since the last call to TIGetModified(). An element is considered modified if certain properties have changed, particularly properties that affect the way the element is associated with or validated by test cases -- for example, the element's type or its user-readable name. Modified elements are assigned to ModifiedNodes.

You assign the total number of modified elements to plNodeCount.


See Also

TIGetIsModified(), TIGetModifiedSince()


TIGetModifiedSince()

Fills an array of node structures with input elements modified since a specified date.


Syntax

HRESULT TIGetModifiedSince(const TCHAR SourceID[TI_MAX_ID], 
struct tm tmDate, struct Node *pModifiedNodes[], long* 
plNodeCount, TCHAR ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
tmDate input. The date, defined in time.h, which is part of the C-language Standard Library.
pModifiedNodes output. A pointer to an array containing elements that have been modified since tmDate.
plNodeCount output. A pointer to a long integer that specifies the total number of elements written to ModifiedNodes.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.

For the definition of type Node, see "Using the Type Node Structure."


Return Values

This function typically returns one of the following values:


Comments

An element is considered modified if certain properties have changed, particularly properties that affect the way the element is associated with or validated by test cases -- for example, the element's type or its user-readable name. You assign modified elements to ModifiedNodes.

You assign the total number of modified elements to plNodeCount.


Example

//********************************************************************
HRESULT TIGetModifiedSince(const char SourceID[TI_MAX_ID], struct tm 
tmDate, struct Node *pModifiedNodes[], long* plNodeCount, char 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS;
	 try
	 {
	 	 CTIAConnection *pConnection = 0;

	 	 // lookup the context information for the specified SourceID
	 	 if (!theApp.m_ConnectionMap.Lookup(SourceID, (void
	 	 	 	 *&)pConnection))q
	 	 	 return TI_ERROR_INVALID_SOURCEID;

	 	 // if the context was found, then continue
	 	 if (pConnection)
	 	 {
	 	 	 // Convert the passed in time
	 	 	 COleDateTime DateTime;
	 	 	 DateTime.SetDateTime(tmDate.tm_year+1900,tmDate.tm_mon+1,
	 	 	 	 tmDate.tm_mday,tmDate.tm_hour,tmDate.tm_min,tmDate.tm_sec);

	 	 	 /* CODE OMITTED: Process the new date to see if any of the
	 	 	 	 input has been modified since this date.
	 	 	 And populate the NodeArray to return*/
	 	 	 *pModifiedNodes = pNodeArray;
	 	 	 *plNodeCount = PtrArray.GetSize();
	 	 }
	 	 else
	 	 	 rc = TI_ERROR;
	 }
	 catch(COleException *e)
	 {
	 	 sprintf(ErrorDescription, "COleException. SCODE: %08lx.",
	 	 	 (long)e->m_sc);
	 	 return TI_ERROR;

	 }

	 catch(COleDispatchException *e)
	 {
	 	 sprintf(ErrorDescription,
	 	 "COleDispatchException. SCODE: %08lx,Description: \"%s\".",
	 	 (long)e->m_wCode, (LPSTR)e->m_strDescription.GetBuffer
	 	 	 (TI_MAX_ERROR));
	 	 return TI_ERROR;
	 }

	 catch(...)
	 {
	 	 return TI_ERROR;
	 } 


	 return rc;
}


See Also

TIGetModified(), TIGetIsModified(), TIGetIsModifiedSince()


TIGetName()

Note: This function is not currently called.

Extracts the name of an input element.


Syntax

HRESULT TIGetName(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], TCHAR Name[TI_MAX_NAME], TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
Name output. A string that specifies the name of the input element.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

You assign the name of the input element identified in NodeID to Name.


Example

//********************************************************************
HRESULT TIGetName(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], TCHAR Name[TI_MAX_NAME], TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; 

	 // Look in the connection map to determine whether a connection with
	 // the 	 specified RQS file exists.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(ConnectInfo, (void *&)pContext);

	 // Determine whether a connection exists with the specified
	 // SourceID.
	 if (pContext)
	 {
	 	 CString sReqName;

	 /* CODE OMITTED: Obtain the name for the requirement whose ID is the
	 	 value of NodeID and store it in local variable sReqName.
	 	 If value of NodeID is not a valid test input, return
	 	 TI_NODE_NOT_FOUND.*/
	 
	 	 // Copy the name into the return 	 buffer.
	 	 _tcsncpy(Name, (const char *)sReqName, TI_MAX_NAME);
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIGetParent(), TIGetNode()


TIGetNeedsValidation()

Note: This function is not currently called.

Determines whether an input element requires validation.


Syntax

HRESULT TIGetNeedsValidation(const TCHAR SourceID[TI_MAX_ID], 
const TCHAR NodeID[TI_MAX_ID], BOOL* pbNeedsValidation, 
TCHAR ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
pbNeedsValidation output. A pointer to a Boolean value that specifies whether the input element requires validation.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

Set the value of Boolean pbNeedsValidation to TRUE if the input element needs to be validated, and set the value to FALSE if the input element does not need to be validated.


See Also

TIGetModified(), TIGetModifiedSince(), TISetValidationFilter()


TIGetNode()

Returns information about the specified node.


Syntax

HRESULT TIGetNode(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], struct Node **pNode, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies a parent node.
pNode output. A pointer to the node specified in NodeID.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns TI_SUCCESS when the function completes successfully and returns TI_ERROR_INVALID_SOURCEID if the input source was incorrectly identified.


Comments

The definition of type Node is as follows:

struct Node
{
	 char Name[TI_MAX_NAME];
	 char NodeID[TI_MAX_ID];
	 char Type[TI_MAX_TYPE];
	 BOOL IsOnlyContainer;
	 BOOL NeedsValidation;
} NodeType;

Example

HRESULT TIGetNode(TCHAR SourceID[TI_MAX_ID], TCHAR NodeID[TI_MAX_ID],  
struct Node **pNode, TCHAR ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = S_OK;

	 // Look in the connection map to determine if a connection with the
	 //specified .RQS file exists.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);


	 if (pContext)
	 {
	 ...
	 //CODE OMITTED: Obtain the Requirement identified by NodeID and
	 //store data in instance of CReqInfo.
	 //CReqInfo is a ReqPro adapter-specific class that stores info
	 //about a ReqPro requirement. 	 
	 ...	   
	 //If value of NodeID is not a valid TestInput, TI_NODE_NOT_FOUND is
	 //returned.
	 	 ...

	 	 // populate Node structure
	 	 *pNode = new struct Node;

	 	 // copy Requirement Name
	 	 _tcscpy((*pNode)->Name, (const char *)pReqInfo->m_sName);

	 	 (*pNode)->IsOnlyContainer = pReqInfo->m_bContainer;
	 	 (*pNode)->NeedsValidation = pReqInfo->m_bNeedsValidation;

	 	 // copy the Requirement NodeID (which is a GUID for a ReqPro
	 	 // requirement)
	 	 _tcscpy((*pNode)->NodeID, pReqInfo->m_sGUID);

	 	 TCHAR szNodeType[TI_MAX_TYPE+1];
	 ...
	 // CODE OMITTED: Obtain the name of the Requirement Type via the
	 // ReqPro COM server
	 ...	 

	 	 // copy the name of requirement type into the node structure
	 	 _tcscpy((*pNode)->Type, (char *) szNodeType);
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;


	 return rc;
}

See Also

TIGetIsNode()


TIGetNodeActions()

Returns a pointer to an array of test input actions.


Syntax

HRESULT TIGetNodeActions(const TCHAR SourceID[TI_MAX_PATH], 
const TCHAR Type[TI_MAX_TYPE], struct Action *pActions[], 
int *pnActionCount, TCHAR ErrorDescription[TI_MAX_ERROR])


Element Description
SourceID input. The handle identifying the connection to the test input source.
Type input. The name of a node type.
pActions output. A local array containing action structures for node Type.
pnActionCount output. The number of actions in pActions.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

The Type parameter is empty if no types have been returned.


Example

//********************************************************************
HRESULT TIGetNodeActions(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
Type[TI_MAX_TYPE], struct TIAction *pActions[], int *pnActionCount, 
TCHAR ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS;

	 CConnectionContext *pContext=0;

	 // lookup the context information for the specified SourceID
	 CString sSourceID = SourceID;
	 m_ServerConnections.Lookup(sSourceID, (void *&)pContext);

	 if (pContext == 0)
	 	 return TI_ERROR_INVALID_SOURCEID;

	 struct TIAction *pTempActions;
	 pTempActions = new struct TIAction [2];
	 if ( Type == "FEAT")
	 {
	 	 _tcscpy(pTempActions[0].Name, "Custom Action for features 1\0"); 
	 	 pTempActions[0].ActionID = 0;

	 	 _tcscpy(pTempActions[1].Name, "Custom Action features 2\0");
	 	 pTempActions[1].ActionID = 1;
	 }
	 *pActionCount = 2;
	 *pActions = pTempActions;
	 return rc;
}

See Also

TIGetSourceActions(), TIExecuteNodeAction(), TIExecuteNodeAction()


TIGetParent()

Note: This function is not currently called.

Finds the parent node of an input element.


Syntax

HRESULT TIGetParent(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR NodeID[TI_MAX_ID], struct Node** pParentNode, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
pParentNode output. A pointer to a structure that receives the parent node.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.

For the definition of type Node, see "Using the Type Node Structure."


Return Values

This function typically returns one of the following values:


Comments

You assign a pointer to the parent node in pParentNode. If there is no parent for the specified input element, assign a null pointer.


Example

//********************************************************************
HRESULT TIGetParent(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], struct Node **pParentNode, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; 

	 // Look in the connection map to determine whether a connection with
	 // the specified RQS file exists.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);

	 if (pContext)
	 {
	 /* CODE OMITTED: Obtain the parent of the Requirement identified by
	 	 NodeID and store data in instance of CReqInfo.
	 	 If value of NodeID is not a valid test input,
	 	 TI_NODE_NOT_FOUND is returned.*/

	 	 // Populate Node structure.
	 	 *pParentNode = new struct Node;

	 	 // Copy test input name.
	 	 _tcscpy((*pParentNode)->Name, (const char *)pReqInfo->m_sName);

	 	 (*pParentNode)->IsOnlyContainer = pReqInfo->m_bContainer;
	 	 (*pParentNode)->NeedsValidation = pReqInfo->m_bNeedsValidation;

	 	 // Copy the Requirement NodeID (which is a GUID for a ReqPro
	 	 // requirement).
	 	 _tcscpy((*pParentNode)->NodeID, pReqInfo->m_sGUID);

	 	 char szNodeType[TI_MAX_TYPE+1];
	 
	 /* CODE OMITTED: Obtain the name of the requirement type by using
	 	 the ReqPro COM server.*/
	 

	 	 // Copy the name of requirement type into the node structure.
	 	 _tcscpy((*pParentNode)->Type, (char *) szNodeType);	 	 	 	 	 	 	 
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIGetIsNode(),TIGetIsChild()


TIGetRoots()

Fills an array with root elements extracted from the input source.


Syntax

HRESULT TIGetRoots(const TCHAR SourceID[TI_MAX_ID], struct Node 
*pRootNodes[], long *plNodeCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
pRootNodes output. A string of structures of type Node that receives the root nodes.
plNodeCount output. A pointer to a long integer that specifies the total number of root nodes.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.

For the definition of type Node, see "Using the Type Node Structure."


Return Values

This function typically returns one of the following values:


Comments

You assign nodes that are root elements to pRootNodes. If the input source is not hierarchical, fill RootNodes with all of the elements of the input source.

You assign plNodeCount the total number of nodes written out to pRootNodes.


Example

//********************************************************************
HRESULT TIGetRoots(const TCHAR SourceID[TI_MAX_ID], struct Node 
*pRootNodes[], long* plNodeCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS;

	 struct Node *pNodeArray=0;
	 *pNodeCount = 0;
	 *pRootNodes = 0;
	 CConnectionContext *pContext=0;

	 // Lookup the connection information for the ReqPro Project
	 // identified by SourceID.
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);
	 
	 // Determine whether a connection exists with the specified
	 // SourceID.
	 if (pContext)
	 {
	 	 CPtrArray PtrArray;
	 	 
	 	 /*	 CODE OMITTED: Obtain a collection of root nodes using ReqPro
	 	 	 COM server and store the data for Requirement in an instance of
	 	 	 class CReqInfo. CReqInfo is a ReqPro adapter specific class
	 	 	 that stores info about each ReqPro requirement. The instances
	 	 	 of CReqInfo are stored in a pointer array (CPtrArray).*/
	 	 
	 	 // Allocate enough Node data structures for all the root nodes in
	 	 // the pointer array. 
	 	 pNodeArray = new struct Node[PtrArray.GetSize()];

	 	 // Populate the array of Nodes with the data returned by using	 	 	 	 
	 	 // the ReqPro COM server.
	 	 for (long lIndex=0; lIndex < PtrArray.GetSize(); lIndex++)
	 	 {
	 	 	 // Get an instance of CReqInfo.
	 	 	 CReqInfo *pReqInfo = (CReqInfo *)PtrArray.GetAt(lIndex);
	 	 	 
	 	 	 // Copy the requirement name.
	 	 	 _tcscpy(pNodeArray[lIndex].Name, (const char
	 	 	 *)pReqInfo->m_sName);

	 	 	 // Copy the Container and NeedsValidation attributes.
	 	 	 pNodeArray[lIndex].IsOnlyContainer = pReqInfo->m_bContainer;
	 	 	 pNodeArray[lIndex].NeedsValidation =
	 	 	 	 pReqInfo->m_bNeedsValidation;

	 	 	 // Copy the Requirement NodeID (which is a GUID for a ReqPro
	 	 	 // requirement).
	 	 	 _tcscpy(pNodeArray[lIndex].NodeID, pReqInfo->m_sGUID);

	 	 	 char szNodeType[TI_MAX_TYPE+1];
	 	 
	 	 /* CODE OMITTED: Obtain the name of the requirement type by using
	 	 	 the ReqPro COM server.*/

	 	 	 // Copy the name of requirement type into the node structure.
	 	 	 _tcscpy(pNodeArray[lIndex].Type, (char *) szNodeType);

	 	 	 delete pReqInfo;
	 	 } 

	 	 // Set the return pointer for the node array.
	 	 * pRootNodes = pNodeArray;

	 	 // Set the count for the number of returned nodes.
	 	 *plNodeCount = PtrArray.GetSize();
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIGetIsNode(), TIGetIsParent(), TIGetParent(), TIGetChildren()


TIGetSourceActions()

Returns a pointer to an array of actions that can be applied to the test input source.


Syntax

HRESULT TIGetSourceActions(const TCHAR SourceID[TI_MAX_PATH], 
struct Action *pActions[], int *pnActionCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])


Element Description
SourceID input. The handle identifying the connection to the test input source.
pActions output. An array of populated action structures, each of which defines an action.
pnActionCount output. The number of actions returned
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Example

//********************************************************************
HRESULT TIGetSourceActions(const TCHAR SourceID[TI_MAX_ID], struct 
TIAction *pActions[], int *pnActionCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
     AFX_MANAGE_STATE(AfxGetStaticModuleState());

     HRESULT rc = TI_SUCCESS;

     CConnectionContext *pContext=0;

     // lookup the context information for the specified SourceID
     CString sSourceID = SourceID;
     m_ServerConnections.Lookup(sSourceID, (void *&)pContext);
     
     if (pContext == 0)
          return TI_ERROR_INVALID_SOURCEID;

    struct TIAction *pTempActions;
    pTempActions = new struct TIAction [2];

    _tcscpy(pTempActions[0].Name, "Custom Action 1\0"); 
    pTempActions[0].ActionID = 0;

    _tcscpy(pTempActions[1].Name, "Custom Action 2\0");
    pTempActions[1].ActionID = 1;

    *pActionCount = 2;
    *pActions = pTempActions;
    return rc;
}

See Also

TIGetNodeActions(), TIExecuteSourceAction(), TIExecuteNodeAction()


TIGetSourceIcon()

Points to the location of the 16 x 16 bitmap containing the icon that is displayed with the name of the test input source in the TestManager Test Input view.


Syntax

HRESULT TIGetSourceIcon(const TCHAR SourceID[TI_MAX_ID], TCHAR 
IconPath[TI_MAX_PATH], TCHAR ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
IconPath output. A string that identifies the location of the icon graphics file.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

The source is identified in SourceId. This icon is also used for all elements of the input source that belong to a type that does not have its own icon.


Example

//********************************************************************
HRESULT TIGetSourceIcon(const TCHAR SourceID[TI_MAX_ID], TCHAR 
IconPath[TI_MAX_PATH], TCHAR ErrorDescription[TI_MAX_ERROR])
{
	 DWORDdwError;
	 charszModuleFileName[_MAX_PATH+1];
	 charszModuleFilePath[_MAX_PATH+1];
	 charszDir[_MAX_DIR+1];
	 charszDrive[_MAX_DRIVE+1];

	 // Obtain the path to where the ReqPro adapter is installed.
	 dwError=GetModuleFileName((HMODULE)AfxGetInstanceHandle(),
	 szModuleFileName, _MAX_PATH);
	 _splitpath(szModuleFileName, szDrive, szDir, NULL, NULL);
	 
	 // Build the path to where the bitmap file exists.
	 _tcscpy(szModuleFilePath, szDrive);
	 _tcscat(szModuleFilePath, szDir);
	 _tcscat(szModuleFilePath, "bitmap_source.bmp");

	 // Copy the path into the return variable.
	 _tcscpy(IconPath, szModuleFilePath);

	 return TI_SUCCESS; 
}

See Also

TIGetTypeIcon()


TIGetType()

Note: This function is not currently called.

Extracts the name of the type of an input element.


Syntax

HRESULT TIGetType(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], TCHAR Type[TI_MAX_TYPE], TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
Type output. A string that identifies the type of node.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

You assign the type of the input element identified in NodeID to Type.


Example

//********************************************************************
HRESULT TIGetType(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], TCHAR Type[TI_MAX_NAME], TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS;

	 // Look in the connection map to determine whether a connection with
	 // the specified RQS file exists.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(ConnectInfo, (void *&)pContext);

	 // Determine whether a connection exists with the specified
	 //	 SourceID.
	 if (pContext)
	 {
	 	 CString sReqType;
	 
	 /* CODE OMITTED: Obtain the type for the requirement whose unique ID
	 	 is the value of NodeID and store it in local variable sReqType.
	 	 If value of NodeID is not a valid test input, return
	 	 TI_NODE_NOT_FOUND.*/
	 
	 	 // Copy its type into the return buffer.
	 	 _tcsncpy(Type, (const char *)sReqType, TI_MAX_TYPE);
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIGetTypeIcon(), TIGetTypes()


TIGetTypeIcon()

Points to the location of the 16 x 16 bitmap file of the icon that identifies nodes of a specified type.


Syntax

HRESULT TIGetTypeIcon(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR Type[TI_MAX_TYPE], TCHAR IconPath[TI_MAX_PATH], TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
Type input. A string that identifies the type of node.
IconPath output. A string that specifies the location of a graphics file for an icon that represents nodes of a particular type.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns TI_SUCCESS when the function completes successfully and returns TI_ERROR_INVALID_SOURCEID if the input source information was incorrectly identified.


Comments

Use IconPath to point to the location of the icon that identifies nodes of type Type.


Example

//********************************************************************
HRESULT TIGetTypeIcon(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
Type[TI_MAX_TYPE], TCHAR IconPath[TI_MAX_PATH], TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 DWORDdwError;
	 charszModuleFileName[_MAX_PATH+1];
	 charszModuleFilePath[_MAX_PATH+1];
	 charszDir[_MAX_DIR+1];
	 charszDrive[_MAX_DRIVE+1];

	 // Obtain the path to where the ReqPro adapter is installed.
	 dwError=GetModuleFileName((HMODULE)AfxGetInstanceHandle(),
	 szModuleFileName, _MAX_PATH);
	 _splitpath(szModuleFileName, szDrive, szDir, NULL, NULL);

	 // Build the path to where the bitmap file exists.
	 _tcscpy(szModuleFilePath, szDrive);
	 _tcscat(szModuleFilePath, szDir);
	 _tcscat(szModuleFilePath, "bitmap_type.bmp");

	 // Copy the path into the return variable.
	 _tcscpy(IconPath, szModuleFilePath);

	 return TI_SUCCESS; 
}

See Also

TIGetSourceIcon()


TIGetTypes()

Note: This function is not currently called.

Fills an array with an identifier for each type of input element.


Syntax

HRESULT TIGetTypes(const TCHAR SourceID[TI_MAX_ID], TCHAR 
(**Types)[TI_MAX_TYPE], long* plTypeCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
Types output. A pointer to an array of type identifiers.
pTypeCount output. A pointer to a long integer that specifies the total number of test types.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns TI_SUCCESS when the function completes successfully and returns TI_ERROR_INVALID_SOURCEID if the input source information was incorrectly identified.


Comments

You assign an identifier for each input type to Types.

You assign the total count of type identifiers to plTypeCount.


Example

//********************************************************************
HRESULT TIGetTypes(const TCHAR SourceID[TI_MAX_ID], TCHAR (** 
Types)[TI_MAX_TYPE], long* plTypeCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; 

	 // Lookup the connection information for the ReqPro Project
	 // identified by SourceID.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);

	 // Determine whether a connection exists with the specified
	 // SourceID.
	 if (pContext)
	 {
	 	 try
	 	 {
	 	 	 // Get the ReqPro project interface pointer from the instance
	 	 	 // of CConnectionContext. 
	 	 	 ReqServer::_ProjectPtr
	 	 	 ProjectPtr(pContext->m_lpDispatchProject);

	 	 	 // Get the requirement types from the ReqPro project interface
	 	 	 // pointer.
	 	 	 ReqServer::_ReqTypesPtr
	 	 	 MyReqTypesPtr(ProjectPtr->GetReqTypes());

	 	 	 // Allocate enough memory to return the types - (which are
	 	 	 // strings in ReqPro).
	 	 	 *Types = (char (*)[TI_MAX_TYPE]) malloc(sizeof(char) *
	 	 	  MyReqTypesPtr->GetCount() * TI_MAX_TYPE);

	 	 	 // Loop through the requirements types to find the right one.
	 	 	 for (long lIndex = 1; lIndex <= MyReqTypesPtr->GetCount();
	 	 	 	 	 lIndex++)
	 	 	 {
	 	 	 	 COleVariant varIndex=lIndex;
	 
	 	 	 /* CODE OMITTED: Obtain requirement type from collection and
	 	 	 	 store in variable MyReqTypePtr.*/
	 	 	 	 // Copy name of requirement type into the return array. Note
	 	 	 	 // that index of array is 0 based.
	 	 	 	 _tcscpy((*pszTypes)[lIndex-1], (char 
	 	 	 	 *)MyReqTypePtr->GetName());
	 	 	 }
	 	 	 // Store count of types in return variable.
	 	 	 *plTypeCount = MyReqTypesPtr->GetCount();
	 	 }
	 	 catch (_com_error)
	 	 {
	 	 	 rc = TI_ERROR;
	 	 }
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIGetType(), TIGetTypeIcon()


TISetConfiguration()

Sets the configuration for the test input source based on the specified configuration buffer.


Syntax

HRESULT TISetConfiguration(const TCHAR SourceID[TI_MAX_PATH], 
TCHAR *pConfigurationBuffer, int nConfigurationBufferLength, 
TCHAR ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
pConfigurationBuffer input. A pointer to the buffer that contains the streamed configuration.
nConfigurationBufferLength input. The length of the configuration buffer.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Example

//********************************************************************
HRESULT TISetConfiguration(const TCHAR SourceID[TI_MAX_ID], TCHAR 
*pConfigurationBuffer, int nConfigurationBufferLength, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS;

	 CConnectionContext *pContext=0;

	 // lookup the context information for the specified SourceID
	 CString sSourceID = SourceID;
	 m_ServerConnections.Lookup(sSourceID, (void *&)pContext);

	 if (pContext == 0)
	 	 return TI_ERROR_INVALID_SOURCEID;

	 // Persist the raw filter buffer for possible future use by 
	 //TIGetConfigurationEx or
	 // TICompile, TIEdit, etc...
	 pContext->m_sConfiguration = pConfigurationBuffer;

	 /* CODE OMITED: Handle any configuration application actions
	 	 	 needed by the adapter */

	 return rc;
}

See Also

TIGetConfiguration()


TISetFilter()

Filters the display of test input elements.


Syntax

HRESULT TISetFilter(const TCHAR SourceID[TI_MAX_ID], const 
TCHAR UserID[TI_MAX_ID], TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
UserID input. A string that identifies the current user.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

You provide the filter creation mechanism in a window or in a dialog box so that the display of input elements is reduced to a specific set. Filtering information can be stored on a peruser basis.


Example

//********************************************************************
HRESULT TISetFilter(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
UserID[TI_MAX_ID], TCHAR ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; 

	 // Lookup the connection information for the ReqPro Project
	 // identified by SourceID.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);
	 
	 // Determine whether a connection exists with the specified
	 // SourceID.
	 if (pContext)
	 {
	 	 try
	 	 {
	 	 	 CFilterDialog FilterDialog(pContext, NULL);

	 	 	 // Display filter dialog.
	 	 	 if (FilterDialog.DoModal())
	 	 	 {
	 	 	 }
	 	 }
	 	 catch (_com_error)
	 	 {

	 	 }
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TISetFilterEx(), TISetValidationFilter()


TISetFilterEx()

Sets the filter for the test input source based on the specified filter buffer.


Syntax

HRESULT TISetFilterEx(const TCHAR SourceID[TI_MAX_PATH], TCHAR 
*pFilterBuffer, int nFilterBufferLength, TCHAR 
ErrorDescription[TI_MAX_ERROR])


Element Description
SourceID input. The handle identifying the connection to the test input source.
pFilterBuffer output. A pointer to a buffer that contains the streamed filter.
nFilterBufferLength output. The length of the filter buffer.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

This function supersedes the function TISetFilter().

TestManager is responsible for persisting this data.


Example

//********************************************************************
HRESULT TISetFilterEx(const TCHAR SourceID[TI_MAX_ID], TCHAR 
*pFilterBuffer, int nFilterBufferLength, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
     AFX_MANAGE_STATE(AfxGetStaticModuleState());

     HRESULT rc = TI_SUCCESS;

     CConnectionContext *pContext=0;

     // lookup the context information for the specified SourceID
     CString sSourceID = SourceID;
     m_ServerConnections.Lookup(sSourceID, (void *&)pContext);
     
     if (pContext == 0)
          return TI_ERROR_INVALID_SOURCEID;

     /* The remainder of this code is an example of filtering file
	 	 	 based input source. In this sample, the TIGetFilterEx returned
	 	 	 a list of file extensions that were to be hidden from the user.
	 	 	 This example merely parses the filter buffer and stores the
	 	 	 results in the adapter's connection context. TIGetRoots and
	 	 	 TIGetChildren would then use this to determine their output.*/   

     // Persist the raw filter buffer for possible future use 
	 	 // by TIGetFilterEx
     pContext->m_sFilter = pFilterBuffer;

     TCHAR szBuffer[512];
     _tcscpy(szBuffer, pFilterBuffer);
     char seps[] = ";";
     char *token;

     pContext->m_asFilterFileExtensions.RemoveAll();

     // establish string and get the first token: 
     token = strtok(szBuffer, seps );
     while( token != NULL )
     {
          CString sToken = token;
          sToken.TrimLeft();
          sToken.TrimRight();
          pContext->m_asFilterFileExtensions.Add(sToken);
	 
          // Get next token:
          token = strtok( NULL, seps );

     }  //  end while

     return rc;
}

See Also

TIGetFilterEx()


TISetValidationFilter()

Note: This function is not currently called.

Filters operations according to validation status.


Syntax

HRESULT TISetValidationFilter(const TCHAR SourceID[TI_MAX_ID], 
const TCHAR UserID[TI_MAX_ID], BOOL bOnlyNeedsValidation, 
TCHAR ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
UserID input. A string that identifies the current user.
bOnlyNeedsValidation input. A pointer to a Boolean value that specifies whether filtering by validation status is in effect.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

Create a filter so that all operations on the input source (SourceID) performed by the current tester (UserID) apply only to elements that need validation. If bOnlyNeedsValidation is set to False, filtering by this criterion is disabled.


See Also

TISetFilter(), TISetFilterEx(), TIGetFilterEx()


TIShowProperties()

Displays the property page or dialog box of an input element.


Syntax

HRESULT TIShowProperties(TCHAR const SourceID[TI_MAX_ID], const 
TCHAR NodeID[TI_MAX_ID], struct Node** pModifiedNode, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
NodeID input. A string that identifies an input element.
pModifiedNode output. A pointer to a structure that receives the new information about a node.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

If any property relevant to TestManager has changed, assign the new information to a Node structure associated with the pointer pModifiedNode.


Example

//********************************************************************
HRESULT TIShowProperties(const TCHAR SourceID[TI_MAX_ID], const TCHAR 
NodeID[TI_MAX_ID], struct Node** pModifiedNode, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS;

	 // Look in the connection map to determine whether a connection with
	 // the specified RQS file exists.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);

	 if (pContext)
	 {
	 /* CODE OMITTED: Display the ReqPro Requirement Properties dialog
	 	 If OK is selected, store relevant information in an instance of
	 	 CReqInfo. CReqInfo is a ReqPro adapter-specific class.
	 	 If value of NodeID is not a valid test input,
	 	 TI_NODE_NOT_FOUND is returned.*/
	 
	 	 // Populate Node structure.
	 	 *pNode = new struct Node;

	 	 // Copy test input name.
	 	 _tcscpy((*pModifiedNode)->Name, (const char *)pReqInfo->m_sName);

	 	 (*pModifiedNode)->IsOnlyContainer = pReqInfo->m_bContainer;
	 	 (*pModifiedNode)->NeedsValidation =
	 	 pReqInfo->m_bNeedsValidation;

	 	 // Copy the Requirement NodeID (which is a GUID for a ReqPro
	 	 // requirement).
	 	 _tcscpy((*pModifiedNode)->NodeID, pReqInfo->m_sGUID);

	 	 char szNodeType[TI_MAX_TYPE+1];
	 
	 /* CODE OMITTED: Obtain the name of the requirement type by using
	 	 the ReqPro COM server.*/
	 
	 	 // Copy the name of requirement type into the node structure.
	 	 _tcscpy((*pModifiedNode)->Type, (char *) szNodeType);
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIShowSelectDialog()


TIShowSelectDialog()

Note: This function is not currently called.

Displays a selection dialog box for choosing elements from the input source.


Syntax

HRESULT TIShowSelectDialog(const TCHAR SourceID[TI_MAX_ID], 
struct Node* pSelectedNodes[], long* plNodeCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])

Element Description
SourceID input. The handle identifying the connection to the test input source.
pSelectedNodes output. An array of structures that specifies the selected input elements.
plNodeCount output. A pointer to a long integer that specifies the total number of nodes selected.
ErrorDescription output. The message to be displayed to the TestManager user if there is an error.


Return Values

This function typically returns one of the following values:


Comments

This function displays a selection dialog box (supplied by the adapter) for selecting elements from the input source (SourceID). You assign the selected elements to pSelectedNodes.

Assign the total number of selected elements to plNodeCount.


Example

//********************************************************************
HRESULT TIShowSelectDialog(const TCHAR SourceID[TI_MAX_ID], struct 
Node *pSelectedNodes[], long* plNodeCount, TCHAR 
ErrorDescription[TI_MAX_ERROR])
{
	 AFX_MANAGE_STATE(AfxGetStaticModuleState());

	 HRESULT rc = TI_SUCCESS; 

	 struct Node *pNodeArray=0;
	 // Look in the connection map to determine whether a connection with
	 // the specified RQS file exists.
	 CConnectionContext *pContext=0;
	 m_ProjectConnections.Lookup(SourceID, (void *&)pContext);
	 
	 // Determine whether a connection exists with the specified
	 // SourceID.
	 if (pContext)
	 {
	 	 CPtrArray PtrArray;

	 	 /* CODE OMITTED: Display the RequisitePro Requirement Selection
	 	 	 Dialog. Upon selection of the OK button, extract the selected
	 	 	 requirements and store the data for each requirement in an
	 	 	 instance of class CReqInfo. 
	 	 	 CReqInfo is a ReqPro adapter-specific class that stores info
	 	 	 about each ReqPro requirement. The instances of CReqInfo are
	 	 	 stored in a pointer array (CPtrArray).*/
	 	 
	 	 // Allocate enough Node data structures for all the root nodes in
	 	 //	 the pointer array. 
	 	 pNodeArray = new struct Node[PtrArray.GetSize()];

	 	 // Populate the array of Nodes with the data returned by using
	 	 // the ReqPro COM server.
	 	 for (long lIndex=0; lIndex < PtrArray.GetSize(); lIndex++)
	 	 {
	 	 	 // Get instance of CReqInfo.
	 	 	 CReqInfo *pReqInfo = (CReqInfo *)PtrArray.GetAt(lIndex);
	 	 	 
	 	 	 // Copy the requirement name.
	 	 	 _tcscpy(pNodeArray[lIndex].Name, (const char
	 	 	 *)pReqInfo->m_sName);

	 	 	 // Copy the Container and NeedsValidation attributes.
	 	 	 pNodeArray[lIndex].IsOnlyContainer = pReqInfo->m_bContainer;
	 	 	 pNodeArray[lIndex].NeedsValidation =
	 	 	 pReqInfo->m_bNeedsValidation;

	 	 	 // Copy the Requirement NodeID (which is a GUID for a ReqPro
	 	 	 // requirement).
	 	 	 _tcscpy(pNodeArray[lIndex].NodeID, pReqInfo->m_sGUID);

	 	 	 char szNodeType[TI_MAX_TYPE+1];
	 	 
	 	 	 /* CODE OMITTED: Obtain the name of the requirement type by
	 	 	 	 using 	 	 the ReqPro COM server.*/
	 	 
	 	 	 // Copy the name of requirement type into the node structure.
	 	 	 _tcscpy(pNodeArray[lIndex].Type, (char *) szNodeType);

	 	 	 delete pReqInfo;
	 	 } 

	 	 // Set the return pointer for the node array.
	 	 *pSelectedNodes = pNodeArray;

	 	 // Set the count for the number of returned nodes.
	 	 *pNodeCount = PtrArray.GetSize();
	 }
	 else
	 	 rc = TI_ERROR_INVALID_SOURCEID;

	 return rc;
}

See Also

TIShowProperties()

prevnext


Rational TestManager Extensibility Reference Rational Software Corporation
Copyright (c) 2003, Rational Software Corporation http://www.rational.com
support@rational.com
info@rational.com