3D PLM Enterprise Architecture

VPM Navigator

Filtering a PRC by a configuration Handler

Filtering the explore windows of a PRC by a LCA configuration Handler
Use Case

Abstract

This article shows the way to filter the explore windows of a PRC by a LCA configuration Handler using the public interface CATImmCAAServices and explains how to use it in a command.


What You Will Learn With This Use Case

This use case is intended to explain how to filter the explore windows of a PRC by a LCA configuration Handler using the public interface CATImmCAAServices. Use of such a test case is demonstrated by means of a test command (CAAImmCAAServicesTestCmd) from an Explorer window.

[Top]

The CATImmCAAServices and test Command Use Case

The test Command is a use case of the CAACATImmENOVIAProvider.edu framework that illustrates CATImmCAAServices interface capabilities.

[Top]

What Does the CATImmCAAServices test Command Do

CAAImmCAAServicesTestCmd is a command which returns the CurrentRootIdentifiers,the associated configuration handlers and sets/resets the configuration handler(s) in a VPM explore window.

The icon for the CAAImmCAAServicesTestCmd is included in the CAAImmIdAcqAgentTestCmd toolbar as follows:

CAAImmCAAServicesTestCmd.jpg

[Top]

How to Launch the CAAImmCAAServicesTestCmd command

To launch CAAImmCAAServicesTestCmd , you will need to set up the build time environment, then compile CAAImmCAAServicesTestCmd along with its prerequisites, set up the run time environment, and then execute the use case [1] in the following way:

[Top]

Where to Find the CAAImmCAAServicesTestCmd Code

The test command is made up of a single class named CAAImmCAAServicesTestCmd located in the CAAImmCAAServicesTestCmd.m module of the CAACATImmENOVIAProvider.edu framework :

Windows InstallRootDirectory\CAACATImmENOVIAProvider.edu\CAAImmCAAServicesTestCmd.m\
Unix InstallRootDirectory/CAACATImmENOVIAProvider.edu/CAAImmCAAServicesTestCmd.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Step-by-Step

To filter the explore windows of a PRC by a LCA configuration Handler, following steps should be followed:

# Step Where
1 Declare the CATImmCAAServices object Header file
2 Instantiate the CATImmCAAServices object Initialise method
3 Get the Current Root and its Identifiers in the VPMNAV window Initialise method
4 Get the ConfigFilter(s) assosiated with the PRC Initialise method
5 Set/Reset the Config filter. Activate method
6 Release the CATImmCAAServices object Destructor

[Top]

Declare the CATImmCAAServices object

The CAAImmCAAServicesTestCmd command derives from CATCommand.

class CAAImmCAAServicesTestCmd: public CATCommand
{
...
private:
	   CATImmCAAServices* _ImmServiceObj;
    ...

In addition some other private members of the type CATUnicodeString and CATListOfCATUnicodeString are defined which contain the information about the root identifiers and their names, configuration filters and their names.

[Top]

Instantiate the CATImmCAAServices object

The CATImmCAAServices object is instantiated in the command Initialise method.

int Initialise()
{
...
_ImmServiceObj = new CATImmCAAServices();
  ...

[Top]

Get the Current Root and its Identifiers in the VPMNAV window

Still in the Initialise method,the current root and its identifiers are obtained using GetCurrentRootIdentifiers method of the CATImmCAAServices class.

  ...
hr = _ImmServiceObj->GetCurrentRootIdentifiers(_oIdentifierNames,_oIdentifierValues,_oRootType);
  ...

If the GetCurrentRootIdentifiers method fails then a faliure message is displayed and the execution of the command ends. On success the name of identifier of the PRC, its value and the root type is displayed.

[Top]

Get the ConfigFilter(s) assosiated with the PRC

The ConfigFilter(s) associated with the PRC are also obtained in the Initialise method.

  ...
  hr = _ImmServiceObj->GetPRCConfigFilter(_oIdentifierNames,_oIdentifierValues,_oCHdsNames,_oCHdsValues);
  ...

If the GetPRCConfigFilter method fails or no configuration handler associated with the PRC is found then an appropriate message or a faliure message is displayed and the execution of the command ends.On success the names of the configuration handlers associated with the PRC are displayed.

[Top]

Set/Reset the Config filter

If there are one or more configuration handlers associated with the PRC then the user is asked to set/reset the configuration handler on a PRC by choosing OK/Cancel option from the dialog box. Pressing OK sets the first of the configuration handler(s) in the list of configuration handler(s) while pressing Cancel resets(removes) the configuration set on the PRC. This is done in the Activate method of the test command.

...
CATDlgNotify* pRunDlg = new CATDlgNotify(CATApplicationFrame::GetFrame()->GetMainWindow (), "VPM_Identification",CATDlgNfyOKCancel|CATDlgWndModal);
   int a = pRunDlg->DisplayBlocked(type_message, title);
   pRunDlg->RequestDelayedDestruction();
   pRunDlg = NULL;

   CATListOfCATUnicodeString CHdsNames;
   CATListOfCATUnicodeString CHdsValues;
   if( a == 2 )
   {
      CHdsNames.Append("ID");
      CHdsValues.Append("");
   }
   else 
   {
      CHdsNames.Append(_oCHdsNames[1]);
      CHdsValues.Append(_oCHdsValues[1]);
   }
   
   int b = Set( _oIdentifierNames,_oIdentifierValues,CHdsNames,CHdsValues);
  ...

Using the Set function, the configuration handler is set/reset depening on the choice of user. The set function in turn calls the SetPRCConfigFilter of the CATImmCAAServices class

  ...
 hr = _ImmServiceObj->SetPRCConfigFilter(iPRCIdentifiersNames,iPRCIdentifiersValues,iCHdsNames,iCHdsValues);
  ...

The user is then notified about the success or faliure of the function through a notify box.

[Top]

Release the CATImmCAAServices object

It is recommended to deallocate the CATImmCAAServices object at the end of the command, or when its use is finished in the following way,

...
   if(_ImmServiceObj)
   {
      delete _ImmServiceObj;
      _ImmServiceObj=NULL;
   }	
  ...

[Top]


In Short

This use case shows the way to filter the explore windows of a PRC by a LCA configuration Handler using the public interface CATImmCAAServices and explains how to use it in a command.

[Top]


References

[1] Building and Launching a CAA V5 Use Case
[Top]

History

Version: 1 [July 2006] Document created
[Top]

Copyright © 2006, Dassault Systèmes. All rights reserved.