def get_workflow_info(brain_or_object, endpoint=None):
<EOL>obj = get_object(brain_or_object)<EOL>wf_tool = get_tool("<STR_LIT>")<EOL>workflows = wf_tool.getWorkflowsFor(obj)<EOL>if not workflows:<EOL><INDENT>return []<EOL><DEDENT>def to_transition_info(transition):<EOL><INDENT>"""<STR_LIT>"""<EOL>return {<EOL>"<STR_LIT:title>": transition["<STR_LIT:title>"],<EOL>"<STR_LIT:value>": transition["<STR_LIT:id>"],<EOL>"<STR_LIT>": transition["<STR_LIT:description>"],<EOL>"<STR_LIT:url>": transition["<STR_LIT:url>"],<EOL>}<EOL><DEDENT>def to_review_history_info(review_history):<EOL><INDENT>"""<STR_LIT>"""<EOL>converted = DT2dt(review_history.get('<STR_LIT:time>')).strftime("<STR_LIT>")<EOL>review_history['<STR_LIT:time>'] = converted<EOL>return review_history<EOL><DEDENT>out = []<EOL>for workflow in workflows:<EOL><INDENT>info = wf_tool.getStatusOf(workflow.getId(), obj)<EOL>if info is None:<EOL><INDENT>continue<EOL><DEDENT>review_state = info.get("<STR_LIT>", None)<EOL>inactive_state = info.get("<STR_LIT>", None)<EOL>cancellation_state = info.get("<STR_LIT>", None)<EOL>worksheetanalysis_review_state = info.get("<STR_LIT>", None)<EOL>state = review_state orinactive_state orcancellation_state orworksheetanalysis_review_state<EOL>if state is None:<EOL><INDENT>logger.warn("<STR_LIT>".format(<EOL>repr(obj), info))<EOL>continue<EOL><DEDENT>status_info = workflow.states[state]<EOL>status = status_info.title<EOL>transitions = list(map(to_transition_info, wf_tool.getTransitionsFor(obj)))<EOL>rh = list(map(to_review_history_info,<EOL>workflow.getInfoFor(obj, '<STR_LIT>', '<STR_LIT>')))<EOL>out.append({<EOL>"<STR_LIT>": workflow.getId(),<EOL>"<STR_LIT:status>": status,<EOL>"<STR_LIT>": state,<EOL>"<STR_LIT>": transitions,<EOL>"<STR_LIT>": rh,<EOL>})<EOL><DEDENT>return {"<STR_LIT>": out}<EOL>
Generate workflow information of the assigned workflows

    :param brain_or_object: A single catalog brain or content object
    :type brain_or_object: ATContentType/DexterityContentType/CatalogBrain
    :param endpoint: The named URL endpoint for the root of the items
    :type endpoint: str/unicode
    :returns: Workflows info
    :rtype: dict