环境要求:
1、 已经安装好了Jboss+jbpm,即http://localhost:8080/jbpm-console可以正常运行;
2、 已安装好Eclipse;
3、 下载jbpm-jpdl-designer-site-3.1.5,http://www.jboss.org/downloading/?projectId=jbossjbpm&url=http://sourceforge.net/project/downloading.php?groupname=jbpm&filename=jbpm-jpdl-designer-site-3.1.5.zip
4、 jbpm-jpdl-designer- site-3.1.5解压后,根目录下有一个readme.html文件,告诉你在Eclipse中怎么安装该插件。
打开Eclipse
File--New--Project…
另外一个Process Project项目是安装了jbpm-starters-kit-3.1.2.zip的结果,但没有可视化的设计工具,例如generate form…按钮。
新建HelloWorld项目
右键新建New--Other--
现在定义流程
通过View--Show Grid按钮显示设计网格。
拖入适当Start State、Task Node、Task Node、End State四个元素。用Transition依次连接起来。
选择Start State,在Properties中设置Tasks,将其命名Initial,并通过Generate Form…设置该任务的表单。
在Assignment中设置Actor为user。
选择Task Node1,为其设置一个名为Approve1的Tasks。Generate Form…设置如下。
在Assignment中设置Actor为manager。
选择Task Node2,为其设置一个名为Approve2的Tasks。Generate Form…设置如下。
在Assignment中设置Actor为admin。
保存全部。这个流程基本已完成,找到gpd.xml所在位置,将文件打包成HelloWorld.zip。
通过jbpm-console的Deploy部署HelloWorld.zip。