本文主要是介绍JBPM4.4 入门 简单的请假流程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
最近学习了一下jbpm工作流,感觉网上好多例子都不是很全,所以就做了一个完整的流程,使用jsp和servlet
1 . jbpm的配置文件
(1) jbpm.cg.xml ,该文件可以从下载的jbpm4.4.rar 的example例子里面拷贝到。
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
<import resource="jbpm.default.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
<import resource="jbpm.tx.hibernate.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.bpmn.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
</jbpm-configuration>
2. jbpm.hibernate.cfg.xml 主要是hibernate的配置,也可以从example例子里面拷贝到
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@10.163.100.54:1521:test</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<property name="format_sql">true</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<!-- <property name="hbm2ddl.auto">update</property>
该属性用户自动的生成jbpm的表-->
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
<mapping resource="jbpm.identity.hbm.xml" />
</session-factory>
</hibernate-configuration>
3. jbpm的流程定义文件,这个需要在eclipse中装完插件,就可以画流程,文件如下leaveApply.jpdl.xml
<?xml version="1.0" encoding="UTF-8"?>
<process key="leave" name="leave" xmlns="http://jbpm.org/4.4/jpdl">
<start g="-2,137,48,48" name="start1">
<transition g="-21,-30" name="apply" to="leave_app_fill"/>
</start>
<end g="475,136,48,48" name="end1"/>
<task assignee="leaveUser" g="86,135,92,52" name="leave_app_fill">
<transition g="-26,-32" name="isManager" to="isManager"/>
</task>
<task assignee="bossUser" g="327,65,107,52" name="boss_operate">
<transition g="1,-18" name="b_notApprove" to="end1"/>
<transition g="637,89:-129,-25" name="boss_approve" to="end2"/>
<transition g="132,93:49,-21" name="reject" to="leave_app_fill"/>
</task>
<decision expr="#{isManager}" g="223,138,48,48" name="isManager">
<transition g="-20,-23" name="yes" to="boss_operate"/>
<transition g="-38,7" name="no" to="manager_operate"/>
</decision>
<end g="614,138,48,48" name="end2"/>
<task assignee="manageUser" g="329,192,115,52" name="manager_operate">
<transition g="3,3" name="m_notApprove" to="end1"/>
<transition g="532,219;642,217:-42,8" name="man_approve" to="end2"/>
<transition g="-49,-22" name="day>3" to="boss_operate"/>
<transition g="134,218:61,3" name="reject" to="leave_app_fill"/>
</task>
</process>
流程图如下:
这篇关于JBPM4.4 入门 简单的请假流程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!