'Export the workflow contents to a dictionary ready for JSON-ification and to be
sent out via API for instance. There are three styles of export allowed \'export\', \'instance\', and
\'editor\'. The Galaxy team will do it best to preserve the backward compatibility of the
\'export\' stye - this is the export method meant to be portable across Galaxy instances and over
time. The \'editor\' style is subject to rapid and unannounced changes. The \'instance\' export
option describes the workflow in a context more tied to the current Galaxy instance and includes
fields like \'url\' and \'url\' and actual unencoded step ids instead of \'order_index\'.'

def workflow_to_dict(self, trans, stored, style='export'):

    if (style == 'editor'):
        return self._workflow_to_dict_editor(trans, stored)
    elif (style == 'legacy'):
        return self._workflow_to_dict_instance(stored, legacy=True)
    elif (style == 'instance'):
        return self._workflow_to_dict_instance(stored, legacy=False)
    elif (style == 'run'):
        return self._workflow_to_dict_run(trans, stored)
    else:
        return self._workflow_to_dict_export(trans, stored)
