All Frameworks  Class Hierarchy  This Framework  Indexes

CATPDMBase Global Function RunServerCode


HRESULT RunServerCode( const CATUnicodeString& iCmdName,
CATVariant& iInput,
CATVariant& oOutput)
Enable the execution of command on ENOVIA V5 server.
Role:This method enables customized code written in CATIA to exercise customized code written in the ENOVIA V5 server.


Interop infrastructure does the marshalling of input and output arguments between the 2 process.
Interop does the adequate RPC call in ENOVIA by instanciating the requested late type and calling it on ENOVIUERunInteropServerCode::RunServerCode.

Parameters:
iCmdName

Three pre-defined commands are available:
  • "EnovTransferToOwner": allows transfer ownership of a part to a given user.
    The iInput argument must be a CATVariant containing a CATSafeArray with:
    • the part number value of the part.
    • the value of user that we want to transfer ownership of part.
    • the value of V_Organisation attribute for the new owner.
    • the value of V_Role attribute for the new owner.
    • the value of V_Project attribute for the new owner.
    In fact if we change the owner of a given part we need update the role, the organisation and the project value for the new owner of part.
  • "EnovPromoteToFinalState": allows the promote of a given part.
    The iInput argument must contain the part number of the part to promote to final state. The change will be committed only if the action succeeds.
  • "EnovPartAttribute": allows valuate the attributes on a created part.
    The iInput argument must contain the part number of the part whose attribute must be set by ENOVIA server code.
    The default implementation does nothing on attribute. this is a sample that explains how to modify ENOVIA attributes.

iCmdName is the Late type on server side containing the customized code. We provide for this above late type one default implementation for the last part version in ENOVIA Server.
The late type iCmdName should implement the interface ENOVIUERunInteropServerCode.

The customization developer is in charge of writting customized code in ENOVIA LCA, the code in ENOVIA being developped as a late type implementing the interface ENOVIUERunInteropServerCode.

User implementing such commands must avoid use services that set values on the server side. Such services may not be compatible with ENOVIA native process.

iInput
Input information for iCmdName command.
It is marshalled to the server and passed in as input to the customized code on server side.
oOutput
Information returned by customized code on server side.
It is marashalled back to CATIA and returned to the caller of this method.
Returns:
  • S_OK: command successfully executed on server
  • E_FAIL: The method has failed. Possible reasons of error are:
    • Invalid argument
    • Connection to ENOVIA V5 database doesn't exist

This object is included in the file: CATPDMInteropServices.h

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