//Copyright 2020 Siemens Digital Industries Software //================================================== //Copyright $2015. //Siemens Product Lifecycle Management Software Inc. //All Rights Reserved. //================================================== //Copyright 2020 Siemens Digital Industries Software /** @file This file contains the declaration of a helper/utility class which is used to batch the Bulk Input objects based on the operation ID inorder to support Bulk processing operation on BO. Example if the Item, ItemRevision, Dataset etc. inherit same operation all objects of the above mentioned types are grouped/batched together based on the operation, to do the bulk processing of the objects during execution of the operation. This class is used by auto-generated Dispatch mechanism (<BO>Dispatch::operation) for a set based operation only.
To facilitate the compile/build of the auto generated Dispatch classes, this class is made public. @note The class and its members are not intended to be used explicitly for any other purposes. */ #ifndef TEAMCENTER_OPERATIONOBJECTBATCH_HXX #define TEAMCENTER_OPERATIONOBJECTBATCH_HXX #include #include #include #include #include namespace Teamcenter { class OperationObjectBatch; } class METAFRAMEWORK_API Teamcenter::OperationObjectBatch { public: typedef std::vector BulkInputList; typedef std::vector OperationObjectBatchList; typedef std::map OpDispatchPtr2OpObjectBatchPtrMap; typedef std::map TypeTag2OpDispatcherPtrMap; /** Creates the operation batches based on the operation ID and the BulkInput objects. @returns
  • ITK_ok on success
  • EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if any object type in the @p bulkInputs does not support the operation specified by @p operationID or @p operationInt.
  • EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if @p operationID is empty and @p operationInt is "-1".
*/ static int populateOperationBatchesInternal( const std::string& operationID, /**< (I) The operation ID. If it is empty, a valid value must be provided for @p operationInt. */ int* operationInt, /**< (I/O) The operation integer related to the operation ID.
If its value is "-1", a valid @p operationID must be provided, and the @p operationID is used to compute the value of @p operationInt. */ const BulkInputList* bulkInputs, /**< (I) The list of BulkInput objects provided for computing the OperationObjectBatch objects */ OperationObjectBatchList& objBatches /**< (O) The list of created OperationObjectBatch objects */ ); /** Populates the object batches for Island of Data. The Island of Data includes all the attached Business Objects that will be copied over when the top Business Object is SaveAsed.
This method is applicable only for Save-As scenario. @returns
  • ITK_ok on success
  • EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if any object type in the @p bulkInputs does not support the operation specified by @p operationID or @p operationInt.
  • EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if @p operationID is empty and @p operationInt is "-1".
*/ static int populateOperationBatchesForIslandOfData( const std::string& operationID, /**< (I) The operation ID. If it is empty, a valid value must be provided for @p operationInt. */ int* operationInt, /**< (I/O) The operation integer related to the operation ID.
If its value is "-1", a valid @p operationID must be provided, and the @p operationID is used to compute the value of @p operationInt. */ const BulkInputList* inputs, /**< (I) The list of BulkInput objects provided for computing the OperationObjectBatch objects */ OperationObjectBatchList& batches /**< (O) The list of created OperationObjectBatch objects */ ); /** Populates the object batches For Delete.
This method is invoked during fnd0BulkDelete / fnd0Refresh / fnd0Lock / fnd0Unlock / fnd0Save @returns
  • ITK_ok on success
  • EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if any object type in the @p bulkInputs does not support the operation specified by @p operationID or @p operationInt.
  • EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if @p operationID is empty and @p operationInt is "-1".
*/ static int populateOperationBatches( const std::string& operationId, /**< (I) The operation ID. If it is empty, a valid value must be provided for @p operationInt. */ int* operationInt, /**< (I/O) The operation integer related to the operation ID. br/>If its value is "-1", a valid @p operationID must be provided, and the @p operationID is used to compute the value of @p operationInt. */ const BulkInputList* inputs, /**< (I) The list of BulkInput objects provided for computing the OperationObjectBatch objects */ OperationObjectBatchList& batches /**< (O) The list of created OperationObjectBatch objects */ ); /** Populates the object batches for Create.
This method is applicable only for Create scenario. @returns
  • ITK_ok on success
  • EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if any object type in the @p bulkInputs does not support the operation specified by @p operationID or @p operationInt.
  • EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if @p operationID is empty and @p operationInt is "-1".
*/ static int populateOperationBatchesForCreate( const std::string& operationID, /**< (I) The operation ID. If it is empty, a valid value must be provided for @p operationInt. */ int* operationInt, /**< (I/O) The operation integer related to the operation ID.
If its value is "-1", a valid @p operationID must be provided, and the @p operationID is used to compute the value of @p operationInt. */ const BulkInputList* inputs, /**< (I) The list of BulkInput objects provided for computing the OperationObjectBatch objects */ OperationObjectBatchList& batches /**< (O) The list of created OperationObjectBatch objects */ ); /** Deletes the operation object batches */ static void deleteOperationObjectBatches( OperationObjectBatchList& objectBatches /**< (I) The list of OperationObjectBatch objects to be deleted */ ); /** Retrieves the BulkInput object list from this instance */ void getBulkInputObjects( BulkInputList& bulkInputObjects /**< (O) The list of BulkInput objects in a OperationObjectBatch */ ) const; /** Retrieves the operation dispatcher object from this instance */ OperationDispatcher* getDispatcherObject() const; private: OperationObjectBatch(); /** Copy constructor */ OperationObjectBatch( const OperationObjectBatch& ); /** Assignment operator */ OperationObjectBatch& operator = ( const OperationObjectBatch& ); /** Adds the bulk input objects to the created/existing object batches */ void addBulkInputObjects( const BulkInput* inputObjects /**< (I) The list of BulkInput objects to be added to the object batch */ ); /** Sets the operation dispatcher associated with the object batch */ void setDispatcherObject( OperationDispatcher * dispatcherObject /**< (I) The operation dispatcher object to be set to the object batch */ ); OperationDispatcher* m_operationDispatcher; BulkInputList m_bulkInputs; }; #include #endif