'* GET /api/jobs/{id}/build_for_rerun
returns a tool input/param template prepopulated with this job\'s
information, suitable for rerunning or rendering parameters of the
job.
:type   id: string
:param  id: Encoded job id
:rtype:     dictionary
:returns:   dictionary containing output dataset associations'

@expose_api_anonymous
def build_for_rerun(self, trans, id, **kwd):

    job = self.__get_job(trans, id)
    if (not job):
        raise exceptions.ObjectNotFound(("Could    not    access    job    with    id    '%s'" % id))
    tool = self.app.toolbox.get_tool(job.tool_id, (kwd.get('tool_version') or job.tool_version))
    if (tool is None):
        raise exceptions.ObjectNotFound('Requested    tool    not    found')
    if (not tool.is_workflow_compatible):
        raise exceptions.ConfigDoesNotAllowException(("Tool    '%s'    cannot    be    rerun." % job.tool_id))
    return tool.to_json(trans, {}, job=job)
