'Process incoming parameters for this tool from the dict `incoming`,
update the tool state (or create if none existed), and either return
to the form or execute the tool (only if \'execute\' was clicked and
there were no errors).'

def handle_input(self, trans, incoming, history=None):

    request_context = WorkRequestContext(app=trans.app, user=trans.user, history=(history or trans.history))
    rerun_remap_job_id = None
    if ('rerun_remap_job_id' in incoming):
        try:
            rerun_remap_job_id = trans.app.security.decode_id(incoming['rerun_remap_job_id'])
        except Exception as exception:
            log.error(str(exception))
            raise exceptions.MessageException('Failure    executing    tool    (attempting    to    rerun    invalid    job).')
    (expanded_incomings, collection_info) = expand_meta_parameters(trans, self, incoming)
    if (not expanded_incomings):
        raise exceptions.MessageException('Tool    execution    failed,    trying    to    run    a    tool    over    an    empty    collection.')
    if (rerun_remap_job_id and (len(expanded_incomings) > 1)):
        raise exceptions.MessageException('Failure    executing    tool    (cannot    create    multiple    jobs    when    remapping    existing    job).')
    validation_timer = ExecutionTimer()
    all_errors = []
    all_params = []
    for expanded_incoming in expanded_incomings:
        params = {}
        errors = {}
        if self.input_translator:
            self.input_translator.translate(expanded_incoming)
        if (not self.check_values):
            params = expanded_incoming
        else:
            populate_state(request_context, self.inputs, expanded_incoming, params, errors)
            validate_input = self.get_hook('validate_input')
            if validate_input:
                validate_input(request_context, errors, params, self.inputs)
        all_errors.append(errors)
        all_params.append(params)
    log.debug(('Validated    and    populated    state    for    tool    request    %s' % validation_timer))
    if any(all_errors):
        err_data = {key: value for d in all_errors for (key, value) in d.items()}
        raise exceptions.MessageException(',    '.join((msg for msg in err_data.values())), err_data=err_data)
    else:
        execution_tracker = execute_job(trans, self, all_params, history=request_context.history, rerun_remap_job_id=rerun_remap_job_id, collection_info=collection_info)
        if execution_tracker.successful_jobs:
            return dict(out_data=execution_tracker.output_datasets, num_jobs=len(execution_tracker.successful_jobs), job_errors=execution_tracker.execution_errors, jobs=execution_tracker.successful_jobs, output_collections=execution_tracker.output_collections, implicit_collections=execution_tracker.implicit_collections)
        else:
            raise exceptions.MessageException(execution_tracker.execution_errors[0])
