限制是指的是当前作动的执行人!
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.8//EN" "http://www.opensymphony.com/osworkflow/workflow_2_8.dtd">
<workflow>
<initial-actions>
<action id="0" name="开始">
<pre-functions>
<functions type="class">
<arg name="class.name">com.opensymphony.workflow.util.Caller</arg>
</functions>
</pre-functions>
<results>
<unconditional-result old-status="Finished" status="Queued" step="1" owner="${caller}" />
</results>
</action>
</initial-actions>
<steps>
<step id="1" name="送假单">
<actions>
<action id="1" name="送出">
<restrict-to>
<conditions>
<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" status="Queued" step="2" owner="${caller}"/>
</results>
</action>
</actions>
</step>
<step id="2" name="送假单">
<actions>
<action id="2" 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="Queued" step="3" owner="${caller}"/>
</results>
</action>
<action id="3" 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="Queued" step="1" owner="${caller}"/>
</results>
</action>
</actions>
</step>
<step id="3" name="停止" />
</steps>
</workflow>
这是请假单的第二个演变,添加了:
<restrict-to>
<conditions>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.AllowOwnerOnlyCondition
</arg>
</condition>
</conditions>
</restrict-to>
这个配置。这段配置就是用来限定下一步的执行人必须是这一步的发起人。
osworkflow限制的用法有:
事實上OSWorkflow 2.7版提供了以下四種限制條件。
-
OSUserGroupCondition:限制由隸屬某指定Group的人執行。
-
StatusCondition:限制step的status為某個值時才能執行。
-
AllowOwnerOnlyCondition:只允許Owner執行。
-
DenyOwnerCondition:只有Owner不能執行。
posted on 2006-04-22 18:16
有猫相伴的日子 阅读(806)
评论(0) 编辑 收藏 所属分类:
workflow