Using the copy method of the CopyHelper, it is possible to copy instances within a project or in a non-project-specific manner. For this, the following parameters are required:
IUnitOfWork uow | The UnitOfWork of the script |
---|---|
String sourceName | Absolute name of the source object |
String targetName | Absolute name of the superordinate target component, i.e., of the object to which the copy is mounted. This may be a project, a mechatronic component or a placeholder. |
String newName | The name to be assigned to the copy at the target location. If the name is already taken, a number is added at the end and incremented until a free name has been found. |
import com.mind8.copying.helper.CopyHelper;
import org.foederal.eobroker.core.IUnitOfWork;
IUnitOfWork uow = self.getUnitOfWork();
CopyHelper.copy(uow,'A.Mechatronik.M1','A.Mechatronik','M2');
uow.saveChanges();