Skip to content

Require PROCESS-MODULE to be set when using Export*ToFileTask #196

@hansenmc

Description

@hansenmc

When a job is configured to use ExportToFileTask or ExportBatchToFileTask and does not have a PROCESS-MODULE configured, then there is nothing to execute or write and the job finishes quickly. This can be confusing. It would be better if CoRB complained and told the user that they forgot to configure a PROCESS-MODULE.

The easiest way to enforce it for those Export*ToFileTask is to override the invokeModule() function and add a check to assert that there is a query to execute, and throw an Exception if there isn't. We can add this to the ExportToFileTask, and since ExportBatchToFileTask extends it, it will also require a PROCESS-MODULE

@Override
protected String[] invokeModule() throws CorbException {
    if (StringUtils.isEmpty(adhocQuery) && StringUtils.isEmpty(moduleUri)) {
        throw new CorbException(Options.PROCESS_MODULE + " must be specified.");
    }
    return super.invokeModule();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions