use of org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity in project camunda-bpm-platform by camunda.
the class GetPropertiesCmd method execute.
@SuppressWarnings("unchecked")
public Map<String, String> execute(CommandContext commandContext) {
List<PropertyEntity> propertyEntities = commandContext.getDbEntityManager().selectList("selectProperties");
Map<String, String> properties = new HashMap<String, String>();
for (PropertyEntity propertyEntity : propertyEntities) {
properties.put(propertyEntity.getName(), propertyEntity.getValue());
}
return properties;
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity in project camunda-bpm-platform by camunda.
the class DeletePropertyCmd method execute.
public Object execute(CommandContext commandContext) {
final PropertyManager propertyManager = commandContext.getPropertyManager();
PropertyEntity propertyEntity = propertyManager.findPropertyById(name);
if (propertyEntity != null) {
propertyManager.delete(propertyEntity);
}
return null;
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity in project camunda-bpm-platform by camunda.
the class SetPropertyCmd method execute.
public Object execute(CommandContext commandContext) {
final PropertyManager propertyManager = commandContext.getPropertyManager();
PropertyEntity property = propertyManager.findPropertyById(name);
if (property != null) {
// update
property.setValue(value);
} else {
// create
property = new PropertyEntity(name, value);
propertyManager.insert(property);
}
return null;
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity in project camunda-bpm-platform by camunda.
the class HistoryLevelSetupCommand method dbCreateHistoryLevel.
public static void dbCreateHistoryLevel(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
HistoryLevel configuredHistoryLevel = processEngineConfiguration.getHistoryLevel();
PropertyEntity property = new PropertyEntity("historyLevel", Integer.toString(configuredHistoryLevel.getId()));
commandContext.getSession(DbEntityManager.class).insert(property);
LOG.creatingHistoryLevelPropertyInDatabase(configuredHistoryLevel);
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity in project camunda-bpm-platform by camunda.
the class GetNextIdBlockCmd method execute.
public IdBlock execute(CommandContext commandContext) {
PropertyEntity property = commandContext.getPropertyManager().findPropertyById("next.dbid");
long oldValue = Long.parseLong(property.getValue());
long newValue = oldValue + idBlockSize;
property.setValue(Long.toString(newValue));
return new IdBlock(oldValue, newValue - 1);
}
Aggregations