试用了一下osworkflow开源工作流框架,感觉很好用,而且非常灵活,极易上手,架构也很清晰,非常不错,在网上备份个中文手册,以便不时之需。
如定义一个起草文件->编写草稿->完成草稿的XML文件如下:
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.6//EN" "http://www.opensymphony.com/osworkflow/workflow_2_8.dtd">
- <workflow>
- <initial-actions>
- <action id="100" name="Start Workflow">
- <results>
- <unconditional-result old-status="Finished"
- status="Queued" step="1" />
- </results>
- </action>
- </initial-actions>
- <steps>
- <step id="1" name="First Draft">
- <actions>
- <action id="1" name="Start First Draft">
- <restrict-to>
- <conditions>
- <condition type="class">
- <arg name="class.name">
- com.opensymphony.workflow.util.StatusCondition</arg>
- <arg name="status">Queued</arg>
- </condition>
- </conditions>
- </restrict-to>
- <pre-functions>
- <function type="class">
- <arg name="class.name">
- com.opensymphony.workflow.util.Caller
- </arg>
- </function>
- </pre-functions>
- <results>
- <unconditional-result old-status="Finished"
- status="Underway" step="1" owner="${caller}" />
- </results>
- </action>
- <action id="2" name="Finish First Draft">
- <restrict-to>
- <conditions type="AND">
- <condition type="class">
- <arg name="class.name">
- com.opensymphony.workflow.util.StatusCondition
- </arg>
- <arg name="status">Underway</arg>
- </condition>
- <condition type="class">
- <arg name="class.name">
- com.opensymphony.workflow.util.AllowOwnerOnlyCondition
- </arg>
- </condition>
- </conditions>
- </restrict-to>
- <results>
- <unconditional-result old-status="Finished"
- status="Queued" step="2" />
- </results>
- </action>
- </actions>
- </step>
- <step id="2" name="finished" />
- </steps>
- </workflow>
![]() |
Austin Liu 刘恒辉
Project Manager and Software Designer E-Mail:lzhdim@163.com Blog:https://lzhdim.cnblogs.com 欢迎收藏和转载此博客中的博文,但是请注明出处,给笔者一个与大家交流的空间。谢谢大家。 |