Batch Clone (batchclone)

An opening ID is an entry point used to customize business logic. batchclone is triggered when a set of objects of a specific type has been cloned.

Recommendation: To cover all possible duplication scenarios, use both Copy and Batch Clone precommit openings.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

This opening ID is a precommit opening. For more information about the specificities of a precommit opening, see Precommit Openings.

Definition Description
PLM Opening ID batchclone
Customization intent Not applicable
Execution context Server

Input Objects

Note: In the case of a batchclone operation, source objects and their results can be accessed through the BATCHCLONEMAP parameter.

Context Object Parameters

Table 1. Business Object Standard Parameters
Parameter Name Type Read or Write Comments
EVENT String Read Any of the supported events.
TYPE String Read Business object type
Table 2. Additional Parameters for batchclone
Parameter Name Type Read or Write Comments
BATCHCLONEMAP Map Read Map representing the whole content of the batch clone operation. Keys represent the new objects (Relations and Entities) and values are the source objects.
AuditTags List Read Logging event of the transaction.
Important:
  • For a batch clone operation, source objects (values in BATCHCLONEMAP) are read-only.
  • If an object has only read operations, the execution control considers it outside of the transaction to apply execution rules.
  • When a batch clone operation is done on several types at the same time, the batchclone opening is triggered once for each type.

Sample

Let ListTargets(List)
Let SourceObject(PLMEntity)
Let TargetObject(PLMEntity)
Set ListTargets = Parameters.Macros.GetObjectMap("BATCHCLONEMAP").GetKeys()
Set TargetObject = ListTargets.GetItem(1)
Set SourceObject = Parameters.Macros.GetObjectMap("BATCHCLONEMAP").GetValue(TargetObject)
Trace(1, "Execution batchclone on ", TargetObject.PLM_ExternalID)
TargetObject.setAttributeString("description","cloned")
Trace(1, "Execution batchclone result is ", SourceObject.PLM_ExternalID) 
Validation = true