You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
9.0 KiB
176 lines
9.0 KiB
//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.
|
|
<br/>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 <map>
|
|
#include <unidefs.h>
|
|
|
|
#include <extensionframework/OperationDispatcher.hxx>
|
|
#include <metaframework/BulkCopyInput.hxx>
|
|
#include <metaframework/libmetaframework_exports.h>
|
|
|
|
|
|
namespace Teamcenter
|
|
{
|
|
class OperationObjectBatch;
|
|
}
|
|
|
|
class METAFRAMEWORK_API Teamcenter::OperationObjectBatch
|
|
{
|
|
public:
|
|
typedef std::vector<Teamcenter::BulkInput*> BulkInputList;
|
|
typedef std::vector<OperationObjectBatch*> OperationObjectBatchList;
|
|
typedef std::map<OperationDispatcher*, OperationObjectBatch*> OpDispatchPtr2OpObjectBatchPtrMap;
|
|
typedef std::map<tag_t, OperationDispatcher*> TypeTag2OpDispatcherPtrMap;
|
|
|
|
/**
|
|
Creates the operation batches based on the operation ID and the BulkInput objects.
|
|
@returns
|
|
<ul>
|
|
<li>ITK_ok on success
|
|
<li>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.
|
|
<li>EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if @p operationID is empty and @p operationInt is "-1".
|
|
</ul>
|
|
*/
|
|
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.
|
|
<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* 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.
|
|
<br/>This method is applicable only for Save-As scenario.
|
|
@returns
|
|
<ul>
|
|
<li>ITK_ok on success
|
|
<li>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.
|
|
<li>EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if @p operationID is empty and @p operationInt is "-1".
|
|
</ul>
|
|
*/
|
|
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.
|
|
<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 Delete.
|
|
<br/> This method is invoked during fnd0BulkDelete / fnd0Refresh / fnd0Lock / fnd0Unlock / fnd0Save
|
|
@returns
|
|
<ul>
|
|
<li>ITK_ok on success
|
|
<li>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.
|
|
<li>EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if @p operationID is empty and @p operationInt is "-1".
|
|
</ul>
|
|
*/
|
|
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.
|
|
<br/>This method is applicable only for Create scenario.
|
|
@returns
|
|
<ul>
|
|
<li>ITK_ok on success
|
|
<li>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.
|
|
<li>EXTENSIONFRAMEWORK_Operation_Dispatcher_not_found if @p operationID is empty and @p operationInt is "-1".
|
|
</ul>
|
|
*/
|
|
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.
|
|
<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 */
|
|
);
|
|
|
|
/**
|
|
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 <metaframework/libmetaframework_undef.h>
|
|
#endif
|