IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 2 replies
  • Latest Post - ‏2010-01-20T11:57:18Z by kbauer
RishKum
RishKum
1 Post

Pinned topic Getting error while approving the asset.

‏2010-01-20T07:33:02Z |
Hi All,

I am trying to change the state of asset from "review" to "Approved", but I am getting error. I am doing this through java code use RAM api. Below is the error message:

Exception in thread "main" com.ibm.ram.common.data.exception.RAMRuntimeException: The asset ID can only be set by the server.
at com.ibm.ram.client.RAMAsset.setStateID(RAMAsset.java:4257)

I am using asset.setStateID(RAMState.ASSET_APPROVED_ID);

Can anyone help me in this regard?

Regards
Rish
Updated on 2010-01-20T11:57:18Z at 2010-01-20T11:57:18Z by kbauer
  • kbauer
    kbauer
    22 Posts

    Re: Getting error while approving the asset.

    ‏2010-01-20T11:52:20Z  
    You cannot set the state of an asset. You must move the asset through it's lifecycle by appling appropriate actions on it.
  • kbauer
    kbauer
    22 Posts

    Re: Getting error while approving the asset.

    ‏2010-01-20T11:57:18Z  
    • kbauer
    • ‏2010-01-20T11:52:20Z
    You cannot set the state of an asset. You must move the asset through it's lifecycle by appling appropriate actions on it.
    Prior to RAM 7.2 you could not invoke the actions within a review state. To move the asset to approved the appropriate users had to vote through the UI to move the asset forward.

    In 7.2 and beyond you can call a getAvailableActions() methods on and asset, call setAction(Action) on an asset and finally put the asset to the session to change an asset's state.