use of org.openlca.core.model.ProductSystem in project olca-app by GreenDelta.
the class Export method tryExportSystem.
private void tryExportSystem(ExportConfig config, Descriptor d) {
try {
ProductSystem system = new ProductSystemDao(database).getForId(d.id);
SystemExport export = new SystemExport(config);
export.run(system);
monitor.worked(1);
} catch (Exception e) {
log.error("System export failed", e);
}
}
use of org.openlca.core.model.ProductSystem in project olca-app by GreenDelta.
the class ProductSystemWizardPage method createModel.
@Override
public ProductSystem createModel() {
ProductSystem system;
if (refProcess != null) {
system = ProductSystem.of(refProcess);
} else {
// create an empty reference process
var processName = filterText.getText().trim();
if (Strings.nullOrEmpty(processName)) {
processName = nameText.getText().trim();
}
var process = new Process();
process.name = processName;
process.refId = UUID.randomUUID().toString();
system = new ProductSystem();
system.refId = UUID.randomUUID().toString();
system.referenceProcess = process;
}
system.name = getModelName();
system.description = getModelDescription();
return system;
}
Aggregations