osworkflow扩展非常容易,跟我们的应用结合起来使用也很容易。假设一个请假流程:员工请假,需要经过部门经理和人力资源部经理两人共同审批,只有当两人都许可时才通过,任一人驳回就失效,也就是一个and split和and join流程,并且我们附加一个要求,当发送请假请求、许可和驳回这几个操作时都将发送一条消息给相应的用户。
流程定义文件如下:
xml version="1.0" encoding="utf-8" ?>
doctype workflow public "-//opensymphony group//dtd osworkflow 2.7//en"
"http://www.opensymphony.com/osworkflow/workflow_2_7.dtd">
<workflow>
<initial-actions>
<action id="0" name="开始">
<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>
initial-actions>
<steps>
<step id="1" name="填假单">
<external-permissions>
<permission name="perma">
<restrict-to>
<conditions type="and">
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.statuscondition
arg>
<arg name="status">underwayarg>
condition>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.allowowneronlycondition
arg>
condition>
conditions>
restrict-to>
permission>
external-permissions>
<actions>
<action id="1" name="送出">
<restrict-to>
<conditions type="and">
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.statuscondition
arg>
<arg name="status">underwayarg>
condition>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.allowowneronlycondition
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"
split="1" status="queued">
<post-functions>
<function type="class">
<arg name="class.name">
net.rubyeye.leavesys.service.workflow.sendremindinffunction
arg>
<arg name="groupname">
and (groupname='dept_manager' or
groupname='comp_manager')
arg>
<arg name="content">
you have leavemsg to
check!please check it!
arg>
function>
post-functions>
unconditional-result>
results>
action>
actions>
step>
<step id="2" name="部门经理批假单">
<actions>
<action id="2" name="准许">
<restrict-to>
<conditions>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.osusergroupcondition
arg>
<arg name="group">dept_managerarg>
condition>
conditions>
restrict-to>
<pre-functions>
<function type="class">
<arg name="class.name">
com.opensymphony.workflow.util.caller
arg>
function>
<function type="beanshell">
<arg name="script">
propertyset.setstring("action1",
"success");
arg>
function>
pre-functions>
<results>
<unconditional-result old-status="finished"
status="queued" join="1" owner="${caller}" />
results>
action>
<action id="3" name="驳回">
<restrict-to>
<conditions>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.osusergroupcondition
arg>
<arg name="group">dept_managerarg>
condition>
conditions>
restrict-to>
<pre-functions>
<function type="class">
<arg name="class.name">
com.opensymphony.workflow.util.caller
arg>
function>
<function type="beanshell">
<arg name="script">
propertyset.setstring("action1",
"fail");
arg>
function>
pre-functions>
<results>
<unconditional-result old-status="finished"
status="queued" join="2" owner="${caller}" />
results>
action>
actions>
step>
<step id="3" name="公司经理批假单">
<actions>
<action id="4" name="准许">
<restrict-to>
<conditions>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.osusergroupcondition
arg>
<arg name="group">comp_managerarg>
condition>
conditions>
restrict-to>
<pre-functions>
<function type="class">
<arg name="class.name">
com.opensymphony.workflow.util.caller
arg>
function>
<function type="beanshell">
<arg name="script">
propertyset.setstring("action2",
"success");
arg>
function>
pre-functions>
<results>
<unconditional-result old-status="finished"
status="queued" join="1" owner="${caller}" />
results>
action>
<action id="5" name="驳回">
<restrict-to>
<conditions>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.osusergroupcondition
arg>
<arg name="group">dept_managerarg>
condition>
conditions>
restrict-to>
<pre-functions>
<function type="class">
<arg name="class.name">
com.opensymphony.workflow.util.caller
arg>
function>
<function type="beanshell">
<arg name="script">
propertyset.setstring("action2",
"fail");
arg>
function>
pre-functions>
<results>
<unconditional-result old-status="finished"
status="queued" join="2" owner="${caller}" />
results>
action>
actions>
step>
<step id="4" name="停止" />
steps>
<splits>
<split id="1">
<unconditional-result old-status="finished" status="queued"
step="2" />
<unconditional-result old-status="finished" status="queued"
step="3" />
split>
splits>
<joins>
<join id="1">
<conditions type="and">
<condition type="beanshell">
<arg name="script">
"finished".equals(jn.getstep(2).getstatus()) &&
"finished".equals(jn.getstep(3).getstatus())&&"success".equals(propertyset.getstring("action1"))&&
"success".equals(propertyset.getstring("action2"))
]]>
arg>
condition>
conditions>
<unconditional-result old-status="finished" status="queued"
step="4"/>
join>
<join id="2">
<conditions type="or">
<condition type="beanshell">
- 2007-03-02 16:07
- 浏览 7388
- 评论(2)
相关推荐
一个osworkflow的例子,其实就是官方的例子,只是除了是汉化的外我还把在jsp中的java代码提取到一个单独的类中,这样便于阅读和理解。希望对大家有帮助。
该资源是用osworkflow框架完成的请假系统的例子,包括了填写请假条,提交申请,审批等流程,是oa的一个例子
osworkflow 可以请假小例子(mysql tomcat eclipse) 亲测可执行,适合入门者熟悉osworkflow的各个部分
jpetstoreosgi.rar mytestworkflow.rar osworkflow持久化.doc osworkflow的介绍.doc osworkflow配置与demo.rar osworkflow中文开发指南.rar osworkflow中文手册osworkflow-chinese-...用osworkflow写一个请假例子.rar
mysql 脚本 请假例子 表结构和初始数据
null 博文链接:https://qsx1982-126-com.iteye.com/blog/769059
现在对于流程性工作,用工作流来做是再合适不过了
osworkflow演示例子
工作流 osworkflow工作流 osworkflow工作流 osworkflow工作流 osworkflow工作流 osworkflow工作流 osworkflow
osworkflow
该例子有问题,请勿下载, 不知道如何删除
基于oracle数据库,tomcat的请假demo,完善的实现了osworkflow的特色功能,能对您进一步了解osworkflow起到指引作用.
osworkflow2.8 工作流,简单的实现流程。
osworkflow请假实例,使用tomcat6.0服务器,oracle数据库,导入到myeclipse中即可运行,当然需要先创建数据库。很适合osworkflow的学习
osworkflow demo 资料 osworkflow demo 资料
osworkflow指导文档 源码 参考资料全
osworkflow在tomcat6下的持久化例子,用mysql数据库 里面有一个数据库脚本,context.xml是tomcat6的配置文件,下载可以直接部署使用
查询osworkflow的历史记录代码