Duplicate an asset
See:
To duplicate an asset means to create an asset with
a new GUID based on an existing asset. You can duplicate an asset
in three ways:
- To create a duplicate asset that has a new generated GUID and the version of the passed in asset, use RAMSession.createAsset(com.ibm.ram.common.data.Asset).
- To create a duplicate asset with a passed in GUID and that preserves the version of the passed in asset, use RAMSession.createAsset(com.ibm.ram.common.data.Asset, String GUID).
- To create a duplicate asset that has a new GUID and version passed in, use RAMSession.createAsset(com.ibm.ram.common.data.Asset, String GUID, String version).
// Create a new asset to submit to the server
RAMAsset duplicate = session.createAsset(newAsset);
// Set asset metadata
duplicate.setName("New Asset");
duplicate.setCommunity(session.getCommunity("Rational Asset Manager Development"));
duplicate.setAssetType(session.getAssetType("Documentation"));
duplicate.setShortDescription("Sample upload asset");
session.put(duplicate, new NullProgressMonitor());