CATPLMIntegrationUse CATAdpVersionMaker

Usage: you must use this class as is. You should never derive it.


public class CATAdpVersionMaker

Class enabling to perform a new Version of a Component.

Role:

This class creates new Components which are versions of given Components if compliant with Versioning protocol. In IRPC typing, only references and representations can be passed as input.

A versioning scope is calculated dynamically. The following components may be transformed (and returned in the result set) if aggregated under a given reference, even if not specified in input :

Example of usage :
 CATAdpVersionMaker Versionator;
 Versionator.FromAnyVersion();
 while()
 {
   if(FAILED(Versionator.AddElement(pMyComp))
   //Error management
 }
 
Then :
 if(FAILED(Versionator.RunVersioning())
 {
    CATIAdpPLMErrorReviewer pErrorReviewer = NULL;
    Versionator.GetErrorReviewer(pErrorReviewer);
    //manage errors
    CATSysReleasePtr(pErrorReviewer);
 }
 
Or :
 CATAdpComponentsAssociation versionedComponents;
 if(SUCCEEDED(Versionator.RunVersioning(versionedComponents))
 {
   CATAdpComponentsAssociationIter iter(versionedComponents.GetIterator());
   CATIAdpPLMIdentificator *pSource, *pEvolved = NULL;
   while(S_OK == iter.NextComponent(pSource, pEvolved))
   {
      //Do something
      CATSysReleasePtr(pSource);
      CATSysReleasePtr(pEvolved);
   }
 }
 else
 {
    CATIAdpPLMErrorReviewer *pErrorReviewer = NULL;
    Evolutor.GetErrorReviewer(pErrorReviewer);
    //manage errors
    CATSysReleasePtr(pErrorReviewer);
 }


Constructor and Destructor Index


o CATAdpVersionMaker(CATIAdpPLMErrorReviewer*)
Constructor
o CATAdpVersionMaker(CATTime&,CATIAdpPLMErrorReviewer*)
Constructor
o ~CATAdpVersionMaker()

Method Index


o AddElement(CATIAdpPLMIdentificator*)
Add element to version
Role: Entry point to add elements for Versioning operation.
o AddElements(CATListPtrCATIAdpPLMIdentificator&)
Add elements to version
Role: Entry point to add elements for Versioning operation.
o AddPath(CATListPtrCATIAdpPLMIdentificator&)
Add a path of Components to version
Role: Entry point to add a path of Components for Versioning operation.
o FromAnyVersion()
Set the ability to perform a save from any version.
o GetErrorReviewer(CATIAdpPLMErrorReviewer*&)
Get the error reviewer.
o RunVersioning()
Launch Versioning operation on the server.
o RunVersioning(CATAdpComponentsAssociation&)
Launch Versioning operation on the server.

Constructor and Destructor


o CATAdpVersionMaker
public CATAdpVersionMaker( iErrorReviewer=0)
Constructor
Parameters:
iopErrorReviewer
An error reviewer.
See also:
o CATAdpVersionMaker
public CATAdpVersionMaker( iApplicabilityDate,
iErrorReviewer=0)
Constructor
Parameters:
iApplicabilityDate
[in] The applicability date of the new version of the component.
iopErrorReviewer
An error reviewer.
See also:
o ~CATAdpVersionMaker
public virtual ~CATAdpVersionMaker()

Methods


o AddElement
public AddElement( iComponent)
Add element to version
Role: Entry point to add elements for Versioning operation. The elements will be versioned only if the Version method is called.
Parameters:
iComponent
[in] : The Component to version. Elements must be of a PLM type compliant with Versioning protocol, else an error will be put in the error monitor at versioning time.
Returns:
S_OK Operation succeeded
E_FAIL Component cannot be versioned. See error reviewer content to fetch errors details. Nothing was done during the operation
o AddElements
public AddElements( const iComponents)
Add elements to version
Role: Entry point to add elements for Versioning operation. The elements will be versioned only if the Version method is called.
Parameters:
iComponents
[in] : The Components to version. Elements must be of a PLM type compliant with Versioning protocol, else an error will be put in the error monitor at versioning time.
Returns:
S_OK Operation succeeded
E_FAIL Components cannot be versioned. See error reviewer content to fetch errors details. Nothing was done during the operation
o AddPath
public AddPath( const iPathOfComponents)
Add a path of Components to version
Role: Entry point to add a path of Components for Versioning operation. The elements will be versioned only if the Version method is called. The whole branch will be versioned at once when calling the Version method, thus leading to the creation of a new branch of versions in the database.
Parameters:
iPathOfComponents
[in] : The Components to version. Elements must be of a PLM type compliant with Versioning protocol, else an error will be put in the error monitor at versioning time.
Returns:
S_OK Operation succeeded
E_FAIL Components cannot be versioned. See error reviewer content to fetch errors details. Nothing was done during the operation
o FromAnyVersion
public FromAnyVersion()
Set the ability to perform a save from any version.
Role: Set the ability in the VersionEngine to perform a save from any version. Be aware that this api must be called before any AddPath , AddElements or AddElement api call. Components from any version will be saved in the version up of the last version of a version family when the api RunVersioning will be used.
Returns:
S_OK Operation succeeded
E_UNEXPECTED If the VersionEngine has been already initialized on the CATAdpVersionMaker object by any AddPath , AddElements, AddElement api call .Nothing was done during the operation
o GetErrorReviewer
public GetErrorReviewer( oErrorReviewer)
Get the error reviewer.
Parameters:
oErrorReviewer
[out, CATBaseUnknown#Release] Reviewer containing errors
See also:
o RunVersioning
public RunVersioning()
Launch Versioning operation on the server.
Role: The new Versions are created on the server at this very moment. Elements won't be replaced in session.
Returns:
S_OK Operation succeeded
E_FAIL Error were encountered, no version done. See error reviewer content to fetch errors details. Nothing was done during the operation
E_UNEXPECTED Error were encountered, no version done. See error reviewer content to fetch errors details. Nothing was done during the operation
o RunVersioning
public RunVersioning( oComponentsAssociation)
Launch Versioning operation on the server.
Role: The new Versions are created on the server at this very moment. Elements won't be replaced in session. This method will return the new versions pf the components. The components which were not added to this class but which were versioned/duplicated though (eg. instances, connexions, ports...) will be available in output.
Parameters:
oComponentsAssociation
[out] Association of original components and versions (output of versioning operation). Every versioned or duplicated component will be here.
Returns:
S_OK Operation succeeded
E_FAIL Error were encountered, no version done. See error reviewer content to fetch errors details. Nothing was done during the operation
E_UNEXPECTED Error were encountered, no version done. See error reviewer content to fetch errors details. Nothing was done during the operation

This object is included in the file: CATAdpVersionMaker.h
If needed, your Imakefile.mk should include the module: CATPLMIntegrationUse

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.