@Override public void activateKaleoDefinition( long kaleoDefinitionId, long startKaleoNodeId, ServiceContext serviceContext) throws PortalException { KaleoDefinition kaleoDefinition = kaleoDefinitionPersistence.findByPrimaryKey(kaleoDefinitionId); try { KaleoDefinition previousKaleoDefinition = getLatestKaleoDefinition(kaleoDefinition.getName(), serviceContext); previousKaleoDefinition.setModifiedDate(new Date()); previousKaleoDefinition.setActive(false); kaleoDefinitionPersistence.update(previousKaleoDefinition); } catch (NoSuchDefinitionException nsde) { } kaleoDefinition.setStartKaleoNodeId(startKaleoNodeId); kaleoDefinition.setModifiedDate(new Date()); kaleoDefinition.setActive(true); kaleoDefinitionPersistence.update(kaleoDefinition); }
/** * Converts the soap model instance into a normal model instance. * * @param soapModel the soap model instance to convert * @return the normal model instance */ public static KaleoDefinition toModel(KaleoDefinitionSoap soapModel) { if (soapModel == null) { return null; } KaleoDefinition model = new KaleoDefinitionImpl(); model.setKaleoDefinitionId(soapModel.getKaleoDefinitionId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); model.setUserId(soapModel.getUserId()); model.setUserName(soapModel.getUserName()); model.setCreateDate(soapModel.getCreateDate()); model.setModifiedDate(soapModel.getModifiedDate()); model.setName(soapModel.getName()); model.setTitle(soapModel.getTitle()); model.setDescription(soapModel.getDescription()); model.setContent(soapModel.getContent()); model.setVersion(soapModel.getVersion()); model.setActive(soapModel.getActive()); model.setStartKaleoNodeId(soapModel.getStartKaleoNodeId()); return model; }