code: private void lockPlan(ActionBean action) throws ActionException {
          if (!securityContext.hasPermission(PermissionType.planAdmin, action.getOrganizationId()))
              throw ExceptionFactory.notAuthorizedException();
  
          PlanVersionBean versionBean;
          try {
              versionBean = orgs.getPlanVersion(action.getOrganizationId(), action.getEntityId(), action.getEntityVersion());
          } catch (PlanVersionNotFoundException e) {
              throw ExceptionFactory.actionException(Messages.i18n.format("PlanNotFound")); //$NON-NLS-1$
          }
  
          // Validate that it's ok to perform this action - plan must not already be locked
          if (versionBean.getStatus() == PlanStatus.Locked) {
              throw ExceptionFactory.actionException(Messages.i18n.format("InvalidPlanStatus")); //$NON-NLS-1$
          }
  
          versionBean.setStatus(PlanStatus.Locked);
          versionBean.setLockedOn(new Date());
  
          try {
              storage.beginTx();
              storage.updatePlanVersion(versionBean);
              storage.createAuditEntry(AuditUtils.planLocked(versionBean, securityContext));
              storage.commitTx();
          } catch (Exception e) {
              storage.rollbackTx();
              throw ExceptionFactory.actionException(Messages.i18n.format("LockError"), e); //$NON-NLS-1$
          }
  
          log.debug(String.format("Successfully locked Plan %s: %s", //$NON-NLS-1$
                  versionBean.getPlan().getName(), versionBean.getPlan()));
      }
docs: Locks the plan.
  @param action