用过osworkflow的前辈来指教一下吧。。。。

小北+小杨 发布于 2012/08/23 09:25
阅读 875
收藏 0

我想很清楚地了解osworkflow的caller和owner到底指的是什么?为什么我doAction后数据库中caller和owner让我实在很摸不着头脑呢?

下面是我的流程定义,一个例子

<?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 name="开始工作流" id="0">
 			<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 name="填写请假信息" id="1">
 			<external-permissions>
 				<permission name="permA">
 					<restrict-to>
 						<conditions type="AND">
 							<condition type="beanshell">
 								<arg name="script">true</arg>
 							</condition>
 							<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>
 				</permission>
 			</external-permissions>
 			<actions>
 				<action name="申请" id="1">
 					<pre-functions>
 						<function type="class">
 							<arg name="class.name">com.opensymphony.workflow.util.Caller</arg>
 						</function>
 						<function type="class">
 							<arg name="class.name">com.ideamoment.function.MyApplyFunction</arg>
 						</function>
 					</pre-functions>
 					<results>
 						<unconditional-result old-status="Finished" status="Underway" step="2" owner="${caller}"/>
 					</results>
 				</action>
 			</actions>
 		</step>
 		<step name="经理审批" id="2">
 			<external-permissions>
 				<permission name="permA">
 					<restrict-to>
 						<conditions type="AND">
 							<condition type="beanshell">
 								<arg name="script">true</arg>
 							</condition>
 							<condition type="class">
 								<arg name="class.name">com.opensymphony.workflow.util.OSUserGroupCondition</arg>
 								<arg name="group">ManagerGroup</arg>
 							</condition>
 							<condition type="class">
 								<arg name="class.name">com.opensymphony.workflow.util.StatusCondition</arg>
 								<arg name="status">Underway</arg>
 							</condition>
 						</conditions>
 					</restrict-to>
 				</permission>
 			</external-permissions>
 			<actions>
 				<action name="同意" id="2">
 					<pre-functions>
 						<function type="class">
 							<arg name="class.name">com.opensymphony.workflow.util.Caller</arg>
 						</function>
 					</pre-functions>
 					<results>
 						<result old-status="Finished" status="Finished" step="3" owner="${caller}">
 							<conditions>
 								<condition type="beanshell">
 									<arg name="script">
 										propertySet.getInt("daycount")>5
 									</arg>
 								</condition>
 							</conditions>
 						</result>
 						<unconditional-result old-status="Finished" status="Underway" step="4" owner="${caller}"/>
 					</results>
 				</action>
 				<action name="不同意" id="3">
 					<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="Finished" step="4" owner="${caller}"/>
 					</results>
 				</action>
 			</actions>
 		</step>
 		<step name="领导审批" id="3">
 			<external-permissions>
 				<permission name="permA">
 					<restrict-to>
 						<conditions type="AND">
 							<condition type="beanshell">
 								<arg name="script">true</arg>
 							</condition>
 							<condition type="class">
 								<arg name="class.name">com.opensymphony.workflow.util.OSUserGroupCondition</arg>
 								<arg name="group">LeaderGroup</arg>
 							</condition>
 							<condition type="class">
 								<arg name="class.name">com.opensymphony.workflow.util.StatusCondition</arg>
 								<arg name="status">Underway</arg>
 							</condition>
 						</conditions>
 					</restrict-to>
 				</permission>
 			</external-permissions>
 			<actions>
 				<action name="同意" id="4">
 					<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="4" owner="${caller}"/>
 					</results>
 				</action>
 				<action name="不同意" id="5">
 					<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="4" owner="${caller}"/>
 					</results>
 				</action>
 			</actions>
 		</step>
 		<step name="审批完成" id="4"></step>
 	</steps>
 </workflow>
加载中
返回顶部
顶部