'Setup the compute environment and established the outline of the param_dict
for evaluating command and config cheetah templates.'

def set_compute_environment(self, compute_environment, get_special=None):

    self.compute_environment = compute_environment
    self.unstructured_path_rewriter = compute_environment.unstructured_path_rewriter()
    job = self.job
    incoming = dict([(p.name, p.value) for p in job.parameters])
    incoming = self.tool.params_from_strings(incoming, self.app)
    request_context = WorkRequestContext(app=self.app, user=(job.history and job.history.user), history=job.history)
    def validate_inputs(input, value, context, **kwargs):
        value = input.from_json(value, request_context, context)
        input.validate(value, request_context)
    visit_input_values(self.tool.inputs, incoming, validate_inputs)
    inp_data = dict([(da.name, da.dataset) for da in job.input_datasets])
    out_data = dict([(da.name, da.dataset) for da in job.output_datasets])
    inp_data.update([(da.name, da.dataset) for da in job.input_library_datasets])
    out_data.update([(da.name, da.dataset) for da in job.output_library_datasets])
    out_collections = dict([(obj.name, obj.dataset_collection_instance) for obj in job.output_dataset_collection_instances])
    out_collections.update([(obj.name, obj.dataset_collection) for obj in job.output_dataset_collections])
    if get_special:
        class FakeDatasetAssociation(object, ):
            def __init__(self, dataset=None):
                self.dataset = dataset
                self.file_name = dataset.file_name
                self.metadata = dict()
                self.children = []
        special = get_special()
        if special:
            out_data['output_file'] = FakeDatasetAssociation(dataset=special.dataset)
    incoming.update(model.User.user_template_environment((job.history and job.history.user)))
    param_dict = self.build_param_dict(incoming, inp_data, out_data, output_collections=out_collections, output_paths=compute_environment.output_paths(), job_working_directory=compute_environment.working_directory(), input_paths=compute_environment.input_paths())
    self.tool.exec_before_job(self.app, inp_data, out_data, param_dict)
    self.tool.call_hook('exec_before_job', self.app, inp_data=inp_data, out_data=out_data, tool=self.tool, param_dict=incoming)
    self.param_dict = param_dict
