How to set an asset in Approved state to Retired/Archived?
The following code snippet moves an asset in Approved state to Pre retired and not Retired.
asset.setAction(RAMAction.RETIRE);
session.put(asset, new RAMStatusMonitor());
Also when we do
asset.setAction(RAMAction.RETIRE);
session.put(asset, new RAMStatusMonitor());
asset.setAction(RAMAction.ARCHIVE);
session.put(asset, new RAMStatusMonitor());
We see that asset goes into Retired and not Archived.
How can we set the asset into Retired or Archived state?
3 answers
http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m1/topic/com.ibm.ram.doc/topics/r_api_legacyreviewprocess.html
Also... to help bridge the programs using the RAM client API with these 2 actions, when an asset is a lifecycle asset, the RAMAction.RETIRE moves the asset to pre-retired state and from that state and RAMAction.ARCHIVE will move it from pre-retired to retired state.
Note the Retire action Rich refers to is not the RAMAction.RETIRE action but the Retire action that will be listed in the array returned from the getAvailableActions() call:
RAMAction[] actions = asset.getAvailableActions();
Use this Retire action instead of RAMAction.RETIRE. Otherwise if you execute the RAMAction.RETIRE twice, the second action will throw an exception for lifecycle assets.
Thanks for the reply.
As my assets are lifecycle assets i used RAMAction.RETIRE followed by RAMAction.Archive,that puts the asset into RETIRED state.
But just wanted to clarify another thing,i noticed that after you retire the asset it goes into the implicit retire asset lifecycle.
Is it possible to make this asset have the community's lifecycle just like how it had in the approved state?
We want all assets in that community to have the community's lifecycle irrespective of the state.
Comments
short answer, no. The implicit retire lifecycle is specifically to control access in a consistent way for retired assets. They are treated slightly differently because the "retire" state is a hard-code state. When we see this state certain functions aren't available, like adding it as related asset to another asset, or when going into the retire state removing it as a related asset to any asset it is related to before retirement. This requires it to be a specific lifecyle and workflow, otherwise we could not identify it as such.
If you completely unretire it then it will go back into your regular lifecycles and any assets that had this asset as a relation before retirement will have those relations restored.
Hi ,
Thanks for the reply.
In addition to this another thing I noticed is that if i try to set the asset in pre retired to retired using the java api then i get an error saying "You are not authorised to retire an asset in pre retired state".
The code used was
asset.setAction(RAMAction.RETIRE);
session.put(asset, new RAMStatusMonitor());
asset.setAction(RAMAction.ARCHIVE);
session.put(asset, new RAMStatusMonitor());
Since it is lifecycle state do we use the Retire action available on the asset instead of the above?
1) Who are you in this case? When in pre-retire only admins and lifecycle managers are permitted to move from pre-retire to retire or to restore.
2) Yes you need to use the retire action from the list of available actions. The hard-coded actions are applicable to legacy assets. Lifecycle assets must always use actions from the list of available actions.
Thanks for the reply.
I am logged in as the admin to set the asset to retired.