分享
 
 
 

Shark工作流的实现和WMFC&OMG规范的对比

王朝other·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

Shark工作流的实现和WMFC&OMG规范的对比

-----第七部分:工作流信息和业务信息如何建立连接

关键字:Shark 工作流 WMFC OMG 规范

工作流实例化后就需要把具体的活动和业务过程连接起来,如果是用户交互的活动,还需要指定与这个活动相关的界面。

这一部分的工作是具体实现的内容,WMFC规范没有提及。

下面我们看看jbpm的做法:jbpm-1.0-src\jbpm-1.0\examples\process\holiday\processdefinition.xml

Jbpm并没有采用标准的xpdl工作流描述语言,具体如下:

<?xml version="1.0"?>

<process-definition>

<name>Holiday request</name>

<description>This process manages a planned absence of an employee.</description>

<responsible>ae</responsible>

<start-state name="start holiday request">

<description>start a request for a holiday</description>

<role>requester</role>

<field attribute="start date" access="write-only-required" />

<field attribute="end date" access="write-only-required" />

<field attribute="comment" access="write-only" />

<transition to="evaluating">

<action event="transition" handler="org.jbpm.workflow.delegation.impl.action.MsgQueueAction" on-exception="log">

<parameter name="msg.destination.jndi.name">queue/A</parameter>

<parameter name="msg.connection.factory.jndi.name">ConnectionFactory</parameter>

<parameter name="msg.text">a holiday was requested from ${start date} to ${end date} with comment ${comment}</parameter>

</action>

<action event="transition" handler="org.jbpm.workflow.delegation.impl.action.EmailAction" on-exception="log">

<parameter name="to">previousActor</parameter>

<parameter name="subject">you requested a holiday</parameter>

<parameter name="message">you requested a holiday from ${start date} to ${end date} with comment ${comment}</parameter>

</action>

</transition>

</start-state>

<end-state name="end" />

<attribute name="requester" type="actor" />

<attribute name="boss" type="actor" />

<attribute name="hr-responsible" type="actor" />

<attribute name="start date" type="date" />

<attribute name="end date" type="date" />

<attribute name="comment" type="text" initial-value="Put your comments here." />

<attribute name="evaluation result" type="evaluation" />

<activity-state name="evaluating">

<description>In this activity, You have to evaluate the holiday-request of your employee.</description>

<assignment handler="org.jbpm.workflow.delegation.impl.assignment.AssignmentExpressionResolver">

<parameter name="expression" >previousActor->group(hierarchy)->role(boss)</parameter>

</assignment>

<role>boss</role>

<field attribute="requester" access="read-only" />

<field attribute="start date" access="read-only" />

<field attribute="end date" access="read-only" />

<field attribute="evaluation result" access="write-only" />

<transition to="evaluation" />

</activity-state>

<decision name="evaluation" handler="org.jbpm.workflow.delegation.impl.decision.EvaluationDecision">

<parameter name="attribute">evaluation result</parameter>

<transition name="approve" to="approved holiday fork" />

<transition name="disapprove" to="disapproval notification" />

</decision>

<activity-state name="disapproval notification">

<description>This is a notification of the refusal of your holiday request. By submitting this form you declare to have taken notice of the refusal.</description>

<role>requester</role>

<transition to="end" />

</activity-state>

<concurrent-block>

<fork name="approved holiday fork">

<transition name="hr" to="HR notification" />

<transition name="requester" to="approval notification" />

</fork>

<join name="join before finish">

<transition to="end" />

</join>

<activity-state name="HR notification">

<description>In this activity, You have to register that an employee is taking holiday.</description>

<assignment handler="org.jbpm.workflow.delegation.impl.assignment.AssignmentExpressionResolver">

<parameter name="expression" >role(boss)->group(hierarchy)->role(hr-responsible)</parameter>

</assignment>

<role>hr-responsible</role>

<transition to="join before finish" />

</activity-state>

<activity-state name="approval notification">

<description>You get notified that your holiday request has been approved.</description>

<assignment handler="org.jbpm.workflow.delegation.impl.assignment.AssignmentExpressionResolver">

<parameter name="expression" >role(requester)</parameter>

</assignment>

<transition to="join before finish" />

</activity-state>

</concurrent-block>

</process-definition>

如果熟悉struts的读者看到上面的描述会发现, <transition to="join before finish" /> 这样的写法和struts配置文件中的页面跳转十分类似。

上面的写法非常直观,不过比较Shark的XPDL实现。推荐还是使用XPDL的流程描述。

XPDL 把jbpm中分散的跳转放到了一起:

<xpdl:Transitions>

<xpdl:Transition Id="3cb3f6d1-56c6-11d8-8fe6-8f02bbfa91d7" From="提交辞职申请" To="部门经理批准" Name=""/>

<xpdl:Transition Id="6264b4f6-56c6-11d8-8fe6-8f02bbfa91d7" From="部门经理复查" To="总经理批准" Name=""/>

<xpdl:Transition Id="b612ac69-56c6-11d8-8fe6-8f02bbfa91d7" From="部门经理批准" To="财务审查" Name=""/>

<xpdl:Transition Id="b762d31a-56c6-11d8-8fe6-8f02bbfa91d7" From="部门经理批准" To="人力资源审查" Name=""/>

<xpdl:Transition Id="b8a983eb-56c6-11d8-8fe6-8f02bbfa91d7" From="人力资源审查" To="部门经理复查" Name=""/>

<xpdl:Transition Id="bd8394ac-56c6-11d8-8fe6-8f02bbfa91d7" From="财务审查" To="部门经理复查" Name=""/>

</xpdl:Transitions>

但是jbpm的做法也有一个非常好的地方,就是把工作流程和业务系统建立了关系。

下文将具体的说说jbpm中做法的优点。

待续

田春峰

accesine@163.com

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有