Add a review to an asset

Asset reviews are created through an asset's state history. You can use RAMAsset.getCurrentStateHistory() to get to the asset's state history. Reviews are sent up to Rational Asset Manager when the RAMStateHistory.castVote(RAMVote) method is called, the asset does not have to be put to the session.

//Get the current state history
  RAMStateHistory stateHistory = newAsset.getCurrentStateHistory();

//Create a new review
  RAMVote review = new RAMVote();
  review.setVoteChoice(RAMVote.APPROVE);
	review.setComment(“This asset looks great!”);

//Add review to the asset
  stateHistory.castVote(review);

Feedback