前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >(5)Shark工作流的实现和WMFC&OMG规范的对比

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

作者头像
田春峰-JCJC错别字检测
发布2019-02-14 14:56:19
3860
发布2019-02-14 14:56:19
举报

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

-----第五部分:工作流的实例化

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

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

学习了这么多的开源框架,准备自己也实现一个。万事开头难,先说说如何用XPDL来描述流程中需要包含的信息和如何实例化一个流程。

在shark中有一个Package-Business_Example 的例子。其中Customer Service - Request for Partial Shipment (客户服务—对分装运输的要求)流程信息的xdpl描述如下:

<WorkflowProcess>

<WorkflowProcess AccessLevel="PUBLIC" Id="Business_Example_Wor2" Name="Customer Service - Request for Partial Shipment">

<ProcessHeader DurationUnit="D">

<Created>13-03-2003</Created>

</ProcessHeader>

<RedefinableHeader PublicationStatus="UNDER_TEST"/>

<FormalParameters>

<FormalParameter Id="Customer_Name" Index="1" Mode="IN">

<DataType>

<BasicType Type="STRING"/>

</DataType>

<Description>The customer (or customer organization) name</Description>

</FormalParameter>

<FormalParameter Id="Product_Name" Index="2" Mode="IN">

<DataType>

<BasicType Type="STRING"/>

</DataType>

<Description>The product name</Description>

</FormalParameter>

<FormalParameter Id="Ordered_Quantity" Index="3" Mode="IN">

<DataType>

<BasicType Type="INTEGER"/>

</DataType>

<Description>The number of ordered items</Description>

</FormalParameter>

<FormalParameter Id="No_Of_Stocked_Items" Index="4" Mode="IN">

<DataType>

<BasicType Type="INTEGER"/>

</DataType>

<Description>The number of ordered items on stock</Description>

</FormalParameter>

<FormalParameter Id="Partial_Ship_Status" Index="5" Mode="OUT">

<DataType>

<DeclaredType Id="Business_Example_Typ2"/>

</DataType>

<Description>If customer aggreed on partial shipment, set the value of this variable to "OK", otherwise to anything else ("NOT_OK" for e.g.)</Description>

</FormalParameter>

</FormalParameters>

<Activities>

<Activity Id="Business_Example_Wor2_Act4" Name="notify sales">

<Description>Enter the customer response ("OK" if customer accepts partial shipment)</Description>

<Implementation>

<No/>

</Implementation>

<Performer>Participant_Repository_Par10</Performer>

<StartMode>

<Automatic/>

</StartMode>

<FinishMode>

<Automatic/>

</FinishMode>

<ExtendedAttributes>

<ExtendedAttribute Name="ParticipantID" Value="Participant_Repository_Par10"/>

<ExtendedAttribute Name="XOffset" Value="381"/>

<ExtendedAttribute Name="YOffset" Value="70"/>

<ExtendedAttribute Name="VariableToProcess_UPDATE" Value="Partial_Ship_Status"/>

</ExtendedAttributes>

</Activity>

<Activity Id="Business_Example_Wor2_Act2" Name="ask customer for partial shipment">

<Description>Asks customer if it is OK to partialy ship the existing number of wanted items</Description>

<Implementation>

<No/>

</Implementation>

<Performer>Participant_Repository_Par10</Performer>

<StartMode>

<Automatic/>

</StartMode>

<FinishMode>

<Automatic/>

</FinishMode>

<ExtendedAttributes>

<ExtendedAttribute Name="ParticipantID" Value="Participant_Repository_Par10"/>

<ExtendedAttribute Name="XOffset" Value="226"/>

<ExtendedAttribute Name="YOffset" Value="70"/>

<ExtendedAttribute Name="VariableToProcess_VIEW" Value="Customer_Name"/>

<ExtendedAttribute Name="VariableToProcess_VIEW" Value="Product_Name"/>

<ExtendedAttribute Name="VariableToProcess_VIEW" Value="Order_Quantity"/>

<ExtendedAttribute Name="VariableToProcess_VIEW" Value="No_Of_Stocked_Items"/>

</ExtendedAttributes>

</Activity>

</Activities>

<Transitions>

<Transition From="Business_Example_Wor2_Act2" Id="Business_Example_Wor2_Tra23" Name="Transition" To="Business_Example_Wor2_Act4">

<ExtendedAttributes>

<ExtendedAttribute Name="RoutingType" Value="NOROUTING"/>

</ExtendedAttributes>

</Transition>

</Transitions>

<ExtendedAttributes>

<ExtendedAttribute Name="StartOfWorkflow" Value="Participant_Repository_Par10;Business_Example_Wor2_Act2;128;70;NOROUTING"/>

<ExtendedAttribute Name="EndOfWorkflow" Value="Participant_Repository_Par10;Business_Example_Wor2_Act4;527;70;NOROUTING"/>

<ExtendedAttribute Name="ParticipantVisualOrder" Value="Participant_Repository_Par10;"/>

</ExtendedAttributes>

</WorkflowProcess>

</WorkflowProcess>

解释如下:

这个流程只有两个活动:

1、<Activity Id="Business_Example_Wor2_Act2" Name="ask customer for partial shipment">

询问用户时候需要分装运输

2、<Activity Id="Business_Example_Wor2_Act4" Name="notify sales">

告诉客户销售

两个活动的转移:

<Transition From="Business_Example_Wor2_Act2" Id="Business_Example_Wor2_Tra23" Name="Transition" To="Business_Example_Wor2_Act4">

上面的描述只是一个基本的XPDL的实现,在现实世界里所需要的信息是不充分的。

比如:

1、 当用户A登陆后,需要知道和用户A相关的那些活动已经启动,并提示用户A,操作这个活动。这样在实例化的流程中需要包含参与者的信息。

2、 上面的描述中只是包含了工作流本身的信息,很显然,工作流任务执行的具体最后要落实在业务过程上,那么在实例化后的工作流中应该包含业务的数据,最少应该包含能够找到这个业务的连接数据。

3、 工作流具体的状态业务状态在实例化的流程中应该保存起来。

从上面的对比中可以看出,工作流引擎对如何实例化工作信息和业务信息应该是不同的,因为这并不是WMFC规范中的内容。

待续

田春峰

accesine@163.com

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2004年02月05日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档