use of org.kie.workbench.common.stunner.core.domainobject.DomainObject in project kie-wb-common by kiegroup.
the class UpdateDomainObjectPropertyValueCommand method execute.
@Override
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
final DefinitionManager definitionManager = context.getDefinitionManager();
final Object p = definitionManager.adapters().forDefinition().getProperty(domainObject, field).get();
final AdapterManager adapterManager = definitionManager.adapters();
final AdapterRegistry adapterRegistry = adapterManager.registry();
final PropertyAdapter<Object, Object> adapter = (PropertyAdapter<Object, Object>) adapterRegistry.getPropertyAdapter(p.getClass());
oldValue = adapter.getValue(p);
adapter.setValue(p, value);
return GraphCommandResultBuilder.SUCCESS;
}
Aggregations