It's all about the answers!

Ask a question

How to set an asset in Approved state to Retired/Archived?


Manjiri Kamat (5132325) | asked Dec 11 '12, 7:28 a.m.
RAM Version :7511

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



permanent link
Rich Kulp (3.6k38) | answered Dec 11 '12, 10:36 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Your asset is a lifecycle asset. In a lifecycle assets Retire moves you to pre-retire, and then from there retire again will move to lifecycle retired state.

Retire->Archive is ONLY available for Legacy assets, not lifecycle assets.

permanent link
Peter Walker (168136) | answered Dec 11 '12, 11:30 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
As Rich answered earlier the RAMAction.RETIRE and RAMAction.ARCHIVE is for legacy review assets only. These are listed in the RAM Info center here -->
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.

permanent link
Manjiri Kamat (5132325) | answered Dec 12 '12, 6:52 a.m.
Hi Peter/Rich,


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
Rich Kulp commented Dec 12 '12, 10:27 a.m. | edited Dec 12 '12, 10:27 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

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.


Manjiri Kamat commented Dec 18 '12, 12:23 a.m.

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?


Rich Kulp commented Dec 18 '12, 10:49 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

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.


Manjiri Kamat commented Dec 19 '12, 11:37 p.m.

Thanks for the reply.

I am logged in as the admin to set the asset to retired.

Your answer


Register or to post 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.