CATPLMIntegrationUse CATAdpEvolutionMaker

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


public class CATAdpEvolutionMaker

Class enabling to perform Evolution of a Component.

Role:

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

An Evolution 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 :

If defined, the relevant PLMIdentificationInitialization business logic with 'Cloning' OperationId will be called on every impacted references or representations. If not defined a default logic is applied by adding the given IdCloningString to the first string attribute of the identifier set (most of the time the attribute PLM_ExternalID).

If a specific attribute set is associated to a given component, those attributes will applied after the attributes defined by the previous business logic. It may overwrite some of them.

Example of usage :
 CATAdpEvolutionMaker Evolutor;
 while()
 {
   CATAdpAttributeSet attributeSet;
   // Code which specifies attributes to change, like attributes in the identificator set
   // ...
   if(FAILED(Evolutor.AddElement(pMyComp, attributeSet))
   //Error management
 }
 
Then :
 if(FAILED(Evolutor.Evolve())
 {
    CATIAdpPLMErrorReviewer pErrorReviewer = NULL;
    Evolutor.GetErrorReviewer(pErrorReviewer);
    //manage errors
    CATSysReleasePtr(pErrorReviewer);
 }
 
Or :
 CATAdpComponentsAssociation evolvedComponents;
 if(SUCCEEDED(Evolutor.Evolve(evolvedComponents))
 {
   CATAdpComponentsAssociationIter iter(evolvedComponents.GetIterator());
   CATIAdpPLMIdentificator *pSource, *pEvolved = NULL;
   while(S_OK == iter.NextComponent(pSource, pEvolved))
   {
      //Do something
      CATSysReleasePtr(pSource);
      CATSysReleasePtr(pDuplicated);
   }
 }
 else
 {
    CATIAdpPLMErrorReviewer *pErrorReviewer = NULL;
    Evolutor.GetErrorReviewer(pErrorReviewer);
    //manage errors
    CATSysReleasePtr(pErrorReviewer);
 }


Constructor and Destructor Index


o CATAdpEvolutionMaker(CATIAdpPLMErrorReviewer*)
Constructor
o CATAdpEvolutionMaker(CATUnicodeString&,CATIAdpPLMErrorReviewer*)
Constructor
o ~CATAdpEvolutionMaker()

Method Index


o AddElement(CATIAdpPLMIdentificator*)
Add element to evolve
Role: Entry point to add elements for Evolution operation.
o AddElement(CATIAdpPLMIdentificator*,CATAdpAttributeSet&)
Add element to evolve with specific attributes to be set on the clone.
o Evolve()
Launch Evolution operation.
o Evolve(CATAdpComponentsAssociation&)
Launch Evolution operation.
o GetErrorReviewer(CATIAdpPLMErrorReviewer*&)
Get the error reviewer.

Constructor and Destructor


o CATAdpEvolutionMaker
public CATAdpEvolutionMaker( iopErrorReviewer= NULL)
Constructor
Parameters:
iopErrorReviewer
An error reviewer.
See also:
o CATAdpEvolutionMaker
public CATAdpEvolutionMaker( const iIdCloningString,
iopErrorReviewer= NULL)
Constructor
Parameters:
iIdCloningString
The Cloning string identifier which will be given as input of the Business Logic.
iopErrorReviewer
An error reviewer.
See also:
o ~CATAdpEvolutionMaker
public virtual ~CATAdpEvolutionMaker()

Methods


o AddElement
public AddElement( ipAdpIdentificator)
Add element to evolve
Role: Entry point to add elements for Evolution operation. The elements will be evolved only if the Evolve method is called. When using this method, it is recommended that you also specify a non empty and unique iIdCloningString in the constructor. This string will be passed as input to the PLMIdentificationInitialization business logic or be set as prefix of the identifier set if no relevant business logic is found. If iIdCloningString is not specified and components are add this way, naming conflicts may prevent the cloning operation. Please note that CAA attributes are always copied.
Parameters:
*ipAdpIdentificator
[in] : The element to evolve. Elements must be of a PLM type compliant with Evolution protocol (Reference, RepReference, Entity...), else an error will be put in the error monitor at evolution time.
Returns:
S_OK Operation succeeded
E_FAIL Error were encountered, no evolution done. See error reviewer content to fetch errors details. Nothing was done during the operation
E_UNEXPECTED Error were encountered, no evolution done. See error reviewer content to fetch errors details. Nothing was done during the operation
o AddElement
public AddElement( ipAdpIdentificator,
const iAdpAttributeSet)
Add element to evolve with specific attributes to be set on the clone.
Role: Entry point to add elements for Evolution operation. The elements will be evolved only if the Evolve method is called. The attribute set is associated to the adp identificator . The given attributes will complete and may overwrite the ones retrieved through the PLMIdentificationInitialization business logic. When using this method, it is recommended that you also specify a non empty and unique iIdCloningString in the constructor. This string will be passed as input to the PLMIdentificationInitialization business logic or be set as prefix of the identifier set if no relevant business logic is found. If iIdCloningString is not specified and components are add this way, naming conflicts may prevent the cloning operation. Please note that CAA attributes are always copied.
Parameters:
*ipAdpIdentificator
[in] : The element to evolve. Elements must be of a PLM type compliant with Evolution protocol (Reference, RepReference, Entity...), else an error will be put in the error monitor at evolution time.
&iAdpAttributeSet
[in] : The attributes which will be overriden. The modified attributes must only be of string type.
Returns:
S_OK Operation succeeded
E_FAIL Error were encountered, no evolution done. See error reviewer content to fetch errors details. Nothing was done during the operation
E_UNEXPECTED Error were encountered, no evolution done. See error reviewer content to fetch errors details. Nothing was done during the operation
o Evolve
public Evolve()
Launch Evolution operation.
Role: The Evolution is done on the server at this very moment. Elements are allowed to be in session. Elements won't be replaced in session. This method won't return the cloned components.
Returns:
S_OK Operation succeeded
E_FAIL Error were encountered, no evolution done. See error reviewer content to fetch errors details. Nothing was done during the operation
E_UNEXPECTED Error were encountered, no evolution done. See error reviewer content to fetch errors details. Nothing was done during the operation
o Evolve
public Evolve( oComponentsAssociation)
Launch Evolution operation.
Role: The Evolution is done on the server at this very moment. Elements are allowed to be in session. Elements won't be replaced in session. This method will return the cloned components. The components which were not added to this class but which were evolved though (ie. instances, connexions, ports...) will be present in output.
Parameters:
oComponentsAssociation
[out] Association of original components and evolutions (output of evolution operation). Every evolved component will be here.
Returns:
S_OK Operation succeeded
E_FAIL Error were encountered, no evolution done. See error reviewer content to fetch errors details. Nothing was done during the operation
E_UNEXPECTED Error were encountered, no evolution done. See error reviewer content to fetch errors details. 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:

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

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