+
+ private void updateAndInsertNewEvent(String cldsModelName, String cldsControlNamePrfx, CldsEvent event,
+ String newAction) {
+ // If model action is in submit/resubmit/distributed and user try
+ // to save then we are changing action back to create.
+ if (event != null && (CldsEvent.ACTION_SUBMIT.equalsIgnoreCase(event.getActionCd())
+ || CldsEvent.ACTION_RESUBMIT.equalsIgnoreCase(event.getActionCd())
+ || CldsEvent.ACTION_DISTRIBUTE.equalsIgnoreCase(event.getActionCd()))) {
+ CldsEvent newEvent = new CldsEvent();
+ newEvent.setUserid(getUserId());
+ newEvent.setActionCd(newAction);
+ newEvent.setActionStateCd(CldsEvent.ACTION_STATE_COMPLETED);
+ cldsDao.insEvent(cldsModelName, cldsControlNamePrfx, null, newEvent);
+ }
+ }