流程设计器 - Silverlight 3实现(附源码)
2010-08-10 16:42
363 查看
这两年用MOSS+Infopath方式做了很多的工作流程, 在惊叹于微软强大的同时,也在为这种复杂的开发而痛苦。Infopath表单易于设计,通过InfoPath Form Service在浏览器上给用户的体验效果也很好,苦恼的是在VS2005里做流程的逻辑设计和数据持久化既然麻烦又容易出错。要是工作流逻辑功能的设计跟Infopath的设计一样的简单就好了,要使工作流的逻辑开发变得简单估计自己开发一个简单易用流程设计器也许能行。如果以WF为基础,自己封装一层流程逻辑处理,在此基础上开发一个图形化的流程设计器,流程设计器最终出来一个XML文件,传给自己的流程逻辑处理层,流程逻辑处理层解析这个XML文件,最终生成对应的WF流程定义。 曾经在思维加速的Justep平台上做过流程开发,Justep平台上的流程节点类型就只有5种(开始、功能环节、条件分支、连线以及结束),却能用它们开发出各种复杂逻辑的业务流程。经过一段时间的思考,最后决定参照思维加速,用Silverlight开发一个流程设计器出来。经过几个月业余时间的努力,边学Silverlight边做终于把流程设计器大致给开发出来了。开心!
下面是Workflow11.Designer的一些截图:
1、 流程设计器的节点类型。
1.1 开始
请假申请流程xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<WorkFlow11 UniqueID="a5abd521-5743-4fc6-aae3-778a9f6a1eb1" Name="新建流程">
<WF11Elements>
<WF11Element UniqueID="8fadc099-32fb-45e1-bc5a-bc9ccb8238e5" Title="开始" WF11ElementType="WF11Start" Left="196" Top="18" ZIndex="0">
</WF11Element>
<WF11Element UniqueID="36ceaff2-f5f2-41c9-b8cb-a998160e9ed4" Title="新建活动1" WF11ElementType="WF11Activity" Left="172" Top="95" ZIndex="1">
<WF11ActivityProperty>
<rec_no>0</rec_no>
<can_change>False</can_change>
<can_collect>False</can_collect>
<allow_repeat>True</allow_repeat>
<allow_mail>True</allow_mail>
<allow_note>False</allow_note>
<allow_track>False</allow_track>
<track_no>0</track_no>
<approve_type>1</approve_type>
<parallel_rule>0</parallel_rule>
<tmp_no>0</tmp_no>
<order>0</order>
<name>[Null]</name>
<approver></approver>
<desc>[Null]</desc>
<can_processing>False</can_processing>
<can_return>False</can_return>
<can_return_any>False</can_return_any>
<can_stop>False</can_stop>
</WF11ActivityProperty>
</WF11Element>
<WF11Element UniqueID="c7277a6d-708d-46f9-8fe2-44d96efac902" Title="连线" WF11ElementType="WF11Line" Left="225,225,225,225" Top="72,85.5,85.5,99" ZIndex="2">
</WF11Element>
<WF11Element UniqueID="025bd6ab-b845-4819-9347-572810c179b8" Title="新建活动2" WF11ElementType="WF11Activity" Left="172" Top="345" ZIndex="3">
<WF11ActivityProperty>
<rec_no>0</rec_no>
<can_change>False</can_change>
<can_collect>False</can_collect>
<allow_repeat>True</allow_repeat>
<allow_mail>True</allow_mail>
<allow_note>False</allow_note>
<allow_track>False</allow_track>
<track_no>0</track_no>
<approve_type>1</approve_type>
<parallel_rule>0</parallel_rule>
<tmp_no>0</tmp_no>
<order>0</order>
<name>[Null]</name>
<approver></approver>
<desc>[Null]</desc>
<can_processing>False</can_processing>
<can_return>False</can_return>
<can_return_any>False</can_return_any>
<can_stop>False</can_stop>
</WF11ActivityProperty>
</WF11Element>
<WF11Element UniqueID="e4cac7ec-b6ce-4586-ba5e-b6a396c27937" Title="新建条件1" WF11ElementType="WF11Condition" Left="153" Top="261" ZIndex="4">
</WF11Element>
<WF11Element UniqueID="f58ee7dc-d5d2-4a80-9c3f-7fe9363eb37c" Title="新建活动3" WF11ElementType="WF11Activity" Left="332" Top="256" ZIndex="5">
<WF11ActivityProperty>
<rec_no>0</rec_no>
<can_change>False</can_change>
<can_collect>False</can_collect>
<allow_repeat>True</allow_repeat>
<allow_mail>True</allow_mail>
<allow_note>False</allow_note>
<allow_track>False</allow_track>
<track_no>0</track_no>
<approve_type>1</approve_type>
<parallel_rule>0</parallel_rule>
<tmp_no>0</tmp_no>
<order>0</order>
<name>[Null]</name>
<approver></approver>
<desc>[Null]</desc>
<can_processing>False</can_processing>
<can_return>False</can_return>
<can_return_any>False</can_return_any>
<can_stop>False</can_stop>
</WF11ActivityProperty>
</WF11Element>
<WF11Element UniqueID="8718248a-9077-4875-9103-1d9951b14136" Title="连线" WF11ElementType="WF11Line" Left="225.100006103516,225.100006103516,225,225" Top="313,331,331,349" ZIndex="6">
</WF11Element>
<WF11Element UniqueID="fa7936ba-5186-4272-8658-298a8be104c9" Title="连线" WF11ElementType="WF11Line" Left="293.200012207031,314.600006103516,314.600006103516,336" Top="289,289,289,289" ZIndex="7">
</WF11Element>
<WF11Element UniqueID="34576c71-6bf5-4c8f-acf0-ffb451cb6ed4" Title="新建活动4" WF11ElementType="WF11Activity" Left="172" Top="181" ZIndex="8">
<WF11ActivityProperty>
<rec_no>0</rec_no>
<can_change>False</can_change>
<can_collect>False</can_collect>
<allow_repeat>True</allow_repeat>
<allow_mail>True</allow_mail>
<allow_note>False</allow_note>
<allow_track>False</allow_track>
<track_no>0</track_no>
<approve_type>1</approve_type>
<parallel_rule>0</parallel_rule>
<tmp_no>0</tmp_no>
<order>0</order>
<name>[Null]</name>
<approver></approver>
<desc>[Null]</desc>
<can_processing>False</can_processing>
<can_return>False</can_return>
<can_return_any>False</can_return_any>
<can_stop>False</can_stop>
</WF11ActivityProperty>
</WF11Element>
<WF11Element UniqueID="3bb14852-a9dc-41a4-8a87-084731a8d00e" Title="连线" WF11ElementType="WF11Line" Left="225,225,225,225" Top="157,171,171,185" ZIndex="9">
</WF11Element>
<WF11Element UniqueID="328afe8b-753e-40fd-bca3-390096724dee" Title="连线" WF11ElementType="WF11Line" Left="225,225,225.100006103516,225.100006103516" Top="243,254,254,265" ZIndex="10">
</WF11Element>
<WF11Element UniqueID="72bf4885-9dc9-4627-b9c3-8d0f2ddeb5d6" Title="连线" WF11ElementType="WF11Line" Left="274,385,385,385" Top="378,378,318,318" ZIndex="11">
</WF11Element>
<WF11Element UniqueID="c4a16fa1-c7fe-4200-b608-8c310366d554" Title="结束" WF11ElementType="WF11Finish" Left="485" Top="260" ZIndex="26">
</WF11Element>
<WF11Element UniqueID="7baa69f0-1912-482e-9924-e01823db5f95" Title="连线" WF11ElementType="WF11Line" Left="434,461.5,461.5,489" Top="289,289,289,289" ZIndex="13">
</WF11Element>
</WF11Elements>
</WorkFlow11>
6、源码 <下载>
下面是Workflow11.Designer的一些截图:
1、 流程设计器的节点类型。
1.1 开始
请假申请流程xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<WorkFlow11 UniqueID="a5abd521-5743-4fc6-aae3-778a9f6a1eb1" Name="新建流程">
<WF11Elements>
<WF11Element UniqueID="8fadc099-32fb-45e1-bc5a-bc9ccb8238e5" Title="开始" WF11ElementType="WF11Start" Left="196" Top="18" ZIndex="0">
</WF11Element>
<WF11Element UniqueID="36ceaff2-f5f2-41c9-b8cb-a998160e9ed4" Title="新建活动1" WF11ElementType="WF11Activity" Left="172" Top="95" ZIndex="1">
<WF11ActivityProperty>
<rec_no>0</rec_no>
<can_change>False</can_change>
<can_collect>False</can_collect>
<allow_repeat>True</allow_repeat>
<allow_mail>True</allow_mail>
<allow_note>False</allow_note>
<allow_track>False</allow_track>
<track_no>0</track_no>
<approve_type>1</approve_type>
<parallel_rule>0</parallel_rule>
<tmp_no>0</tmp_no>
<order>0</order>
<name>[Null]</name>
<approver></approver>
<desc>[Null]</desc>
<can_processing>False</can_processing>
<can_return>False</can_return>
<can_return_any>False</can_return_any>
<can_stop>False</can_stop>
</WF11ActivityProperty>
</WF11Element>
<WF11Element UniqueID="c7277a6d-708d-46f9-8fe2-44d96efac902" Title="连线" WF11ElementType="WF11Line" Left="225,225,225,225" Top="72,85.5,85.5,99" ZIndex="2">
</WF11Element>
<WF11Element UniqueID="025bd6ab-b845-4819-9347-572810c179b8" Title="新建活动2" WF11ElementType="WF11Activity" Left="172" Top="345" ZIndex="3">
<WF11ActivityProperty>
<rec_no>0</rec_no>
<can_change>False</can_change>
<can_collect>False</can_collect>
<allow_repeat>True</allow_repeat>
<allow_mail>True</allow_mail>
<allow_note>False</allow_note>
<allow_track>False</allow_track>
<track_no>0</track_no>
<approve_type>1</approve_type>
<parallel_rule>0</parallel_rule>
<tmp_no>0</tmp_no>
<order>0</order>
<name>[Null]</name>
<approver></approver>
<desc>[Null]</desc>
<can_processing>False</can_processing>
<can_return>False</can_return>
<can_return_any>False</can_return_any>
<can_stop>False</can_stop>
</WF11ActivityProperty>
</WF11Element>
<WF11Element UniqueID="e4cac7ec-b6ce-4586-ba5e-b6a396c27937" Title="新建条件1" WF11ElementType="WF11Condition" Left="153" Top="261" ZIndex="4">
</WF11Element>
<WF11Element UniqueID="f58ee7dc-d5d2-4a80-9c3f-7fe9363eb37c" Title="新建活动3" WF11ElementType="WF11Activity" Left="332" Top="256" ZIndex="5">
<WF11ActivityProperty>
<rec_no>0</rec_no>
<can_change>False</can_change>
<can_collect>False</can_collect>
<allow_repeat>True</allow_repeat>
<allow_mail>True</allow_mail>
<allow_note>False</allow_note>
<allow_track>False</allow_track>
<track_no>0</track_no>
<approve_type>1</approve_type>
<parallel_rule>0</parallel_rule>
<tmp_no>0</tmp_no>
<order>0</order>
<name>[Null]</name>
<approver></approver>
<desc>[Null]</desc>
<can_processing>False</can_processing>
<can_return>False</can_return>
<can_return_any>False</can_return_any>
<can_stop>False</can_stop>
</WF11ActivityProperty>
</WF11Element>
<WF11Element UniqueID="8718248a-9077-4875-9103-1d9951b14136" Title="连线" WF11ElementType="WF11Line" Left="225.100006103516,225.100006103516,225,225" Top="313,331,331,349" ZIndex="6">
</WF11Element>
<WF11Element UniqueID="fa7936ba-5186-4272-8658-298a8be104c9" Title="连线" WF11ElementType="WF11Line" Left="293.200012207031,314.600006103516,314.600006103516,336" Top="289,289,289,289" ZIndex="7">
</WF11Element>
<WF11Element UniqueID="34576c71-6bf5-4c8f-acf0-ffb451cb6ed4" Title="新建活动4" WF11ElementType="WF11Activity" Left="172" Top="181" ZIndex="8">
<WF11ActivityProperty>
<rec_no>0</rec_no>
<can_change>False</can_change>
<can_collect>False</can_collect>
<allow_repeat>True</allow_repeat>
<allow_mail>True</allow_mail>
<allow_note>False</allow_note>
<allow_track>False</allow_track>
<track_no>0</track_no>
<approve_type>1</approve_type>
<parallel_rule>0</parallel_rule>
<tmp_no>0</tmp_no>
<order>0</order>
<name>[Null]</name>
<approver></approver>
<desc>[Null]</desc>
<can_processing>False</can_processing>
<can_return>False</can_return>
<can_return_any>False</can_return_any>
<can_stop>False</can_stop>
</WF11ActivityProperty>
</WF11Element>
<WF11Element UniqueID="3bb14852-a9dc-41a4-8a87-084731a8d00e" Title="连线" WF11ElementType="WF11Line" Left="225,225,225,225" Top="157,171,171,185" ZIndex="9">
</WF11Element>
<WF11Element UniqueID="328afe8b-753e-40fd-bca3-390096724dee" Title="连线" WF11ElementType="WF11Line" Left="225,225,225.100006103516,225.100006103516" Top="243,254,254,265" ZIndex="10">
</WF11Element>
<WF11Element UniqueID="72bf4885-9dc9-4627-b9c3-8d0f2ddeb5d6" Title="连线" WF11ElementType="WF11Line" Left="274,385,385,385" Top="378,378,318,318" ZIndex="11">
</WF11Element>
<WF11Element UniqueID="c4a16fa1-c7fe-4200-b608-8c310366d554" Title="结束" WF11ElementType="WF11Finish" Left="485" Top="260" ZIndex="26">
</WF11Element>
<WF11Element UniqueID="7baa69f0-1912-482e-9924-e01823db5f95" Title="连线" WF11ElementType="WF11Line" Left="434,461.5,461.5,489" Top="289,289,289,289" ZIndex="13">
</WF11Element>
</WF11Elements>
</WorkFlow11>
6、源码 <下载>
相关文章推荐
- Silverlight实现查询建模(十) 与Silverlight流程设计器集成
- Silverlight实现查询建模(十) 与Silverlight流程设计器集成
- COP2000模型微处理器设计(VHDL实现)源码
- 在线小说网站的设计与实现(附源码)
- 微内核流程引擎(IVR导航)的设计与实现(一)——开发背景
- Tomcat源码阅读之Connector设计与实现
- 读懂源码系列-FileZilla Server 设计原则分析-socket 事件响应流程(3)
- Silverlight实用窍门系列:12.继承于某些固定控件(以Grid为例)的鼠标左键双击事件的实现【附带实例源码】
- 中国象棋程序的设计与实现(六)--N皇后问题的算法设计与实现(源码+注释+截图)
- Spring源码分析----AOP概念(Advice,Pointcut,Advisor)和AOP的设计与实现
- 结合redis设计与实现的redis源码学习-3-链表
- 读懂源码系列-FileZilla Server 设计原则分析-socket 事件处理流程(4)
- 使用silverlight构建一个图形化流程设计器(二)(附源代码下载及在线演示)
- 中国象棋程序的设计与实现(二)--源码
- 结合redis设计与实现的redis源码学习-8.2-t_string(字符串键)
- 11.Spark Streaming源码解读之Driver中的ReceiverTracker架构设计以及具体实现彻底研究
- Web用户的身份验证及WebApi权限验证流程的设计和实现
- 多年一直想完善的自由行政审批流程组件【2002年PHP,2008年.NET,2010年完善数据设计、代码实现】
- Spring IOC和Spring AOP的实现原理(源码主线流程)
- 通用的业务编号规则设计实现(附源码)