'Given a HistoryDatasetAssociation id, find the job and that created
the dataset, extract the parameters, and display the appropriate tool
form with parameters already filled in.'

@web.expose
def rerun(self, trans, id=None, job_id=None, **kwd):

    if (job_id is None):
        if (not id):
            error("'id'    parameter    is    required")
        try:
            id = int(id)
        except:
            try:
                id = trans.security.decode_id(id)
            except:
                error("Invalid    value    for    'id'    parameter")
        data = trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get(id)
        if (not (trans.user_is_admin() or trans.app.security_agent.can_access_dataset(trans.get_current_user_roles(), data.dataset))):
            error('You    are    not    allowed    to    access    this    dataset')
        job = data.creating_job
        if job:
            job_id = trans.security.encode_id(job.id)
        else:
            raise Exception(('Failed    to    get    job    information    for    dataset    hid    %d' % data.hid))
    return trans.response.send_redirect(url_for(controller='root', job_id=job_id))
