All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hu.blackbelt.epsilon.runtime.execution.contexts.EtlExecutionContext Maven / Gradle / Ivy

package hu.blackbelt.epsilon.runtime.execution.contexts;

import hu.blackbelt.epsilon.runtime.execution.exceptions.ScriptExecutionException;
import lombok.Builder;
import lombok.Getter;
import lombok.NonNull;
import org.eclipse.epsilon.eol.IEolModule;
import org.eclipse.epsilon.etl.EtlModule;

import java.net.URI;
import java.util.List;
import java.util.Map;

public class EtlExecutionContext extends EolExecutionContext {

    @Getter
    @NonNull
    private String exportTransformationTrace;

    EtlModule etlModule = new EtlModule();

    @Builder(builderMethodName = "etlExecutionContextBuilder")
    public EtlExecutionContext(URI source, List parameters, String exportTransformationTrace, EtlModule etlModule) {
        super(source, parameters);
        this.exportTransformationTrace = exportTransformationTrace;
        if (etlModule != null) {
        	this.etlModule =  etlModule;
        }
    }

    @Override
    public IEolModule getModule(Map context) throws ScriptExecutionException {
        return etlModule;
    };

    @Override
    public void post(Map context) {
        if (exportTransformationTrace != null) {
            context.put(
                    exportTransformationTrace,
                    etlModule.getContext().getTransformationTrace());
        }
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy