Lifecycle Applications

Engineering Change Management

The Configured Views Interface

Working with Effectivities and Product Views
Use Case

Abstract

This article shows how to use the ENOVICWConfiguredViews interface of the ENOVInterfaces framework to add a configured view in Change Management. A configured view is added to an Engineering Change Order as an Effectivity and added to an Action as a Product View.


What You Will Learn With This Use Case

This use case is intended to show you how to add an existing configured view to Change Management objects. In this case, a product is added to an existing Engineering Change Order as an Effectivity and to an Action as a Product View. You would use this operation if for example you would like to direct the modification of a certain group of a product that was manufactured within a specified time range, has a specific configuration, or has certain serial numbers. The product is attached to the ECO as an Effectivity object and the ECO controls the modification of the specified group. The Product View ensures that the required action is performed on a specific set of products. The product must be a configurable object with a configured view. The ENOVInterfaces framework contains the interface ENOVICWConfiguredViews which allows you to directly add an Effectivity to an ECO and a Product View to an Action.

[Top]

The CAAEviConfiguredViews Use Case

CAAEviConfiguredViews is a use case of the CAAENOVInterfaces.edu framework that illustrates how you use the ENOVICWAffectedObjects interface to add and remove an Effectivity for an existing Engineering Change Order. It also shows how to add and remove a Product View for an existing Action.

[Top]

What Does CAAEviConfiguredViews Do?

CAAEviConfiguredViews begins by opening a VPM session and creating a login a session. Then the Eco Manager and Action Manager are retrieved. To set up the demonstration, an ECO and an Action are created with the necessary parameters as well as a product and configured view. For more information on how to create an ECO, refer to use case CAAEviEcoManager, and to CAAEviActionManager for information on how to create an Action. After the necessary objects are created, the subject interface is used to add the product's configured view to the ECO as an Effectivity and to the Action as a Product view. Then, the interface is used to remove the Effectivity and Product View.

The ENOVInterfaces interface/methods shown here are:

[Top]

How to Launch CAAEviConfiguredViews

To launch CAAEviConfiguredViews, you will need to set up the build time environment, then compile CAAEviConfiguredViews.cpp along with its prerequisites, set up the run time environment, and then execute the use case. The required interfaces can be found in the ENOVInterfaces, VPMInterfaces, VPMPersistency, System, and VPMTpManager frameworks. From the directory where the executable file is stored, enter"CAAEviConfiguredViews" to execute the program. [1].

[Top]

Where to Find the CAAEviConfiguredViews Code

The CAAEviConfiguredViews use case is made of a single file located in the CAAEviConfiguredViews.m module of the CAAENOVInterfaces.edu framework:

Windows InstallRootDirectory\CAAENOVInterfaces.edu\CAAEviConfiguredViews.m\
Unix InstallRootDirectory/CAAENOVInterfaces.edu/CAAEviConfiguredViews.m/

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

[Top]

Step-by-Step

For demonstration purposes, the code from the CAAEviConfiguredViews use case is shown here. After the preliminary set up of creating the ECO, Action, and product as a configured view, there are four logical steps:

  1. Add an Effectivity to an ECO
  2. Remove Effectivity from ECO
  3. Add a Product View an Action
  4. Remove Product View from Action

[Top]

Add an Effectivity to an ECO

    #include "ENOVICWConfiguredViews.h"
    #include "CATIEnovCMEffectivity.h"
    #include "CATUnicodeString.h"
    

These include statements give access to the interfaces demonstrated here.

//---Add a CMEffectivity to the ECO
 
    CATUnicodeString prodName("MyProduct");
    CATUnicodeString EffId("MyEffectivity");
    CATIEnovCMEffectivity_var ecoEff = NULL_var;
    ENOVICWConfiguredViews_var spCfgView(Eco);
       
    rc = spCfgView->AddNewEcoEffectivity(CV1, 
    					 prodName,
    					 EffId,
    					 ecoEff);
    
    if (ecoEff==NULL_var||!SUCCEEDED(rc))
    {
    	cout << "ERROR in adding Effectivity to ECO." << endl << flush;    
    	VPMSession::CloseSession();
    	return 12;
    }
    cout << "Added Effectivity to ECO successfully." << endl << flush;   
      

 

  1. After the VPM session is opened, and the ECO and product created, you can use the ENOVICWConfiguredViews interface to add the configured view to the ECO.
  2. The existing configured view is the CV1 variable. The ECO object, Eco, is cast as a ENOVICWConfiguredViews type - spCfgView.
  3. With the prodName set as "MyProduct" , the EffId set as "MyEffectivity", spCfgView calls method AddNewEcoEffectivity.
  4. The method returns S_OK if successful and the Effectivity ecoEff is created.

[Top]

Remove Effectivity from ECO

    #include "ENOVICWConfiguredViews.h"
    #include "CATIEnovCMEffectivity.h"
        

These include statements give access to the interface demonstrated here.

//---Remove Effectivity from the ECO
       
    rc = spCfgView->RemoveEcoEffectivity(ecoEff);
    
    if (!SUCCEEDED(rc))
    {
    	cout << "ERROR in removing Effectivity from ECO." << endl << flush;    
    	VPMSession::CloseSession();
    	return 13;
    }
    cout << "Removed Effectivity from ECO successfully." << endl << flush; 
      

 

  1. With the ECO object, Eco, cast as a ENOVICWConfiguredViews type - spCfgView, a call is made to method RemoveEcoEffectivity.
  2. The method returns S_OK if successful and the Effectivity ecoEff is removed from the ECO.

[Top]

Add an Product View to an Action

    #include "ENOVICWConfiguredViews.h"
    #include "CATIVpmAFLProductView.h"
    #include "CATUnicodeString.h"
    

These include statements give access to the interface demonstrated here.

 //--- Add an AFLProdView to the Action 
 
    CATIVpmAFLProductView_var AFLPV = NULL_var;
    CATUnicodeString productName("MyProduct");
    CATUnicodeString AddToObjType("ENOVIA_AFLAction");
    ENOVICWConfiguredViews_var spCV(Action);

    rc = spCV->AddAFLProdView(CV2, 
    			      productName,
    			      AddToObjType,
    			      AFLPV);
    
    if (AFLPV==NULL_var||!SUCCEEDED(rc))
    {
    	cout << "ERROR in adding Product View to Action." << endl << flush;    
    	VPMSession::CloseSession();
    	return 14;
    }
    cout << "Added Product View to Action successfully." << endl << flush;
      

 

  1. After the VPM session is opened, and the Action and product created, you can use the ENOVICWConfiguredViews interface to add the configured view to the Action.
  2. The existing configured view is the CV2 variable. The Action object, Action, is cast as a ENOVICWConfiguredViews type - spCV.
  3. With the productName set as "MyProduct" and the AddToObjType set to "ENOVIA_AFLAction", spCV calls method AddAFLProductView.
  4. The method returns S_OK if successful and the Product View, AFLPV is created.

[Top]

Remove Product View from Action

    #include "ENOVICWConfiguredViews.h"
    #include "CATIVpmFactoryObject.h"
        

These include statements give access to the interfaces demonstrated here.

//---Remove AFLProdView from the Action
     
    CATIVpmFactoryObject_var factObj(CV2);   
    rc = spCV->RemoveAFLProdView(factObj);
    
    if (!SUCCEEDED(rc))
    {
    	cout << "ERROR in removing Product View from Action." << endl << flush;    
    	VPMSession::CloseSession();
    	return 15;
    }
    cout << "Removed Product View from Action successfully." << endl << flush; 
      

 

  1. First the configured view, CV2, is cast as a Factory Object, factObj.
  2. Then, with the Action cast as a ENOVICWConfiguredViews type - spCV, a call is made to RemoveAFLProdView.
  3. The method returns S_OK if successful and the Product View is removed from the Action.

[Top]


In Short

Use the ENOVICWConfiguredViews interface available in the ENOVInterfaces framework to add an existing configured view object to an existing ECO as an Effectivity or to an Action as a Product View. The same interface is used for removal of the configured view.

[Top]


References

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

History

Version: 1 [Feb 2002] Document created
[Top]

Copyright © 1994-2002, Dassault Systèmes. All rights reserved.