Creating history for item

If you want create history for item look like backoffice, you can use below example.

public void updateConsignmentStatus(String userUid, ConsignmentModel consignment, ConsignmentStatus status) {
  Map<string, object=""> originals = new HashMap();
  originals.put(ConsignmentModel.STATUS, consignment.getStatus());

  consignment.setStatus(status);

  Map<string, object> news = new HashMap();
  news.put(ConsignmentModel.STATUS, consignment.getStatus());

  final SavedValues savedValues = JaloConnection.getInstance().logItemModification(consignment.getPk(), news, originals, false);
  savedValues.setUser(UserManager.getInstance().getUserByLogin(userUid));
  modelService.saveAll();
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.