Need help in obtaining Workflow Post Function details

Hi all, I am building a JSP script to read all a workflow’s post functions and just print out on a page - nothing fancy and no VM files. The script will go under atlassian-jira\secure\admin and can be accessed from JIRA itself (which means the resources are being share). The JSP script that I have so far is:

<%@ page import="com.atlassian.jira.component.ComponentAccessor" %>
<%@ page import="com.atlassian.jira.issue.status.Status" %>
<%@ page import="com.atlassian.jira.workflow.WorkflowManager" %>
<%@ page import="com.atlassian.jira.workflow.JiraWorkflow" %>
<%@ page import="com.opensymphony.workflow.loader.ActionDescriptor" %>
<%@ page import="com.opensymphony.workflow.loader.WorkflowDescriptor" %>
<%@ page import="com.opensymphony.workflow.loader.StepDescriptor" %>
<%@ page import="com.opensymphony.workflow.loader.FunctionDescriptor" %>
<%@ page import="com.opensymphony.workflow.loader.AbstractDescriptor" %>

<%@ page import="java.util.Collection" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>

<%@ page contentType="text/html; charset=UTF-8" %>

        <title>Workflow Parser</title>

if (request.getMethod().equals("POST") && request.getParameter("find") != null)

    WorkflowManager workflowManager = ComponentAccessor.getWorkflowManager();

    String workflowName = "<workflow name>";

    JiraWorkflow workflow = workflowManager.getWorkflow(workflowName);

    //String workflowXml = workflow.getName();

    Collection<ActionDescriptor> allActions = workflow.getAllActions();

    for (ActionDescriptor actionName: allActions)
            String outMessage = String.format("<br><div>Transition Name: %s</div><br>", actionName);

            Collection<StepDescriptor> allSteps = workflow.getStepsForTransition(actionName);
            for (StepDescriptor stepName: allSteps)
                //List<Status> status = workflow.getLinkedStatus(stepName);
                Status status = workflow.getLinkedStatus(stepName);
                String statusName = String.format("<div>From Status Name: %s</div>", status.getName());

            Collection<FunctionDescriptor> allPostFunct = workflow.getPostFunctionsForTransition(actionName);
            out.print(allPostFunct.getClass() + "<br>");
            for (FunctionDescriptor postFunct: allPostFunct)
            	out.print(postFunct.getClass() + "<br>");
                Map postFunctArgs = postFunct.getArgs();
                out.print(postFunctArgs.getClass() + "<br>");
                out.print(postFunctArgs + "<br>");
    <p>This script will parse the workflow and list down all the workflow components in a table form</p>
    <form action="" method="post">
        <input type="hidden" name="find" value="yes" />
        <input type="submit" value="Parse workflow" />

The output I am getting is:

Transition Name: Create

class java.util.ArrayList
class com.opensymphony.workflow.loader.FunctionDescriptor
class java.util.HashMap
class com.opensymphony.workflow.loader.FunctionDescriptor
class java.util.HashMap
class com.opensymphony.workflow.loader.FunctionDescriptor
class java.util.HashMap

Transition Name: Start Progress


As you can see , I manage to go up to FunctionDescriptor and now I am stuck here, I do not know how to convert these values to what we see in the JIRA’s UI. I did some digging and it seems like I need to parse this values with a different class to get those definition that I am seeing on the UI. Can someone help to point me to a right direction, I don’t mind if there is any example that I can refer to.