Search in sources :

Example 1 with PropertyManager

use of org.camunda.bpm.engine.impl.persistence.entity.PropertyManager 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;
}
Also used : PropertyEntity(org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity) PropertyManager(org.camunda.bpm.engine.impl.persistence.entity.PropertyManager)

Example 2 with PropertyManager

use of org.camunda.bpm.engine.impl.persistence.entity.PropertyManager 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;
}
Also used : PropertyEntity(org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity) PropertyManager(org.camunda.bpm.engine.impl.persistence.entity.PropertyManager)

Aggregations

PropertyEntity (org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity)2 PropertyManager (org.camunda.bpm.engine.impl.persistence.entity.PropertyManager)2