use of org.jbpm.kie.services.api.AttributesAware in project jbpm by kiegroup.
the class DeploymentStore method enableDeploymentUnit.
public void enableDeploymentUnit(DeploymentUnit unit) {
String unitContent = xstream.toXML(unit);
DeploymentStoreEntry entry = findDeploymentStoreByDeploymentId(unit.getIdentifier());
if (entry != null) {
// update only
// 0 - disabled, 1 - enabled, 2 - activated, 3 - deactivated
entry.setState(STATE_ENABLED);
entry.setUpdateDate(new Date());
entry.setDeploymentUnit(unitContent);
commandService.execute(new MergeObjectCommand(entry));
return;
}
entry = new DeploymentStoreEntry();
entry.setDeploymentId(unit.getIdentifier());
// 0 - disabled, 1 - enabled, 2 - activated, 3 - deactivated
entry.setState(STATE_ENABLED);
entry.setUpdateDate(new Date());
entry.setDeploymentUnit(unitContent);
if (unit instanceof AttributesAware) {
String attribtues = buildEntryAttributes(((AttributesAware) unit).getAttributes());
entry.setAttributes(attribtues);
}
commandService.execute(new PersistObjectCommand(entry));
}
Aggregations