'Build the dictionary of parameters for substituting into the command
line. Each value is wrapped in a `InputValueWrapper`, which allows
all the attributes of the value to be used in the template, *but*
when the __str__ method is called it actually calls the
`to_param_dict_string` method of the associated input.'

def build_param_dict(self, incoming, input_datasets, output_datasets, output_collections, output_paths, job_working_directory, input_paths=[]):

    param_dict = dict()
    def input():
        raise SyntaxError('Unbound    variable    input.')
    param_dict['input'] = input
    param_dict.update(self.tool.template_macro_params)
    param_dict.update(incoming)
    input_dataset_paths = dataset_path_rewrites(input_paths)
    self.__populate_wrappers(param_dict, input_datasets, input_dataset_paths, job_working_directory)
    self.__populate_input_dataset_wrappers(param_dict, input_datasets, input_dataset_paths)
    self.__populate_output_dataset_wrappers(param_dict, output_datasets, output_paths, job_working_directory)
    self.__populate_output_collection_wrappers(param_dict, output_collections, output_paths, job_working_directory)
    self.__populate_unstructured_path_rewrites(param_dict)
    self.__sanitize_param_dict(param_dict)
    self.__populate_non_job_params(param_dict)
    return param_dict
