I made this package to create dynamic [GraphViz|http://www.graphviz.org] file in my jspwiki. This plugin uses [GraphViz|http://www.graphviz.org] to render the images.\\ 

!Coming soon:
* __2/19/05__ - Will change parameters to read directly from the jsp properties file.  

* __2/18/05__ - Got graphviz to pass node coordinates, so that image mapping and linking to WikiPages can be automatic - still need to test and tweak.  

* __2/17/05__ - WorkFlow now takes the information directly from the WikiContext - no need to pass parameters.  


[{Image src='http://www.jspwiki.org/attach/WorkFlowPlugin/sample_workflow.gif'}]


*I. Download [GraphViz|http://www.graphviz.org/] and install if not already installed.  Make sure the main dot program is located in /usr/bin\\
#This may vary if you are using a windows system. For example, I have TomCat 5.5.9 installed, and I don't have any directories called [usr]. I have two [bin] directories in my TomCat folder. Having copied the dot program to both directories, I get "Plugin insertion failed: Could not find plugin WorkFlow" as an [WorkFlow Error|http://www.jspwiki.org/wiki/WorkFlow] when I try to view the Plugin.

*II. Extract the ~WorkFlow.jar file in /WEB-INF/classes directory.\\ 

*III. Add the following lines to your jspwiki's /WEB-INF/web.xml\\ 

<servlet> \\
     <servlet-name>WorkFlowManager</servlet-name> \\
     <servlet-class>com.xcaws.jspwiki.plugin.WorkFlowManager</servlet-class> \\
</servlet> \\

<servlet-mapping> \\
     <servlet-name>WorkFlowManager</servlet-name> \\
     <url-pattern>*.workflow</url-pattern> \\
</servlet-mapping> \\

*IV. Add the packages name 'com.xcaws.jspwiki.plugin' to the plugin-searchpath in 

*VI.Edit a WikiPage. Type\\ 

[[ {~WorkFlow}] 

and you will get a default graph: 

To add your own values, type:

[[{~WorkFlow values='A->B|A->C|A->D|A->E|A->F|B->K'}]


!How the Plugin works :\\ 

~WorkFlow parses the parameters, builds a string buffer, then sends the string buffer to ~GraphViz.

*NOTE:  ~GraphViz should be located in /usr/bin/dot
*NOTE:  a temporary file is created in /tmp

~WorkFlow, then brings the file into a byte array and returns the results to the wiki content.


__param values :__ 
*the ~GraphViz nodes. \\ 

I hope you find this plugin useful.\\ 
Questions? Suggestions? Critics? Bugs?  Please edit this page or mail me.\\ 


This plugin does a good job of passing through values so you can pass other directives to ~GraphViz see [Documentation|http://www.graphviz.org/Documentation.php]. So you can customize the look of the elements in the graph.  For example:

{{{values='node [color=lightblue2, style=filled, shape=ellipse]|"A.java"|node [color=yellow, style=filled, shape=rectangle]|"A.java"->"B.java"'}}}

However, if there are multiple ~Workflow tags on the same page, the last workflow on the page is generated for each instance of the plugin tag.

-by [ThomVaught]

;:It might be useful to point to the GraphVizPlugin if you are after a general purpose GraphViz wrapper.
I tried this plugin under w2k,but TOMCAT console out this line below,and no WORKFLOW diagram display,anyboby can tell me the reason.did the plugin use absolute path?\\
{{{Error: I/O error while writing the dot source to temp file!}}}\\
thank you,my [email:datavision@163.com|mailto:datavision@163.com]\\


I installed current version of Graphviz in Fedora 7 and tested this plugin. In my testing, Gif temp file  is not created properly. The temp file opening error is showing like

*The filename "out53430.gif" indicates that this file is of type "GIF image". The contents of the file indicate that the file is of type "plain text document". If you open this file, the file might present a security risk to your system.

*Do not open the file unless you created the file yourself, or received the file from a trusted source. To open the file, rename the file to the correct extension for "plain text document", then open the file normally. Alternatively, use the Open With menu to choose a specific application for the file.

I replaced GIF format with PNG format and now its working properly.

Code changes

* img = File.createTempFile("out", ".png", new File(this.TEMP_DIR));

* String cmd = DOT + " -Tpng "+dot.getAbsolutePath()+" -o"+img.getAbsolutePath();

I attached the changed version of JAR here.

Any suggestions?

Thanks and Regards,
Ramesh G


There is anyway to using this plugins on windows using WinGraphviz?

--AnonymousCoward, 22-Sep-2007