Class WorkflowXsltTransformer

java.lang.Object
com.scivicslab.pojoactor.workflow.WorkflowXsltTransformer

public class WorkflowXsltTransformer extends Object
Utility class for transforming XML workflow definitions into HTML using XSLT.

This class provides methods to convert XML workflow files into human-readable HTML visualizations. Two visualization styles are supported:

  • Table View: Displays workflow transitions in a structured table format
  • Graph View: Displays workflow as a visual state transition graph

Example Usage:


 // Transform to table view
 File xmlFile = new File("workflow.xml");
 File htmlFile = new File("workflow-table.html");
 WorkflowXsltTransformer.transformToTable(xmlFile, htmlFile);

 // Transform to graph view
 File graphFile = new File("workflow-graph.html");
 WorkflowXsltTransformer.transformToGraph(xmlFile, graphFile);

 // Transform to string
 String htmlContent = WorkflowXsltTransformer.transformToTableString(xmlFile);
 
Since:
2.5.0
Author:
devteam@scivics-lab.com
  • Constructor Details

    • WorkflowXsltTransformer

      public WorkflowXsltTransformer()
  • Method Details

    • transformToTable

      public static void transformToTable(File xmlFile, File outputFile) throws TransformerException
      Transforms an XML workflow file to HTML table view.
      Parameters:
      xmlFile - the input XML workflow file
      outputFile - the output HTML file
      Throws:
      TransformerException - if an error occurs during transformation
    • transformToGraph

      public static void transformToGraph(File xmlFile, File outputFile) throws TransformerException
      Transforms an XML workflow file to HTML graph view.
      Parameters:
      xmlFile - the input XML workflow file
      outputFile - the output HTML file
      Throws:
      TransformerException - if an error occurs during transformation
    • transformToTable

      public static void transformToTable(InputStream xmlInput, OutputStream output) throws TransformerException
      Transforms an XML workflow input stream to HTML table view.
      Parameters:
      xmlInput - the input XML workflow stream
      output - the output stream for HTML
      Throws:
      TransformerException - if an error occurs during transformation
    • transformToGraph

      public static void transformToGraph(InputStream xmlInput, OutputStream output) throws TransformerException
      Transforms an XML workflow input stream to HTML graph view.
      Parameters:
      xmlInput - the input XML workflow stream
      output - the output stream for HTML
      Throws:
      TransformerException - if an error occurs during transformation
    • transformToTableString

      public static String transformToTableString(File xmlFile) throws TransformerException
      Transforms an XML workflow file to HTML table view and returns as String.
      Parameters:
      xmlFile - the input XML workflow file
      Returns:
      the HTML content as a String
      Throws:
      TransformerException - if an error occurs during transformation
    • transformToGraphString

      public static String transformToGraphString(File xmlFile) throws TransformerException
      Transforms an XML workflow file to HTML graph view and returns as String.
      Parameters:
      xmlFile - the input XML workflow file
      Returns:
      the HTML content as a String
      Throws:
      TransformerException - if an error occurs during transformation
    • transformToTableString

      public static String transformToTableString(InputStream xmlInput) throws TransformerException
      Transforms an XML workflow input stream to HTML table view and returns as String.
      Parameters:
      xmlInput - the input XML workflow stream
      Returns:
      the HTML content as a String
      Throws:
      TransformerException - if an error occurs during transformation
    • transformToGraphString

      public static String transformToGraphString(InputStream xmlInput) throws TransformerException
      Transforms an XML workflow input stream to HTML graph view and returns as String.
      Parameters:
      xmlInput - the input XML workflow stream
      Returns:
      the HTML content as a String
      Throws:
      TransformerException - if an error occurs during transformation