Search in sources :

Example 1 with ProcessExport

use of org.openlca.io.ilcd.output.ProcessExport in project olca-modules by GreenDelta.

the class ILCDExport method tryExport.

private void tryExport(RootEntity component) throws Exception {
    if (component instanceof ImpactMethod) {
        ImpactMethodExport export = new ImpactMethodExport(config);
        export.run((ImpactMethod) component);
    } else if (component instanceof ProductSystem) {
        SystemExport export = new SystemExport(config);
        export.run((ProductSystem) component);
    } else if (component instanceof Process) {
        ProcessExport export = new ProcessExport(config);
        export.run((Process) component);
    } else if (component instanceof Flow) {
        FlowExport flowExport = new FlowExport(config);
        flowExport.run((Flow) component);
    } else if (component instanceof FlowProperty) {
        FlowPropertyExport export = new FlowPropertyExport(config);
        export.run((FlowProperty) component);
    } else if (component instanceof UnitGroup) {
        UnitGroupExport export = new UnitGroupExport(config);
        export.run((UnitGroup) component);
    } else if (component instanceof Actor) {
        ActorExport export = new ActorExport(config);
        export.run((Actor) component);
    } else if (component instanceof Source) {
        SourceExport export = new SourceExport(config);
        export.run((Source) component);
    }
}
Also used : UnitGroup(org.openlca.core.model.UnitGroup) ProductSystem(org.openlca.core.model.ProductSystem) Process(org.openlca.core.model.Process) FlowExport(org.openlca.io.ilcd.output.FlowExport) UnitGroupExport(org.openlca.io.ilcd.output.UnitGroupExport) SourceExport(org.openlca.io.ilcd.output.SourceExport) ImpactMethod(org.openlca.core.model.ImpactMethod) Source(org.openlca.core.model.Source) Flow(org.openlca.core.model.Flow) FlowPropertyExport(org.openlca.io.ilcd.output.FlowPropertyExport) Actor(org.openlca.core.model.Actor) ActorExport(org.openlca.io.ilcd.output.ActorExport) ImpactMethodExport(org.openlca.io.ilcd.output.ImpactMethodExport) ProcessExport(org.openlca.io.ilcd.output.ProcessExport) FlowProperty(org.openlca.core.model.FlowProperty) SystemExport(org.openlca.io.ilcd.output.SystemExport)

Example 2 with ProcessExport

use of org.openlca.io.ilcd.output.ProcessExport in project olca-modules by GreenDelta.

the class ILCDImportExportTest method testF_Process.

@Test
public void testF_Process() {
    String id = "76d6aaa4-37e2-40b2-994c-03292b600074";
    var dataSet = importConf.store().get(Process.class, id);
    var process = new ProcessImport(importConf).run(dataSet);
    assertEquals(id, process.refId);
    new ProcessExport(exportConf).run(process);
    assertTrue(exportConf.store.contains(Process.class, id));
}
Also used : ProcessImport(org.openlca.io.ilcd.input.ProcessImport) Process(org.openlca.ilcd.processes.Process) ProcessExport(org.openlca.io.ilcd.output.ProcessExport) Test(org.junit.Test)

Example 3 with ProcessExport

use of org.openlca.io.ilcd.output.ProcessExport in project olca-app by GreenDelta.

the class Export method tryExportProcess.

private void tryExportProcess(ExportConfig config, Descriptor d) {
    try {
        Process p = new ProcessDao(database).getForId(d.id);
        ProcessExport export = new ProcessExport(config);
        export.run(p);
        monitor.worked(1);
    } catch (Exception e) {
        log.error("Process export failed", e);
    }
}
Also used : ProcessDao(org.openlca.core.database.ProcessDao) Process(org.openlca.core.model.Process) ProcessExport(org.openlca.io.ilcd.output.ProcessExport) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

ProcessExport (org.openlca.io.ilcd.output.ProcessExport)3 Process (org.openlca.core.model.Process)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Test (org.junit.Test)1 ProcessDao (org.openlca.core.database.ProcessDao)1 Actor (org.openlca.core.model.Actor)1 Flow (org.openlca.core.model.Flow)1 FlowProperty (org.openlca.core.model.FlowProperty)1 ImpactMethod (org.openlca.core.model.ImpactMethod)1 ProductSystem (org.openlca.core.model.ProductSystem)1 Source (org.openlca.core.model.Source)1 UnitGroup (org.openlca.core.model.UnitGroup)1 Process (org.openlca.ilcd.processes.Process)1 ProcessImport (org.openlca.io.ilcd.input.ProcessImport)1 ActorExport (org.openlca.io.ilcd.output.ActorExport)1 FlowExport (org.openlca.io.ilcd.output.FlowExport)1 FlowPropertyExport (org.openlca.io.ilcd.output.FlowPropertyExport)1 ImpactMethodExport (org.openlca.io.ilcd.output.ImpactMethodExport)1 SourceExport (org.openlca.io.ilcd.output.SourceExport)1 SystemExport (org.openlca.io.ilcd.output.SystemExport)1