Using a custom policy to set/override an asset version
Hello All,
I'd like to write a custom policy that will set/override an asset version number. For example, if a user submits an asset with the default version (1.0), then I would like to have the policy automatically change the asset version to something else.
Here's a code snippet of the custom policy that sets the new version number:
However when I run this, I get a runtime exception telling me:
CRRAM0001E 846894011 ERROR web com.ibm.ram.common.data.exception.RAMRuntimeException - RAM Runtime Exception. com.ibm.ram.common.data.exception.RAMRuntimeException: The Identifaction cannot be set by the client
Am I going about this the wrong way? Or is this not possible to do?
Thanks!
|
Accepted answer
Use
RAMAsset newAssetVersion = getPolicyContext().getRAMSession().replaceAssetNewVersion(getPolicyContext().getRAMAsset(), newVersion); followed by: getPolicyContext().getRAMSession().put(newAssetVersion, new RAMStatusMonitor()); Allen Earnest selected this answer as the correct answer
|
One other answer
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.