It's all about the answers!

Ask a question

State change of an asset using API


Samanwita Majumdar (5033539) | asked Oct 21 '10, 7:05 a.m.
I am trying to change the state of assets using API i.e. I want them to move from Submitted to Appproved, is there any standard RAM API available that would do this activity in a single go.

9 answers



permanent link
Kevin Bauer (34621) | answered Oct 21 '10, 10:00 a.m.
JAZZ DEVELOPER
To find the available actions for a given state use..


//Get the available lifecycle actions
RAMAction[] actions = newAsset.getAvailableActions();


To invoke an action on an asset use


//Set the lifecycle action
newAsset.setAction(action);
session.put(newAsset, new NullProgressMonitor());


For more code example refer to the help system...

http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m0/topic/com.ibm.ram.doc/topics/t_using_api.html

I am trying to change the state of assets using API i.e. I want them to move from Submitted to Appproved, is there any standard RAM API available that would do this activity in a single go.

permanent link
Samanwita Majumdar (5033539) | answered Oct 25 '10, 1:37 a.m.
Thanks, but this was not my question, this would allow me different actions on the asset like UPDATE, DELETE etc. but thats not what I need, in RAM when an asset is submitted it remains in the submitted state and I want to change the state to Approved. How can I achieve that?



To find the available actions for a given state use..


//Get the available lifecycle actions
RAMAction[] actions = newAsset.getAvailableActions();


To invoke an action on an asset use


















//Set the lifecycle action
newAsset.setAction(action);
session.put(newAsset, new NullProgressMonitor());


For more code example refer to the help system...

http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m0/topic/com.ibm.ram.doc/topics/t_using_api.html

I am trying to change the state of assets using API i.e. I want them to move from Submitted to Appproved, is there any standard RAM API available that would do this activity in a single go.

permanent link
Samanwita Majumdar (5033539) | answered Oct 25 '10, 2:56 a.m.
Also it seems the RAMStateHistory API is available in RAM 7.5 and up, but I am using RAM 7.2 so is there any ready way so that I can update the status of an asset through API?


To find the available actions for a given state use..


//Get the available lifecycle actions
RAMAction[] actions = newAsset.getAvailableActions();


To invoke an action on an asset use


//Set the lifecycle action
newAsset.setAction(action);
session.put(newAsset, new NullProgressMonitor());


For more code example refer to the help system...

http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m0/topic/com.ibm.ram.doc/topics/t_using_api.html

I am trying to change the state of assets using API i.e. I want them to move from Submitted to Appproved, is there any standard RAM API available that would do this activity in a single go.

permanent link
Kevin Bauer (34621) | answered Oct 25 '10, 10:12 a.m.
JAZZ DEVELOPER
The StateHistory API was added in 7.2.0.2. So if you go upto that fix pack you can use the API.


Also it seems the RAMStateHistory API is available in RAM 7.5 and up, but I am using RAM 7.2 so is there any ready way so that I can update the status of an asset through API?


To find the available actions for a given state use..


//Get the available lifecycle actions
RAMAction[] actions = newAsset.getAvailableActions();


To invoke an action on an asset use


//Set the lifecycle action
newAsset.setAction(action);
session.put(newAsset, new NullProgressMonitor());


For more code example refer to the help system...

http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m0/topic/com.ibm.ram.doc/topics/t_using_api.html

I am trying to change the state of assets using API i.e. I want them to move from Submitted to Appproved, is there any standard RAM API available that would do this activity in a single go.

permanent link
Rich Kulp (3.6k38) | answered Oct 25 '10, 10:35 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Doing an action is how you change the state. For example the default
simple lifecycle uses the "Publish" action to go from Submitted to Approved.

To invoke an action on an asset use


//Set the lifecycle action
newAsset.setAction(action);
session.put(newAsset, new NullProgressMonitor());



--
Rich Kulp
Rational Asset Manager developer

permanent link
Samanwita Majumdar (5033539) | answered Oct 27 '10, 4:44 a.m.
Thanks Rich,
I am using RAM 7.2.0.1 and the options that come when I try newAsset.setAction are ARCHIVE, CREATE, CREATE_AS_IS, DELETE, RETIRE, UPDATE, UPDATE_AS_IS. I dont see any option of Publish. Is there any thing wrong in what I am trying?



Doing an action is how you change the state. For example the default
simple lifecycle uses the "Publish" action to go from Submitted to Approved.

To invoke an action on an asset use


//Set the lifecycle action
newAsset.setAction(action);
session.put(newAsset, new NullProgressMonitor());



--
Rich Kulp
Rational Asset Manager developer

permanent link
Kevin Bauer (34621) | answered Oct 27 '10, 9:58 a.m.
JAZZ DEVELOPER
Since the lifecycles are now customizable there are no statics for the actions between lifecycles. We have added API to get the available actions from a RAMAsset. From this you can choose the action that corresponding with publish.

However I beleve this API was added in 7.2.0.2. You should consider moving up.


Thanks Rich,
I am using RAM 7.2.0.1 and the options that come when I try newAsset.setAction are ARCHIVE, CREATE, CREATE_AS_IS, DELETE, RETIRE, UPDATE, UPDATE_AS_IS. I dont see any option of Publish. Is there any thing wrong in what I am trying?



Doing an action is how you change the state. For example the default
simple lifecycle uses the "Publish" action to go from Submitted to Approved.

To invoke an action on an asset use


//Set the lifecycle action
newAsset.setAction(action);
session.put(newAsset, new NullProgressMonitor());



--
Rich Kulp
Rational Asset Manager developer

permanent link
Samanwita Majumdar (5033539) | answered Oct 28 '10, 4:51 a.m.
Ok in that case can you please tell me how I can apply the fix packs so that this activity can be carried out.Is there any documentation available to apply the fix packs?

Since the lifecycles are now customizable there are no statics for the actions between lifecycles. We have added API to get the available actions from a RAMAsset. From this you can choose the action that corresponding with publish.

However I beleve this API was added in 7.2.0.2. You should consider moving up.


Thanks Rich,
I am using RAM 7.2.0.1 and the options that come when I try newAsset.setAction are ARCHIVE, CREATE, CREATE_AS_IS, DELETE, RETIRE, UPDATE, UPDATE_AS_IS. I dont see any option of Publish. Is there any thing wrong in what I am trying?



Doing an action is how you change the state. For example the default
simple lifecycle uses the "Publish" action to go from Submitted to Approved.

To invoke an action on an asset use


//Set the lifecycle action
newAsset.setAction(action);
session.put(newAsset, new NullProgressMonitor());



--
Rich Kulp
Rational Asset Manager developer

permanent link
Rich Kulp (3.6k38) | answered Oct 28 '10, 12:04 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hi,

You should upgrade to RAM 7.5. That would be much easier than upgrading
to 7.2.0.2 and then applying the testfix. And it would fix your problem.

You can get 7.5 off of jazz.net.

--
Rich Kulp
Rational Asset Manager developer

Your answer


Register or to post your answer.