Search in sources :

Example 1 with WorkflowLogging

use of org.apache.hop.reflection.workflow.transform.WorkflowLogging in project hop by apache.

the class WorkflowStartLoggingXp method executeLoggingPipeline.

private synchronized void executeLoggingPipeline(WorkflowLog pipelineLog, String loggingPhase, String loggingPipelineFilename, IWorkflowEngine<WorkflowMeta> workflow, IVariables variables) throws HopException {
    PipelineMeta loggingPipelineMeta = new PipelineMeta(loggingPipelineFilename, workflow.getMetadataProvider(), true, variables);
    // Create a local pipeline engine...
    // 
    LocalPipelineEngine loggingPipeline = new LocalPipelineEngine(loggingPipelineMeta, variables, workflow);
    // Flag it as a logging pipeline so we don't log ourselves...
    // 
    loggingPipeline.getExtensionDataMap().put(PipelineStartLoggingXp.PIPELINE_LOGGING_FLAG, "Y");
    // Only log errors
    loggingPipeline.setLogLevel(LogLevel.ERROR);
    loggingPipeline.prepareExecution();
    // 
    for (TransformMetaDataCombi combi : loggingPipeline.getTransforms()) {
        if (combi.transform instanceof WorkflowLogging) {
            WorkflowLogging workflowLogging = (WorkflowLogging) combi.transform;
            workflowLogging.setLoggingWorkflow(workflow);
            workflowLogging.setLoggingPhase(loggingPhase);
        }
    }
    // Execute the logging pipeline to save the logging information
    // 
    loggingPipeline.startThreads();
    loggingPipeline.waitUntilFinished();
}
Also used : LocalPipelineEngine(org.apache.hop.pipeline.engines.local.LocalPipelineEngine) WorkflowLogging(org.apache.hop.reflection.workflow.transform.WorkflowLogging) TransformMetaDataCombi(org.apache.hop.pipeline.transform.TransformMetaDataCombi) PipelineMeta(org.apache.hop.pipeline.PipelineMeta)

Aggregations

PipelineMeta (org.apache.hop.pipeline.PipelineMeta)1 LocalPipelineEngine (org.apache.hop.pipeline.engines.local.LocalPipelineEngine)1 TransformMetaDataCombi (org.apache.hop.pipeline.transform.TransformMetaDataCombi)1 WorkflowLogging (org.apache.hop.reflection.workflow.transform.WorkflowLogging)1