/**
   * Add job arguments information to constants.
   *
   * @param arguments job arguments
   * @throws EoulsanException if an error occurs while evaluating the constant
   */
  public void addConstants(final ExecutorArguments arguments) throws EoulsanException {

    if (arguments == null) {
      return;
    }

    addConstant(DESIGN_FILE_PATH_CONSTANT_NAME, arguments.getDesignPathname());
    addConstant(WORKFLOW_FILE_PATH_CONSTANT_NAME, arguments.getWorkflowPathname());
    addConstant(OUTPUT_PATH_CONSTANT_NAME, arguments.getOutputPathname());
    addConstant(JOB_ID_CONSTANT_NAME, arguments.getJobId());
    addConstant(JOB_UUID_CONSTANT_NAME, arguments.getJobUUID());
    addConstant(JOB_PATH_CONSTANT_NAME, arguments.getJobPathname());
  }
  /**
   * Constructor.
   *
   * @param arguments arguments object
   */
  WorkflowContext(final ExecutorArguments arguments, final AbstractWorkflow workflow) {

    checkNotNull(arguments.getLocalWorkingPathname(), "arguments cannot be null");
    checkNotNull(workflow, "workflow cannot be null");

    this.workflow = workflow;
    this.jobId = arguments.getJobId();
    this.jobUUID = arguments.getJobUUID();
    this.contextCreationTime = arguments.getCreationTime();
    this.host = SystemUtils.getHostName();

    checkNotNull(arguments.getLocalWorkingPathname(), "base path cannot be null");
    checkNotNull(arguments.getWorkflowPathname(), "parameter path cannot be null");
    checkNotNull(arguments.getDesignPathname(), "design cannot be null");
    checkNotNull(arguments.getOutputPathname(), "output path cannot be null");
    checkNotNull(arguments.getJobPathname(), "log path cannot be null");
    checkNotNull(arguments.getJobDescription(), "job description cannot be null");
    checkNotNull(arguments.getJobEnvironment(), "job environment cannot be null");

    this.workflowFile = new DataFile(arguments.getWorkflowPathname());
    this.designFile = new DataFile(arguments.getDesignPathname());
    this.jobDescription = arguments.getJobDescription();
    this.jobEnvironment = arguments.getJobEnvironment();
  }