??xml version="1.0" encoding="utf-8" standalone="yes"?>末成年女av片一区二区下载,99亚洲精品,亚洲国模精品一区http://www.aygfsteel.com/libin2722/category/25641.htmlzh-cnThu, 13 Sep 2007 04:28:19 GMTThu, 13 Sep 2007 04:28:19 GMT60如何在Web应用中启动后CQ?http://www.aygfsteel.com/libin2722/articles/144165.htmlC物C物Tue, 11 Sep 2007 02:13:00 GMThttp://www.aygfsteel.com/libin2722/articles/144165.htmlhttp://www.aygfsteel.com/libin2722/comments/144165.htmlhttp://www.aygfsteel.com/libin2722/articles/144165.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/144165.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/144165.html摘要
  
  我们常常在Web应用中需要启动一个自己写的服务,本文的目的是l你提供一个解x案?br />   
  原理
  
  本方案的原理是写一个实CServletContextListener接口的类Q该cM有两个方法:public void contextInitialized(ServletContextEvent sce)Q它是在应用启动时调用;另一个方法是Qpublic void contextDestroyed(ServletContextEvent sce)Q该Ҏ是在应用l束时调用。把我们要启动的后台应用逻辑攑֜contextInitializedҎ中实玎ͼ把释攑֐台应用占用资源的工作攑֜contextDestroyed来处理。但我们启动的后CQ务常常是有要求的Q比如时_频率{,我在q里使用了一个开源组Ӟquartz?br />   
  步骤
  
  1.写业务调用类Q?/strong>
  
  // DumbJob.java
  import org.quartz.*;
  import java.util.*;
  public class DumbJob implements Job {
  public DumbJob() {
  }
  public void execute(JobExecutionContext context)
  throws JobExecutionException
  {
  //在这里写业务处理代码。什么,你不知道Q那你别问我Q!:-<
  }
  }
  
  本类的主要功能是由quartz中调度类按照指定的规则进行调用执行必要的业务逻辑?br />   
  2.写调度类
  
  // TestShedule.java
  import org.quartz.*;
  import java.util.*;
  
  public class TestShedule{
  static SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
  static Scheduler sched;
  
  public static void run()throws Exception{
  sched = schedFact.getScheduler();  //获取调度理?br />   JobDetail jobDetail = new JobDetail("myJob",
  sched.DEFAULT_GROUP,
  DumbJob.class);//创徏工作
  CronTrigger trigger = new CronTrigger("myTrigger","test","0/10 * * * * ?");//创徏触发?br />   sched.scheduleJob(jobDetail, trigger);  //d到调度管理器?br />   sched.start();//启动调度理?br />   }
  
  public static void   stop()throws Exception{
  sched.shutdown();
  }
  }
  本类的目的是讄调用规则Q在q里我用?#8220;0/10 * * * * ?”表示?0U钟执行一ơ,有关表达式的说明请参阅quartz的api文档?br />   
  3.~写服务启动c:
  
  //ServiceLoader.java
  import javax.servlet.ServletContextEvent;
  import javax.servlet.ServletContextListener;
  
  public class ServiceLoader implements ServletContextListener {
  public void contextInitialized(ServletContextEvent sce) {
  try{
  TestShedule.run();
  }catch(Exception ex){
  System.out.println(ex.getMessage());
  }
  }
  
  public void contextDestroyed(ServletContextEvent sce) {
  try{
  TestShedule.stop();
  }catch(Exception ex){
  System.out.println(ex.getMessage());
  }
  }
  }
  在contextInitialized中调用TestShedule.run()启动后台dQ在contextDestroyed中调用TestShedule.stop()停止后台d?br />   
  4.部v服务启动c?/strong>
  
  在web.xml文g中增加如下一行配|:
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
  <web-app id="WebApp">
  <display-name>root</display-name>
  <!--下边的listener部分是配置信息-->
  <listener>
  <listener-class>ServiceLoader </listener-class>
  </listener>
  <welcome-file-list>
  <welcome-file>index.html</welcome-file>
  </welcome-file-list>
  </web-app>
  
  5.启动web服务卛_?/strong>
  
  ȝ
  
  其实实现q个功能的方法很多,我在q里是应用了ServletContextListener接口和开源api quartzQ希望能对你的开发有所帮助?br />

C物 2007-09-11 10:13 发表评论
]]>
jbpm oracle 数据库脚?/title><link>http://www.aygfsteel.com/libin2722/articles/143256.html</link><dc:creator>C物</dc:creator><author>C物</author><pubDate>Thu, 06 Sep 2007 10:40:00 GMT</pubDate><guid>http://www.aygfsteel.com/libin2722/articles/143256.html</guid><wfw:comment>http://www.aygfsteel.com/libin2722/comments/143256.html</wfw:comment><comments>http://www.aygfsteel.com/libin2722/articles/143256.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/libin2722/comments/commentRss/143256.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/libin2722/services/trackbacks/143256.html</trackback:ping><description><![CDATA[<p>/*<br /> SQLyog Enterprise - MySQL GUI v5.02<br /> Host - 5.0.27-community-nt : Database - jbpm<br /> *********************************************************************<br /> Server version : 5.0.27-community-nt<br /> */</p> <p><br /> create database if not exists `jbpm`;</p> <p>USE `jbpm`;</p> <p>SET FOREIGN_KEY_CHECKS=0;</p> <p>/*Table structure for table `jbpm_action` */</p> <p>DROP TABLE IF EXISTS `jbpm_action`;</p> <p>CREATE TABLE `jbpm_action` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `class` char(1) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `ISPROPAGATIONALLOWED_` integer(1) default NULL,<br />   `ACTIONEXPRESSION_` varchar(255) default NULL,<br />   `ISASYNC_` integer(1) default NULL,<br />   `REFERENCEDACTION_` bigint(20) default NULL,<br />   `ACTIONDELEGATION_` bigint(20) default NULL,<br />   `EVENT_` bigint(20) default NULL,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   `TIMERNAME_` varchar(255) default NULL,<br />   `DUEDATE_` varchar(255) default NULL,<br />   `REPEAT_` varchar(255) default NULL,<br />   `TRANSITIONNAME_` varchar(255) default NULL,<br />   `TIMERACTION_` bigint(20) default NULL,<br />   `EXPRESSION_` mediumtext,<br />   `EVENTINDEX_` int(11) default NULL,<br />   `EXCEPTIONHANDLER_` bigint(20) default NULL,<br />   `EXCEPTIONHANDLERINDEX_` int(11) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_ACTION_EVENT` (`EVENT_`),<br />   KEY `IDX_ACTION_ACTNDL` (`ACTIONDELEGATION_`),<br />   KEY `IDX_ACTION_PROCDF` (`PROCESSDEFINITION_`),<br />   KEY `FK_ACTION_EVENT` (`EVENT_`),<br />   KEY `FK_ACTION_EXPTHDL` (`EXCEPTIONHANDLER_`),<br />   KEY `FK_ACTION_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `FK_CRTETIMERACT_TA` (`TIMERACTION_`),<br />   KEY `FK_ACTION_ACTNDEL` (`ACTIONDELEGATION_`),<br />   KEY `FK_ACTION_REFACT` (`REFERENCEDACTION_`),<br />   CONSTRAINT `FK_ACTION_REFACT` FOREIGN KEY (`REFERENCEDACTION_`) REFERENCES `jbpm_action` (`ID_`),<br />   CONSTRAINT `FK_ACTION_ACTNDEL` FOREIGN KEY (`ACTIONDELEGATION_`) REFERENCES `jbpm_delegation` (`ID_`),<br />   CONSTRAINT `FK_ACTION_EVENT` FOREIGN KEY (`EVENT_`) REFERENCES `jbpm_event` (`ID_`),<br />   CONSTRAINT `FK_ACTION_EXPTHDL` FOREIGN KEY (`EXCEPTIONHANDLER_`) REFERENCES `jbpm_exceptionhandler` (`ID_`),<br />   CONSTRAINT `FK_ACTION_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`),<br />   CONSTRAINT `FK_CRTETIMERACT_TA` FOREIGN KEY (`TIMERACTION_`) REFERENCES `jbpm_action` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_bytearray` */</p> <p>DROP TABLE IF EXISTS `jbpm_bytearray`;</p> <p>CREATE TABLE `jbpm_bytearray` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `NAME_` varchar(255) default NULL,<br />   `FILEDEFINITION_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `FK_BYTEARR_FILDEF` (`FILEDEFINITION_`),<br />   CONSTRAINT `FK_BYTEARR_FILDEF` FOREIGN KEY (`FILEDEFINITION_`) REFERENCES `jbpm_moduledefinition` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_byteblock` */</p> <p>DROP TABLE IF EXISTS `jbpm_byteblock`;</p> <p>CREATE TABLE `jbpm_byteblock` (<br />   `PROCESSFILE_` bigint(20) NOT NULL,<br />   `BYTES_` blob,<br />   `INDEX_` int(11) NOT NULL,<br />   PRIMARY KEY  (`PROCESSFILE_`,`INDEX_`),<br />   KEY `FK_BYTEBLOCK_FILE` (`PROCESSFILE_`),<br />   CONSTRAINT `FK_BYTEBLOCK_FILE` FOREIGN KEY (`PROCESSFILE_`) REFERENCES `jbpm_bytearray` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_comment` */</p> <p>DROP TABLE IF EXISTS `jbpm_comment`;</p> <p>CREATE TABLE `jbpm_comment` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `VERSION_` int(11) NOT NULL,<br />   `ACTORID_` varchar(255) default NULL,<br />   `TIME_` datetime default NULL,<br />   `MESSAGE_` mediumtext,<br />   `TOKEN_` bigint(20) default NULL,<br />   `TASKINSTANCE_` bigint(20) default NULL,<br />   `TOKENINDEX_` int(11) default NULL,<br />   `TASKINSTANCEINDEX_` int(11) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_COMMENT_TOKEN` (`TOKEN_`),<br />   KEY `IDX_COMMENT_TSK` (`TASKINSTANCE_`),<br />   KEY `FK_COMMENT_TOKEN` (`TOKEN_`),<br />   KEY `FK_COMMENT_TSK` (`TASKINSTANCE_`),<br />   CONSTRAINT `FK_COMMENT_TSK` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`),<br />   CONSTRAINT `FK_COMMENT_TOKEN` FOREIGN KEY (`TOKEN_`) REFERENCES `jbpm_token` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_decisionconditions` */</p> <p>DROP TABLE IF EXISTS `jbpm_decisionconditions`;</p> <p>CREATE TABLE `jbpm_decisionconditions` (<br />   `DECISION_` bigint(20) NOT NULL,<br />   `TRANSITIONNAME_` varchar(255) default NULL,<br />   `EXPRESSION_` varchar(255) default NULL,<br />   `INDEX_` int(11) NOT NULL,<br />   PRIMARY KEY  (`DECISION_`,`INDEX_`),<br />   KEY `FK_DECCOND_DEC` (`DECISION_`),<br />   CONSTRAINT `FK_DECCOND_DEC` FOREIGN KEY (`DECISION_`) REFERENCES `jbpm_node` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_delegation` */</p> <p>DROP TABLE IF EXISTS `jbpm_delegation`;</p> <p>CREATE TABLE `jbpm_delegation` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASSNAME_` mediumtext,<br />   `CONFIGURATION_` mediumtext,<br />   `CONFIGTYPE_` varchar(255) default NULL,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_DELEG_PRCD` (`PROCESSDEFINITION_`),<br />   KEY `FK_DELEGATION_PRCD` (`PROCESSDEFINITION_`),<br />   CONSTRAINT `FK_DELEGATION_PRCD` FOREIGN KEY (`PROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_event` */</p> <p>DROP TABLE IF EXISTS `jbpm_event`;</p> <p>CREATE TABLE `jbpm_event` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `EVENTTYPE_` varchar(255) default NULL,<br />   `TYPE_` char(1) default NULL,<br />   `GRAPHELEMENT_` bigint(20) default NULL,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   `NODE_` bigint(20) default NULL,<br />   `TRANSITION_` bigint(20) default NULL,<br />   `TASK_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `FK_EVENT_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `FK_EVENT_NODE` (`NODE_`),<br />   KEY `FK_EVENT_TRANS` (`TRANSITION_`),<br />   KEY `FK_EVENT_TASK` (`TASK_`),<br />   CONSTRAINT `FK_EVENT_TASK` FOREIGN KEY (`TASK_`) REFERENCES `jbpm_task` (`ID_`),<br />   CONSTRAINT `FK_EVENT_NODE` FOREIGN KEY (`NODE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_EVENT_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`),<br />   CONSTRAINT `FK_EVENT_TRANS` FOREIGN KEY (`TRANSITION_`) REFERENCES `jbpm_transition` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_exceptionhandler` */</p> <p>DROP TABLE IF EXISTS `jbpm_exceptionhandler`;</p> <p>CREATE TABLE `jbpm_exceptionhandler` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `EXCEPTIONCLASSNAME_` text,<br />   `TYPE_` char(1) default NULL,<br />   `GRAPHELEMENT_` bigint(20) default NULL,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   `GRAPHELEMENTINDEX_` int(11) default NULL,<br />   `NODE_` bigint(20) default NULL,<br />   `TRANSITION_` bigint(20) default NULL,<br />   `TASK_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_id_group` */</p> <p>DROP TABLE IF EXISTS `jbpm_id_group`;</p> <p>CREATE TABLE `jbpm_id_group` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `TYPE_` varchar(255) default NULL,<br />   `PARENT_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `FK_ID_GRP_PARENT` (`PARENT_`),<br />   CONSTRAINT `FK_ID_GRP_PARENT` FOREIGN KEY (`PARENT_`) REFERENCES `jbpm_id_group` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_id_membership` */</p> <p>DROP TABLE IF EXISTS `jbpm_id_membership`;</p> <p>CREATE TABLE `jbpm_id_membership` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `ROLE_` varchar(255) default NULL,<br />   `USER_` bigint(20) default NULL,<br />   `GROUP_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `FK_ID_MEMSHIP_GRP` (`GROUP_`),<br />   KEY `FK_ID_MEMSHIP_USR` (`USER_`),<br />   CONSTRAINT `FK_ID_MEMSHIP_USR` FOREIGN KEY (`USER_`) REFERENCES `jbpm_id_user` (`ID_`),<br />   CONSTRAINT `FK_ID_MEMSHIP_GRP` FOREIGN KEY (`GROUP_`) REFERENCES `jbpm_id_group` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_id_permissions` */</p> <p>DROP TABLE IF EXISTS `jbpm_id_permissions`;</p> <p>CREATE TABLE `jbpm_id_permissions` (<br />   `ENTITY_` bigint(20) NOT NULL,<br />   `CLASS_` varchar(255) default NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `ACTION_` varchar(255) default NULL<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_id_user` */</p> <p>DROP TABLE IF EXISTS `jbpm_id_user`;</p> <p>CREATE TABLE `jbpm_id_user` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `EMAIL_` varchar(255) default NULL,<br />   `PASSWORD_` varchar(255) default NULL,<br />   PRIMARY KEY  (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_job` */</p> <p>DROP TABLE IF EXISTS `jbpm_job`;</p> <p>CREATE TABLE `jbpm_job` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `VERSION_` int(11) NOT NULL,<br />   `DUEDATE_` datetime default NULL,<br />   `PROCESSINSTANCE_` bigint(20) default NULL,<br />   `TOKEN_` bigint(20) default NULL,<br />   `TASKINSTANCE_` bigint(20) default NULL,<br />   `ISSUSPENDED_` integer(1) default NULL,<br />   `ISEXCLUSIVE_` integer(1) default NULL,<br />   `LOCKOWNER_` varchar(255) default NULL,<br />   `LOCKTIME_` datetime default NULL,<br />   `EXCEPTION_` mediumtext,<br />   `RETRIES_` int(11) default NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `REPEAT_` varchar(255) default NULL,<br />   `TRANSITIONNAME_` varchar(255) default NULL,<br />   `ACTION_` bigint(20) default NULL,<br />   `GRAPHELEMENTTYPE_` varchar(255) default NULL,<br />   `GRAPHELEMENT_` bigint(20) default NULL,<br />   `NODE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_JOB_TSKINST` (`TASKINSTANCE_`),<br />   KEY `IDX_JOB_PRINST` (`PROCESSINSTANCE_`),<br />   KEY `IDX_JOB_TOKEN` (`TOKEN_`),<br />   KEY `FK_JOB_TOKEN` (`TOKEN_`),<br />   KEY `FK_JOB_NODE` (`NODE_`),<br />   KEY `FK_JOB_PRINST` (`PROCESSINSTANCE_`),<br />   KEY `FK_JOB_ACTION` (`ACTION_`),<br />   KEY `FK_JOB_TSKINST` (`TASKINSTANCE_`),<br />   CONSTRAINT `FK_JOB_TSKINST` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`),<br />   CONSTRAINT `FK_JOB_ACTION` FOREIGN KEY (`ACTION_`) REFERENCES `jbpm_action` (`ID_`),<br />   CONSTRAINT `FK_JOB_NODE` FOREIGN KEY (`NODE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_JOB_PRINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`),<br />   CONSTRAINT `FK_JOB_TOKEN` FOREIGN KEY (`TOKEN_`) REFERENCES `jbpm_token` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_log` */</p> <p>DROP TABLE IF EXISTS `jbpm_log`;</p> <p>CREATE TABLE `jbpm_log` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `INDEX_` int(11) default NULL,<br />   `DATE_` datetime default NULL,<br />   `TOKEN_` bigint(20) default NULL,<br />   `PARENT_` bigint(20) default NULL,<br />   `MESSAGE_` mediumtext,<br />   `EXCEPTION_` mediumtext,<br />   `ACTION_` bigint(20) default NULL,<br />   `NODE_` bigint(20) default NULL,<br />   `ENTER_` datetime default NULL,<br />   `LEAVE_` datetime default NULL,<br />   `DURATION_` bigint(20) default NULL,<br />   `NEWLONGVALUE_` bigint(20) default NULL,<br />   `TRANSITION_` bigint(20) default NULL,<br />   `CHILD_` bigint(20) default NULL,<br />   `SOURCENODE_` bigint(20) default NULL,<br />   `DESTINATIONNODE_` bigint(20) default NULL,<br />   `VARIABLEINSTANCE_` bigint(20) default NULL,<br />   `OLDBYTEARRAY_` bigint(20) default NULL,<br />   `NEWBYTEARRAY_` bigint(20) default NULL,<br />   `OLDDATEVALUE_` datetime default NULL,<br />   `NEWDATEVALUE_` datetime default NULL,<br />   `OLDDOUBLEVALUE_` double default NULL,<br />   `NEWDOUBLEVALUE_` double default NULL,<br />   `OLDLONGIDCLASS_` varchar(255) default NULL,<br />   `OLDLONGIDVALUE_` bigint(20) default NULL,<br />   `NEWLONGIDCLASS_` varchar(255) default NULL,<br />   `NEWLONGIDVALUE_` bigint(20) default NULL,<br />   `OLDSTRINGIDCLASS_` varchar(255) default NULL,<br />   `OLDSTRINGIDVALUE_` varchar(255) default NULL,<br />   `NEWSTRINGIDCLASS_` varchar(255) default NULL,<br />   `NEWSTRINGIDVALUE_` varchar(255) default NULL,<br />   `OLDLONGVALUE_` bigint(20) default NULL,<br />   `OLDSTRINGVALUE_` mediumtext,<br />   `NEWSTRINGVALUE_` mediumtext,<br />   `TASKINSTANCE_` bigint(20) default NULL,<br />   `TASKACTORID_` varchar(255) default NULL,<br />   `TASKOLDACTORID_` varchar(255) default NULL,<br />   `SWIMLANEINSTANCE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `FK_LOG_SOURCENODE` (`SOURCENODE_`),<br />   KEY `FK_LOG_TOKEN` (`TOKEN_`),<br />   KEY `FK_LOG_OLDBYTES` (`OLDBYTEARRAY_`),<br />   KEY `FK_LOG_NEWBYTES` (`NEWBYTEARRAY_`),<br />   KEY `FK_LOG_CHILDTOKEN` (`CHILD_`),<br />   KEY `FK_LOG_DESTNODE` (`DESTINATIONNODE_`),<br />   KEY `FK_LOG_TASKINST` (`TASKINSTANCE_`),<br />   KEY `FK_LOG_SWIMINST` (`SWIMLANEINSTANCE_`),<br />   KEY `FK_LOG_PARENT` (`PARENT_`),<br />   KEY `FK_LOG_NODE` (`NODE_`),<br />   KEY `FK_LOG_ACTION` (`ACTION_`),<br />   KEY `FK_LOG_VARINST` (`VARIABLEINSTANCE_`),<br />   KEY `FK_LOG_TRANSITION` (`TRANSITION_`),<br />   CONSTRAINT `FK_LOG_TRANSITION` FOREIGN KEY (`TRANSITION_`) REFERENCES `jbpm_transition` (`ID_`),<br />   CONSTRAINT `FK_LOG_ACTION` FOREIGN KEY (`ACTION_`) REFERENCES `jbpm_action` (`ID_`),<br />   CONSTRAINT `FK_LOG_CHILDTOKEN` FOREIGN KEY (`CHILD_`) REFERENCES `jbpm_token` (`ID_`),<br />   CONSTRAINT `FK_LOG_DESTNODE` FOREIGN KEY (`DESTINATIONNODE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_LOG_NEWBYTES` FOREIGN KEY (`NEWBYTEARRAY_`) REFERENCES `jbpm_bytearray` (`ID_`),<br />   CONSTRAINT `FK_LOG_NODE` FOREIGN KEY (`NODE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_LOG_OLDBYTES` FOREIGN KEY (`OLDBYTEARRAY_`) REFERENCES `jbpm_bytearray` (`ID_`),<br />   CONSTRAINT `FK_LOG_PARENT` FOREIGN KEY (`PARENT_`) REFERENCES `jbpm_log` (`ID_`),<br />   CONSTRAINT `FK_LOG_SOURCENODE` FOREIGN KEY (`SOURCENODE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_LOG_SWIMINST` FOREIGN KEY (`SWIMLANEINSTANCE_`) REFERENCES `jbpm_swimlaneinstance` (`ID_`),<br />   CONSTRAINT `FK_LOG_TASKINST` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`),<br />   CONSTRAINT `FK_LOG_TOKEN` FOREIGN KEY (`TOKEN_`) REFERENCES `jbpm_token` (`ID_`),<br />   CONSTRAINT `FK_LOG_VARINST` FOREIGN KEY (`VARIABLEINSTANCE_`) REFERENCES `jbpm_variableinstance` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_moduledefinition` */</p> <p>DROP TABLE IF EXISTS `jbpm_moduledefinition`;</p> <p>CREATE TABLE `jbpm_moduledefinition` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `NAME_` mediumtext,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   `STARTTASK_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_MODDEF_PROCDF` (`PROCESSDEFINITION_`),<br />   KEY `FK_TSKDEF_START` (`STARTTASK_`),<br />   KEY `FK_MODDEF_PROCDEF` (`PROCESSDEFINITION_`),<br />   CONSTRAINT `FK_MODDEF_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`),<br />   CONSTRAINT `FK_TSKDEF_START` FOREIGN KEY (`STARTTASK_`) REFERENCES `jbpm_task` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_moduleinstance` */</p> <p>DROP TABLE IF EXISTS `jbpm_moduleinstance`;</p> <p>CREATE TABLE `jbpm_moduleinstance` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `VERSION_` int(11) NOT NULL,<br />   `PROCESSINSTANCE_` bigint(20) default NULL,<br />   `TASKMGMTDEFINITION_` bigint(20) default NULL,<br />   `NAME_` varchar(255) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_MODINST_PRINST` (`PROCESSINSTANCE_`),<br />   KEY `FK_TASKMGTINST_TMD` (`TASKMGMTDEFINITION_`),<br />   KEY `FK_MODINST_PRCINST` (`PROCESSINSTANCE_`),<br />   CONSTRAINT `FK_MODINST_PRCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`),<br />   CONSTRAINT `FK_TASKMGTINST_TMD` FOREIGN KEY (`TASKMGMTDEFINITION_`) REFERENCES `jbpm_moduledefinition` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_node` */</p> <p>DROP TABLE IF EXISTS `jbpm_node`;</p> <p>CREATE TABLE `jbpm_node` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `DESCRIPTION_` mediumtext,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   `ISASYNC_` integer(1) default NULL,<br />   `ISASYNCEXCL_` integer(1) default NULL,<br />   `ACTION_` bigint(20) default NULL,<br />   `SUPERSTATE_` bigint(20) default NULL,<br />   `SUBPROCNAME_` varchar(255) default NULL,<br />   `SUBPROCESSDEFINITION_` bigint(20) default NULL,<br />   `DECISIONEXPRESSION_` varchar(255) default NULL,<br />   `DECISIONDELEGATION` bigint(20) default NULL,<br />   `SCRIPT_` bigint(20) default NULL,<br />   `SIGNAL_` int(11) default NULL,<br />   `CREATETASKS_` integer(1) default NULL,<br />   `ENDTASKS_` integer(1) default NULL,<br />   `NODECOLLECTIONINDEX_` int(11) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_PSTATE_SBPRCDEF` (`SUBPROCESSDEFINITION_`),<br />   KEY `IDX_NODE_SUPRSTATE` (`SUPERSTATE_`),<br />   KEY `IDX_NODE_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `IDX_NODE_ACTION` (`ACTION_`),<br />   KEY `FK_PROCST_SBPRCDEF` (`SUBPROCESSDEFINITION_`),<br />   KEY `FK_NODE_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `FK_NODE_SCRIPT` (`SCRIPT_`),<br />   KEY `FK_NODE_ACTION` (`ACTION_`),<br />   KEY `FK_DECISION_DELEG` (`DECISIONDELEGATION`),<br />   KEY `FK_NODE_SUPERSTATE` (`SUPERSTATE_`),<br />   CONSTRAINT `FK_NODE_SUPERSTATE` FOREIGN KEY (`SUPERSTATE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_DECISION_DELEG` FOREIGN KEY (`DECISIONDELEGATION`) REFERENCES `jbpm_delegation` (`ID_`),<br />   CONSTRAINT `FK_NODE_ACTION` FOREIGN KEY (`ACTION_`) REFERENCES `jbpm_action` (`ID_`),<br />   CONSTRAINT `FK_NODE_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`),<br />   CONSTRAINT `FK_NODE_SCRIPT` FOREIGN KEY (`SCRIPT_`) REFERENCES `jbpm_action` (`ID_`),<br />   CONSTRAINT `FK_PROCST_SBPRCDEF` FOREIGN KEY (`SUBPROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_pooledactor` */</p> <p>DROP TABLE IF EXISTS `jbpm_pooledactor`;</p> <p>CREATE TABLE `jbpm_pooledactor` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `VERSION_` int(11) NOT NULL,<br />   `ACTORID_` varchar(255) default NULL,<br />   `SWIMLANEINSTANCE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_PLDACTR_ACTID` (`ACTORID_`),<br />   KEY `IDX_TSKINST_SWLANE` (`SWIMLANEINSTANCE_`),<br />   KEY `FK_POOLEDACTOR_SLI` (`SWIMLANEINSTANCE_`),<br />   CONSTRAINT `FK_POOLEDACTOR_SLI` FOREIGN KEY (`SWIMLANEINSTANCE_`) REFERENCES `jbpm_swimlaneinstance` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_processdefinition` */</p> <p>DROP TABLE IF EXISTS `jbpm_processdefinition`;</p> <p>CREATE TABLE `jbpm_processdefinition` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `DESCRIPTION_` mediumtext,<br />   `VERSION_` int(11) default NULL,<br />   `ISTERMINATIONIMPLICIT_` integer(1) default NULL,<br />   `STARTSTATE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_PROCDEF_STRTST` (`STARTSTATE_`),<br />   KEY `FK_PROCDEF_STRTSTA` (`STARTSTATE_`),<br />   CONSTRAINT `FK_PROCDEF_STRTSTA` FOREIGN KEY (`STARTSTATE_`) REFERENCES `jbpm_node` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_processinstance` */</p> <p>DROP TABLE IF EXISTS `jbpm_processinstance`;</p> <p>CREATE TABLE `jbpm_processinstance` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `VERSION_` int(11) NOT NULL,<br />   `KEY_` varchar(255) default NULL,<br />   `START_` datetime default NULL,<br />   `END_` datetime default NULL,<br />   `ISSUSPENDED_` integer(1) default NULL,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   `ROOTTOKEN_` bigint(20) default NULL,<br />   `SUPERPROCESSTOKEN_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   UNIQUE KEY `KEY_` (`KEY_`,`PROCESSDEFINITION_`),<br />   KEY `IDX_PROCIN_ROOTTK` (`ROOTTOKEN_`),<br />   KEY `IDX_PROCIN_SPROCTK` (`SUPERPROCESSTOKEN_`),<br />   KEY `IDX_PROCIN_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `FK_PROCIN_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `FK_PROCIN_ROOTTKN` (`ROOTTOKEN_`),<br />   KEY `FK_PROCIN_SPROCTKN` (`SUPERPROCESSTOKEN_`),<br />   CONSTRAINT `FK_PROCIN_SPROCTKN` FOREIGN KEY (`SUPERPROCESSTOKEN_`) REFERENCES `jbpm_token` (`ID_`),<br />   CONSTRAINT `FK_PROCIN_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`),<br />   CONSTRAINT `FK_PROCIN_ROOTTKN` FOREIGN KEY (`ROOTTOKEN_`) REFERENCES `jbpm_token` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_runtimeaction` */</p> <p>DROP TABLE IF EXISTS `jbpm_runtimeaction`;</p> <p>CREATE TABLE `jbpm_runtimeaction` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `VERSION_` int(11) NOT NULL,<br />   `EVENTTYPE_` varchar(255) default NULL,<br />   `TYPE_` char(1) default NULL,<br />   `GRAPHELEMENT_` bigint(20) default NULL,<br />   `PROCESSINSTANCE_` bigint(20) default NULL,<br />   `ACTION_` bigint(20) default NULL,<br />   `PROCESSINSTANCEINDEX_` int(11) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_RTACTN_PRCINST` (`PROCESSINSTANCE_`),<br />   KEY `IDX_RTACTN_ACTION` (`ACTION_`),<br />   KEY `FK_RTACTN_PROCINST` (`PROCESSINSTANCE_`),<br />   KEY `FK_RTACTN_ACTION` (`ACTION_`),<br />   CONSTRAINT `FK_RTACTN_ACTION` FOREIGN KEY (`ACTION_`) REFERENCES `jbpm_action` (`ID_`),<br />   CONSTRAINT `FK_RTACTN_PROCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_swimlane` */</p> <p>DROP TABLE IF EXISTS `jbpm_swimlane`;</p> <p>CREATE TABLE `jbpm_swimlane` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `NAME_` varchar(255) default NULL,<br />   `ACTORIDEXPRESSION_` varchar(255) default NULL,<br />   `POOLEDACTORSEXPRESSION_` varchar(255) default NULL,<br />   `ASSIGNMENTDELEGATION_` bigint(20) default NULL,<br />   `TASKMGMTDEFINITION_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `FK_SWL_ASSDEL` (`ASSIGNMENTDELEGATION_`),<br />   KEY `FK_SWL_TSKMGMTDEF` (`TASKMGMTDEFINITION_`),<br />   CONSTRAINT `FK_SWL_TSKMGMTDEF` FOREIGN KEY (`TASKMGMTDEFINITION_`) REFERENCES `jbpm_moduledefinition` (`ID_`),<br />   CONSTRAINT `FK_SWL_ASSDEL` FOREIGN KEY (`ASSIGNMENTDELEGATION_`) REFERENCES `jbpm_delegation` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_swimlaneinstance` */</p> <p>DROP TABLE IF EXISTS `jbpm_swimlaneinstance`;</p> <p>CREATE TABLE `jbpm_swimlaneinstance` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `VERSION_` int(11) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `ACTORID_` varchar(255) default NULL,<br />   `SWIMLANE_` bigint(20) default NULL,<br />   `TASKMGMTINSTANCE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_SWIMLINST_SL` (`SWIMLANE_`),<br />   KEY `FK_SWIMLANEINST_TM` (`TASKMGMTINSTANCE_`),<br />   KEY `FK_SWIMLANEINST_SL` (`SWIMLANE_`),<br />   CONSTRAINT `FK_SWIMLANEINST_SL` FOREIGN KEY (`SWIMLANE_`) REFERENCES `jbpm_swimlane` (`ID_`),<br />   CONSTRAINT `FK_SWIMLANEINST_TM` FOREIGN KEY (`TASKMGMTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_task` */</p> <p>DROP TABLE IF EXISTS `jbpm_task`;</p> <p>CREATE TABLE `jbpm_task` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `NAME_` varchar(255) default NULL,<br />   `DESCRIPTION_` mediumtext,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   `ISBLOCKING_` integer(1) default NULL,<br />   `ISSIGNALLING_` integer(1) default NULL,<br />   `CONDITION_` varchar(255) default NULL,<br />   `DUEDATE_` varchar(255) default NULL,<br />   `PRIORITY_` int(11) default NULL,<br />   `ACTORIDEXPRESSION_` varchar(255) default NULL,<br />   `POOLEDACTORSEXPRESSION_` varchar(255) default NULL,<br />   `TASKMGMTDEFINITION_` bigint(20) default NULL,<br />   `TASKNODE_` bigint(20) default NULL,<br />   `STARTSTATE_` bigint(20) default NULL,<br />   `ASSIGNMENTDELEGATION_` bigint(20) default NULL,<br />   `SWIMLANE_` bigint(20) default NULL,<br />   `TASKCONTROLLER_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_TASK_TSKNODE` (`TASKNODE_`),<br />   KEY `IDX_TASK_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `IDX_TASK_TASKMGTDF` (`TASKMGMTDEFINITION_`),<br />   KEY `FK_TSK_TSKCTRL` (`TASKCONTROLLER_`),<br />   KEY `FK_TASK_ASSDEL` (`ASSIGNMENTDELEGATION_`),<br />   KEY `FK_TASK_TASKNODE` (`TASKNODE_`),<br />   KEY `FK_TASK_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `FK_TASK_STARTST` (`STARTSTATE_`),<br />   KEY `FK_TASK_TASKMGTDEF` (`TASKMGMTDEFINITION_`),<br />   KEY `FK_TASK_SWIMLANE` (`SWIMLANE_`),<br />   CONSTRAINT `FK_TASK_SWIMLANE` FOREIGN KEY (`SWIMLANE_`) REFERENCES `jbpm_swimlane` (`ID_`),<br />   CONSTRAINT `FK_TASK_ASSDEL` FOREIGN KEY (`ASSIGNMENTDELEGATION_`) REFERENCES `jbpm_delegation` (`ID_`),<br />   CONSTRAINT `FK_TASK_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`),<br />   CONSTRAINT `FK_TASK_STARTST` FOREIGN KEY (`STARTSTATE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_TASK_TASKMGTDEF` FOREIGN KEY (`TASKMGMTDEFINITION_`) REFERENCES `jbpm_moduledefinition` (`ID_`),<br />   CONSTRAINT `FK_TASK_TASKNODE` FOREIGN KEY (`TASKNODE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_TSK_TSKCTRL` FOREIGN KEY (`TASKCONTROLLER_`) REFERENCES `jbpm_taskcontroller` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_taskactorpool` */</p> <p>DROP TABLE IF EXISTS `jbpm_taskactorpool`;</p> <p>CREATE TABLE `jbpm_taskactorpool` (<br />   `TASKINSTANCE_` bigint(20) NOT NULL,<br />   `POOLEDACTOR_` bigint(20) NOT NULL,<br />   PRIMARY KEY  (`TASKINSTANCE_`,`POOLEDACTOR_`),<br />   KEY `FK_TSKACTPOL_PLACT` (`POOLEDACTOR_`),<br />   KEY `FK_TASKACTPL_TSKI` (`TASKINSTANCE_`),<br />   CONSTRAINT `FK_TASKACTPL_TSKI` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`),<br />   CONSTRAINT `FK_TSKACTPOL_PLACT` FOREIGN KEY (`POOLEDACTOR_`) REFERENCES `jbpm_pooledactor` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_taskcontroller` */</p> <p>DROP TABLE IF EXISTS `jbpm_taskcontroller`;</p> <p>CREATE TABLE `jbpm_taskcontroller` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `TASKCONTROLLERDELEGATION_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `FK_TSKCTRL_DELEG` (`TASKCONTROLLERDELEGATION_`),<br />   CONSTRAINT `FK_TSKCTRL_DELEG` FOREIGN KEY (`TASKCONTROLLERDELEGATION_`) REFERENCES `jbpm_delegation` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_taskinstance` */</p> <p>DROP TABLE IF EXISTS `jbpm_taskinstance`;</p> <p>CREATE TABLE `jbpm_taskinstance` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `VERSION_` int(11) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `DESCRIPTION_` mediumtext,<br />   `ACTORID_` varchar(255) default NULL,<br />   `CREATE_` datetime default NULL,<br />   `START_` datetime default NULL,<br />   `END_` datetime default NULL,<br />   `DUEDATE_` datetime default NULL,<br />   `PRIORITY_` int(11) default NULL,<br />   `ISCANCELLED_` integer(1) default NULL,<br />   `ISSUSPENDED_` integer(1) default NULL,<br />   `ISOPEN_` integer(1) default NULL,<br />   `ISSIGNALLING_` integer(1) default NULL,<br />   `ISBLOCKING_` integer(1) default NULL,<br />   `TASK_` bigint(20) default NULL,<br />   `TOKEN_` bigint(20) default NULL,<br />   `PROCINST_` bigint(20) default NULL,<br />   `SWIMLANINSTANCE_` bigint(20) default NULL,<br />   `TASKMGMTINSTANCE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_TASKINST_TOKN` (`TOKEN_`),<br />   KEY `IDX_TASKINST_TSK` (`TASK_`,`PROCINST_`),<br />   KEY `IDX_TSKINST_TMINST` (`TASKMGMTINSTANCE_`),<br />   KEY `IDX_TSKINST_SLINST` (`SWIMLANINSTANCE_`),<br />   KEY `IDX_TASK_ACTORID` (`ACTORID_`),<br />   KEY `FK_TSKINS_PRCINS` (`PROCINST_`),<br />   KEY `FK_TASKINST_TMINST` (`TASKMGMTINSTANCE_`),<br />   KEY `FK_TASKINST_TOKEN` (`TOKEN_`),<br />   KEY `FK_TASKINST_SLINST` (`SWIMLANINSTANCE_`),<br />   KEY `FK_TASKINST_TASK` (`TASK_`),<br />   CONSTRAINT `FK_TASKINST_TASK` FOREIGN KEY (`TASK_`) REFERENCES `jbpm_task` (`ID_`),<br />   CONSTRAINT `FK_TASKINST_SLINST` FOREIGN KEY (`SWIMLANINSTANCE_`) REFERENCES `jbpm_swimlaneinstance` (`ID_`),<br />   CONSTRAINT `FK_TASKINST_TMINST` FOREIGN KEY (`TASKMGMTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`),<br />   CONSTRAINT `FK_TASKINST_TOKEN` FOREIGN KEY (`TOKEN_`) REFERENCES `jbpm_token` (`ID_`),<br />   CONSTRAINT `FK_TSKINS_PRCINS` FOREIGN KEY (`PROCINST_`) REFERENCES `jbpm_processinstance` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_token` */</p> <p>DROP TABLE IF EXISTS `jbpm_token`;</p> <p>CREATE TABLE `jbpm_token` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `VERSION_` int(11) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `START_` datetime default NULL,<br />   `END_` datetime default NULL,<br />   `NODEENTER_` datetime default NULL,<br />   `NEXTLOGINDEX_` int(11) default NULL,<br />   `ISABLETOREACTIVATEPARENT_` integer(1) default NULL,<br />   `ISTERMINATIONIMPLICIT_` integer(1) default NULL,<br />   `ISSUSPENDED_` integer(1) default NULL,<br />   `LOCK_` varchar(255) default NULL,<br />   `NODE_` bigint(20) default NULL,<br />   `PROCESSINSTANCE_` bigint(20) default NULL,<br />   `PARENT_` bigint(20) default NULL,<br />   `SUBPROCESSINSTANCE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_TOKEN_PROCIN` (`PROCESSINSTANCE_`),<br />   KEY `IDX_TOKEN_SUBPI` (`SUBPROCESSINSTANCE_`),<br />   KEY `IDX_TOKEN_NODE` (`NODE_`),<br />   KEY `IDX_TOKEN_PARENT` (`PARENT_`),<br />   KEY `FK_TOKEN_PARENT` (`PARENT_`),<br />   KEY `FK_TOKEN_NODE` (`NODE_`),<br />   KEY `FK_TOKEN_PROCINST` (`PROCESSINSTANCE_`),<br />   KEY `FK_TOKEN_SUBPI` (`SUBPROCESSINSTANCE_`),<br />   CONSTRAINT `FK_TOKEN_SUBPI` FOREIGN KEY (`SUBPROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`),<br />   CONSTRAINT `FK_TOKEN_NODE` FOREIGN KEY (`NODE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_TOKEN_PARENT` FOREIGN KEY (`PARENT_`) REFERENCES `jbpm_token` (`ID_`),<br />   CONSTRAINT `FK_TOKEN_PROCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_tokenvariablemap` */</p> <p>DROP TABLE IF EXISTS `jbpm_tokenvariablemap`;</p> <p>CREATE TABLE `jbpm_tokenvariablemap` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `VERSION_` int(11) NOT NULL,<br />   `TOKEN_` bigint(20) default NULL,<br />   `CONTEXTINSTANCE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_TKVARMAP_CTXT` (`CONTEXTINSTANCE_`),<br />   KEY `IDX_TKVVARMP_TOKEN` (`TOKEN_`),<br />   KEY `FK_TKVARMAP_CTXT` (`CONTEXTINSTANCE_`),<br />   KEY `FK_TKVARMAP_TOKEN` (`TOKEN_`),<br />   CONSTRAINT `FK_TKVARMAP_TOKEN` FOREIGN KEY (`TOKEN_`) REFERENCES `jbpm_token` (`ID_`),<br />   CONSTRAINT `FK_TKVARMAP_CTXT` FOREIGN KEY (`CONTEXTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_transition` */</p> <p>DROP TABLE IF EXISTS `jbpm_transition`;</p> <p>CREATE TABLE `jbpm_transition` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `NAME_` varchar(255) default NULL,<br />   `DESCRIPTION_` mediumtext,<br />   `PROCESSDEFINITION_` bigint(20) default NULL,<br />   `FROM_` bigint(20) default NULL,<br />   `TO_` bigint(20) default NULL,<br />   `CONDITION_` varchar(255) default NULL,<br />   `FROMINDEX_` int(11) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_TRANSIT_TO` (`TO_`),<br />   KEY `IDX_TRANSIT_FROM` (`FROM_`),<br />   KEY `IDX_TRANS_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `FK_TRANSITION_TO` (`TO_`),<br />   KEY `FK_TRANS_PROCDEF` (`PROCESSDEFINITION_`),<br />   KEY `FK_TRANSITION_FROM` (`FROM_`),<br />   CONSTRAINT `FK_TRANSITION_FROM` FOREIGN KEY (`FROM_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_TRANSITION_TO` FOREIGN KEY (`TO_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_TRANS_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`) REFERENCES `jbpm_processdefinition` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_variableaccess` */</p> <p>DROP TABLE IF EXISTS `jbpm_variableaccess`;</p> <p>CREATE TABLE `jbpm_variableaccess` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `VARIABLENAME_` varchar(255) default NULL,<br />   `ACCESS_` varchar(255) default NULL,<br />   `MAPPEDNAME_` varchar(255) default NULL,<br />   `PROCESSSTATE_` bigint(20) default NULL,<br />   `TASKCONTROLLER_` bigint(20) default NULL,<br />   `INDEX_` int(11) default NULL,<br />   `SCRIPT_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `FK_VARACC_TSKCTRL` (`TASKCONTROLLER_`),<br />   KEY `FK_VARACC_SCRIPT` (`SCRIPT_`),<br />   KEY `FK_VARACC_PROCST` (`PROCESSSTATE_`),<br />   CONSTRAINT `FK_VARACC_PROCST` FOREIGN KEY (`PROCESSSTATE_`) REFERENCES `jbpm_node` (`ID_`),<br />   CONSTRAINT `FK_VARACC_SCRIPT` FOREIGN KEY (`SCRIPT_`) REFERENCES `jbpm_action` (`ID_`),<br />   CONSTRAINT `FK_VARACC_TSKCTRL` FOREIGN KEY (`TASKCONTROLLER_`) REFERENCES `jbpm_taskcontroller` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>/*Table structure for table `jbpm_variableinstance` */</p> <p>DROP TABLE IF EXISTS `jbpm_variableinstance`;</p> <p>CREATE TABLE `jbpm_variableinstance` (<br />   `ID_` bigint(20) NOT NULL auto_increment,<br />   `CLASS_` char(1) NOT NULL,<br />   `VERSION_` int(11) NOT NULL,<br />   `NAME_` varchar(255) default NULL,<br />   `CONVERTER_` char(1) default NULL,<br />   `TOKEN_` bigint(20) default NULL,<br />   `TOKENVARIABLEMAP_` bigint(20) default NULL,<br />   `PROCESSINSTANCE_` bigint(20) default NULL,<br />   `BYTEARRAYVALUE_` bigint(20) default NULL,<br />   `DATEVALUE_` datetime default NULL,<br />   `DOUBLEVALUE_` double default NULL,<br />   `LONGIDCLASS_` varchar(255) default NULL,<br />   `LONGVALUE_` bigint(20) default NULL,<br />   `STRINGIDCLASS_` varchar(255) default NULL,<br />   `STRINGVALUE_` varchar(255) default NULL,<br />   `TASKINSTANCE_` bigint(20) default NULL,<br />   PRIMARY KEY  (`ID_`),<br />   KEY `IDX_VARINST_TKVARMP` (`TOKENVARIABLEMAP_`),<br />   KEY `IDX_VARINST_PRCINS` (`PROCESSINSTANCE_`),<br />   KEY `IDX_VARINST_TK` (`TOKEN_`),<br />   KEY `FK_VARINST_TK` (`TOKEN_`),<br />   KEY `FK_VARINST_TKVARMP` (`TOKENVARIABLEMAP_`),<br />   KEY `FK_VARINST_PRCINST` (`PROCESSINSTANCE_`),<br />   KEY `FK_VAR_TSKINST` (`TASKINSTANCE_`),<br />   KEY `FK_BYTEINST_ARRAY` (`BYTEARRAYVALUE_`),<br />   CONSTRAINT `FK_BYTEINST_ARRAY` FOREIGN KEY (`BYTEARRAYVALUE_`) REFERENCES `jbpm_bytearray` (`ID_`),<br />   CONSTRAINT `FK_VARINST_PRCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`),<br />   CONSTRAINT `FK_VARINST_TK` FOREIGN KEY (`TOKEN_`) REFERENCES `jbpm_token` (`ID_`),<br />   CONSTRAINT `FK_VARINST_TKVARMP` FOREIGN KEY (`TOKENVARIABLEMAP_`) REFERENCES `jbpm_tokenvariablemap` (`ID_`),<br />   CONSTRAINT `FK_VAR_TSKINST` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk;</p> <p>SET FOREIGN_KEY_CHECKS=1;<br /> </p> <img src ="http://www.aygfsteel.com/libin2722/aggbug/143256.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/libin2722/" target="_blank">C物</a> 2007-09-06 18:40 <a href="http://www.aygfsteel.com/libin2722/articles/143256.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBPM数据库表说明http://www.aygfsteel.com/libin2722/articles/143249.htmlC物C物Thu, 06 Sep 2007 10:13:00 GMThttp://www.aygfsteel.com/libin2722/articles/143249.htmlhttp://www.aygfsteel.com/libin2722/comments/143249.htmlhttp://www.aygfsteel.com/libin2722/articles/143249.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143249.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143249.html阅读全文

C物 2007-09-06 18:13 发表评论
]]>
一个JBPM工作管理示?/title><link>http://www.aygfsteel.com/libin2722/articles/143250.html</link><dc:creator>C物</dc:creator><author>C物</author><pubDate>Thu, 06 Sep 2007 10:13:00 GMT</pubDate><guid>http://www.aygfsteel.com/libin2722/articles/143250.html</guid><wfw:comment>http://www.aygfsteel.com/libin2722/comments/143250.html</wfw:comment><comments>http://www.aygfsteel.com/libin2722/articles/143250.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/libin2722/comments/commentRss/143250.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/libin2722/services/trackbacks/143250.html</trackback:ping><description><![CDATA[  <p style="margin-bottom: 12pt"><strong><span style="font-weight: normal; font-size: 9pt; color: black; font-family: 宋体">一个JBPM工作管理示?/span></strong></p> <p><span style="color: black; font-family: 宋体">一个JBPM工作管理示?</span></p> <p><span style="font-size: 10pt; color: black; font-family: 宋体">CZQ?br /> 在某一公司中,部门员工要休假的话需要部门主的批准。如果休假天数大?0天的话,在部门主的同意后,q必MU主批准。如果是部门ȝ要休假只要上U主批准即可。在休假被批准之前,甌人可以撤销休假甌?br /> 每个员工q有多少天休假必ȝ理v来,在员工提交休假申h要检查申请天数是否超q可用天数。申h准后Q要在可用天数里减去甌天数。每ơ休假申L束之后,不管通过未通过或是否取消,都必记录下来。主在批复甌之后Q系l要批复结果Emaill申请h。对于大?0天的甌Q如果部门主已批准同意而上U主还未批准,q时甌人撤销甌后,pȝ应发Email通知部门ȝ甌已撤销?nbsp;<br />   processdefinition.xml如下Q?br /> <?xml version="1.0" encoding="UTF-8"?><br /> <!-- edited with XMLSPY v2004 rel. 3 U (<a ><span style="color: black">http://www.xmlspy.com</a>) by keller (zju) --><br /> <!DOCTYPE process-definition PUBLIC<br />     "-//jBpm/jBpm Mapping DTD 2.0//EN"<br />     "<a ><span style="color: black">http://jbpm.org/dtd/processdefinition-2.0.dtd</span></a>"><br /> <process-definition  name="RequestLeave"><br />  <swimlane name="requester"><br />   <description></span>甌?lt;/description><br />  </swimlane><br />  <swimlane name="chief"><br />   <description>部门ȝ</description><br />   <delegation class="kellerdu.jbpm.delegation.ChiefSwimlane"/><br />  </swimlane><br />  <swimlane name="boss"><br />   <description>上ȝ</description><br />   <delegation class="kellerdu.jbpm.delegation.BossSwimlane"/><br />  </swimlane><br />  <start-state name="request" swimlane="requester"><br />   <transition to="BeginRequest"/><br />  </start-state><br />  <fork name="BeginRequest"><br />   <transition to="RequesterCancel"/><br />   <transition to="IsChief"/><br />  </fork><br />  <decision name="IsChief"><br />   <delegation class="kellerdu.jbpm.delegation.ChiefDecision"/><br />   <transition name="BossApprove"  to="BossApprove"/><br />   <transition name="ChiefApprove"  to="ChiefApprove"/><br />  </decision><br />  <state name="RequesterCancel"><br />   <assignment swimlane="requester"/><br />   <transition name="cancel" to="Decided"><br />    <action><br />     <!-- 请假的状态改变ؓ“取消”--><br />     <delegation class="kellerdu.jbpm.action.RequestCancel"/><br />    </action><br />   </transition><br />  </state><br />  <state name="ChiefApprove"><br />   <assignment swimlane="chief"/><br />   <transition name="approve" to="NeedBossApprove"><br />    <action><br />     <!-- 请假的状态改变ؓ“ȝ批准”--><br />     <delegation class="kellerdu.jbpm.action.ChiefApprove"/><br />    </action><br />   </transition><br />   <transition name="disapprove" to="Decided"><br />    <action><br />     <!-- 请假的状态改变ؓ“ȝ否决”--><br />     <delegation class="kellerdu.jbpm.action.ChiefDisapprove"/><br />    </action><br />   </transition><br />  </state><br />  <state name="BossApprove"><br />   <assignment swimlane="boss"/><br />   <transition name="approve" to="Decided"><br />    <action><br />     <!-- 请假的状态改变ؓ“老板批准”--><br />     <delegation class="kellerdu.jbpm.action.BossApprove"/><br />    </action><br />   </transition><br />   <transition name="disapprove" to="Decided"><br />    <action><br />     <!-- 请假的状态改变ؓ“老板否决”--><br />     <delegation class="kellerdu.jbpm.action.BossDisapprove"/><br />    </action><br />   </transition><br />  </state><br />  <decision name="NeedBossApprove"><br />   <!-- 请假天数大于10天的要老板批准  --><br />   <delegation class="kellerdu.jbpm.delegation.NeedBossApproveDecision"/><br />   <transition name="need" to="BossApprove"/><br />   <transition name="notNeed" to="Decided"/><br />  </decision><br />  <join name="Decided"><br />   <description>有一个先到达卌行父Token</description><br />   <delegation class="kellerdu.jbpm.delegation.DecidedJoin"/><br />   <transition to="DoSomething"/><br />  </join><br />  <decision name="DoSomething"><br />   <description><br />     Ҏh的状态决定?br />     Q?Q?#8220;ȝ或者老板批准”Q?#8216;approve’Q修改员工休假的d敎ͼ讑֮发给用户E-Mail的信息?br />     Q?Q?#8220;ȝ或者老板否决”-“disapprove”Q设定发l用户EQMail的信息?br />     Q?Q?#8220;撤销”-"cancel"Q设定发l用户EQMail的信息。如果主批准,要发l主消息说明已l撤销?br />     </description><br />   <delegation class="kellerdu.jbpm.delegation.DoSomethingDecision"/><br />   <transition name="disapprove" to="Finished"><br />    <action><br />     <delegation class="kellerdu.jbpm.action.Disapprove"/><br />    </action><br />   </transition><br />   <transition name="approve" to="Finished"><br />    <action><br />     <delegation class="kellerdu.jbpm.action.Approve"/><br />    </action><br />   </transition><br />   <transition name="cancel" to="Finished"><br />    <action><br />     <delegation class="kellerdu.jbpm.action.Cancel"/><br />    </action><br />   </transition><br />  </decision><br />  <end-state name="Finished"/><br />  <action event-type="process-end"><br />   <!-- 发送EQMail消息l申误,记录请假日志 --><br />   <delegation class="kellerdu.jbpm.action.ProcessEndAction"/><br />  </action><br /> </process-definition> </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">Action</span><span style="font-size: 10pt; color: black">指明的是当前状态要执行的一些额外的操作Q如记录log、发邮g{?br /> Q?QSwimline的delegation要做的就是判别当前Actor的n份?br /> package kellerdu.jbpm.delegation; </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">import org.jbpm.delegation.*;<br /> import kellerdu.jbpm.LogsFactory;<br /> import org.apache.commons.logging.Log; </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">public class BossSwimlane implements AssignmentHandler {<br />     public BossSwimlane() {<br />     } </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">    /**<br />      * </span><span style="font-size: 10pt; color: black">当前的状态有哪个actor来具体负责处理,选择是老板的actor来处理?br />      *<br />      * 如果王林是老板Q那么他请假可以用他的名U来开始一个请假流E,当他查他需要批C的<br />      * 请假Ӟ使用actorId=boss来找出所有的批示。这时selectActorq回的值就是一个常?#8220;boss”<br />      *<br />      *<br />      * @param assignmentContext AssignmentContext<br />      * @return String<br />      * @todo Implement this org.jbpm.delegation.AssignmentHandler method<br />      */<br />     public String selectActor(AssignmentContext assignmentContext) {<br />         Log log = LogsFactory.getLogInstance(this.getClass());<br />         log.info("d分配l老板");<br />         return "boss";<br />     }<br /> }<br /> Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=<br /> ackage kellerdu.jbpm.delegation; </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">import org.jbpm.delegation.*;<br /> import kellerdu.jbpm.LogsFactory;<br /> import org.apache.commons.logging.Log; </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">public class ChiefSwimlane implements AssignmentHandler {<br />     public ChiefSwimlane() {<br />     } </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">    /**<br />      * selectActor<br />      * @see BossSwimlane<br />      *<br />      * @param assignmentContext AssignmentContext<br />      * @return String<br />      * @todo Implement this org.jbpm.delegation.AssignmentHandler method<br />      */<br />     public String selectActor(AssignmentContext assignmentContext) {<br />        Log log = LogsFactory.getLogInstance(this.getClass());<br />         log.info("</span><span style="font-size: 10pt; color: black">d分配l上U主?);<br />        return "chief";<br />     }<br /> } </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">Q二QDecision<br /> package kellerdu.jbpm.delegation; </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">import org.jbpm.delegation.*;<br /> import kellerdu.jbpm.LogsFactory;<br /> import org.apache.commons.logging.Log;<br /> import kellerdu.jbpm.Constants; </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">public class ChiefDecision implements DecisionHandler {<br />     public ChiefDecision() {<br />     } </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">    /**<br />      * </span><span style="font-size: 10pt; color: black">判断是否需要主批准,军_下一个要q行的transition<br />      *<br />      * @param executionContext ExecutionContext<br />      * @return String<br />      * @todo Implement this org.jbpm.delegation.DecisionHandler method<br />      */<br />     public String decide(ExecutionContext executionContext) {<br />         Log log=LogsFactory.getLogInstance(this.getClass());<br />         String ac=(String)executionContext.getVariable(Constants.USER_NAME);<br />         if(ac!=null&&(ac.equals("dali")||ac.equals("wang"))){<br />             log.info(ac+"需要老板批准Q?);<br />             return "BossApprove";<br />         }else{<br />             log.info(ac+"需要先l主批?);<br />             return "ChiefApprove";<br />         }<br />     }<br /> }<br /> Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q=Q?br /> Q三Qfork<br /> package kellerdu.jbpm.delegation; </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">import org.jbpm.*;<br /> import org.jbpm.delegation.*;<br /> import org.jbpm.model.execution.*;<br /> import java.util.*; </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">public class DecidedJoin implements JoinHandler {<br />     public DecidedJoin() {<br />     } </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">    /**<br />      * fork</span><span style="font-size: 10pt; color: black">Q只要一个分支到达,卛_q行下一步操作,同时取消其它同时q行的分支?br />      * q里是用户如果取消Q请假就取消。如果用戯假批准,则用户不能取消?br />      *<br />      * @param forkContext ForkContext<br />      * @throws ExecutionException<br />      * @todo Implement this org.jbpm.delegation.ForkHandler method<br />      */<br />     public void join(JoinContext joinContext) throws ExecutionException {<br />         Iterator it=joinContext.getConcurrentTokens().values().iterator();<br />         Token arrivingToken = joinContext.getToken();<br />         while(it.hasNext()){<br />             Token to=(Token)it.next();<br />             if(to.getId().equals(arrivingToken.getId())){<br />                 //取消其它执行的Token<br />                 joinContext.getExecutionService().cancelToken(to.getId());<br />             }<br />         }<br />          // reactivate the parent token.<br />           joinContext.reactivateToken( arrivingToken.getParent() );<br />     }<br /> } </span></p> <p style="text-justify: inter-ideograph; text-align: justify"><span style="font-size: 10pt; color: black">Q一Q?nbsp;开始一个请假流E?br />        //user是请假h的actorId<br />        ExecutionService es=JbpmServiceFactory.getInstance().openExecutionService(user);<br />         HashMap vs=new HashMap();<br />        //一些参?br />         vs.put(Constants.REQUEST_STATUS,String.valueOf(0));<br />         vs.put(Constants.REQUEST_RETURN_INFO,"No info!");<br />         vs.put(Constants.USER_NAME,EncodeTransfer.toISO(user));<br />         vs.put(Constants.REQUEST_DAYS,String.valueOf(rea.getDays()));<br />         try {<br />            //开启请假流E?br />             es.startProcessInstance(Constants.WORK_NAME, vs);<br />             log.info("["+user+"]"+"甌假期开始!请假"+rea.getDays()+"天!");<br />             return am.findForward("main");<br />         } catch (ExecutionException ex) {<br />             ex.printStackTrace();<br />             log.error("请假q程无法开始!");<br />             return am.findForward("error");<br />         }finally{<br />             es.close();<br />         }<br /> Q二Q当前执行Q?br />     对于部门l理或者老板Q找到要处理的请假?br />        String actorId = (String) req.getSession().getAttribute(Constants.USER);<br />             if(actorId.equals("wang")){<br />                 actorId="boss";<br />             }else if(actorId.equals("bigli")){<br />                 actorId="chief";<br />             }<br />             // get the execution service<br />             ExecutionService executionService = JbpmServiceFactory.getInstance().<br />                                                 openExecutionService(actorId); </span></p> <p><span style="font-size: 10pt; color: black; font-family: 宋体">            // get the tasklist from jbpm for user<br />             List tasks = new ArrayList();<br />             // add the jbpm tasks<br />             tasks.addAll(executionService.getTaskList(actorId));<br />             // put the tasklist into the form<br />             mf.setTasks(tasks);<br />             // get the tasklist from jbpm for user<br />             List definitions = new ArrayList();<br />             // add the jbpm definitions<br />             definitions.addAll(executionService.getLatestDefinitions());<br />             // put the tasklist into the form<br />             mf.setRequests(definitions);<br />             // close the execution service<br />             executionService.close();<br />             req.getSession().setAttribute("mainForm",mf);<br />             log.debug("</span><span style="font-size: 10pt; color: black; font-family: 宋体">d: " + tasks);<br />             log.debug("当前可以执行的请? " + definitions);<br /> Q三Q处理请?br />            String actorId = (String) reqrest.getSession().getAttribute(Constants.<br />                     USER);<br />             Long tokenId=new Long(req.getParameter("tokenId"));<br />             // get the execution service<br />             ExecutionService executionService = JbpmServiceFactory.getInstance().<br />                                                 openExecutionService(actorId);<br />             Map hm=executionService.getVariables(tokenId);//变量<br />             String act=req.getParameter("action");//q行转换的transition<br />             executionService.endOfState(tokenId,hm,act);<br />             executionService.close();</span></p> v <img src ="http://www.aygfsteel.com/libin2722/aggbug/143250.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/libin2722/" target="_blank">C物</a> 2007-09-06 18:13 <a href="http://www.aygfsteel.com/libin2722/articles/143250.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBPM的一些资?/title><link>http://www.aygfsteel.com/libin2722/articles/143248.html</link><dc:creator>C物</dc:creator><author>C物</author><pubDate>Thu, 06 Sep 2007 10:11:00 GMT</pubDate><guid>http://www.aygfsteel.com/libin2722/articles/143248.html</guid><wfw:comment>http://www.aygfsteel.com/libin2722/comments/143248.html</wfw:comment><comments>http://www.aygfsteel.com/libin2722/articles/143248.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/libin2722/comments/commentRss/143248.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/libin2722/services/trackbacks/143248.html</trackback:ping><description><![CDATA[<p>标题QJBPM的一些资?br /> 出处Q汐忆时I:QCHIRSQ:蝶衣人生<br /> 旉QTue, 20 Jun 2006 09:53:24 +0000<br /> 作者:chirs@zhoujin.com<br /> 地址Qwww.zhoujin.com/read.php/18.htm</p> <p>内容Q?br /> jPDL的流E定义元?<br /> W一层:GraphElement </p> <p>q个Ҏ理解,因ؓ在画程定义?每个拖拉的对象都是一个graph的元? </p> <p>GraphElement有四个属?1)processDefine 表示当前元素属于哪个程定义 </p> <p>2)events 表示可以接收哪些event </p> <p>3)name 名字 </p> <p>4)exceptionHandlers 异常处理c集?List) </p> <p>W二层:node;processDefinition;Transition;Task 它们都inherited from GraphElement </p> <p>1)processDefinition表示程定义(implements NodeCollection),它有下面的属?name,version,nodes,startState nodes表示程中所有的node,startState用于启动程时找到首节点 </p> <p>2)Transition表示转移,它有三个属?from(Node),to(Node),supportedEventTypes表示支持的eventcd </p> <p>3)node表示节点,它有四个属?leaving transitions;arriving transitions;action;superState </p> <p>4)Task 定义d </p> <p>W三层:各种不同的node,它们都inherited from node decision;EndState;Fork;Join;Merge;Milestone; InterleaveEnd;InterleaveStart;ProcessState;State q些都是见名知义,和xpdl差不? <br /> jbpm的Token <br /> jbpm中最重要的概?应该是o?Token)和信?Signal) </p> <p>在整个流E实例运行过E中,我们可以q速的利用token得到其当前的current state。在解决“q行”{(比如ForkQ问题时QjBpm让Token对象l护了父子关p,q种关系在涉及到Fork的时候会产生?jBpm让Tokenq个对象w兼了多U命:Q?Q快速定位current state Q?Q用于fork,join法 Q?Q用于告知Q务执行者的d索引?</p> <p>如下代码: </p> <p>//pd是process definition,pi是process instance ProcessInstance </p> <p>pi = new ProcessInstance( pd ); </p> <p>//得到根o?</p> <p>Token token = pi.getRootToken(); </p> <p>//发信?</p> <p>token.signal(); </p> <p>Token的signalҎ也可以传入transition参数,q个Ҏ把信令发送给Token,q样,令牌被Ȁz?q沿指定的transitiond当前的状?如果没有指定transition,沿~省的transition d当前状?. </p> <p>jbpm是怎么实现的呢?其实很简? </p> <p>1)Token记录了当前的状态(current stateQ?只有当前的状?或称节点)拥有该o?</p> <p>2)向TOKEN发signal?当前状态收到该signal </p> <p>3)当前状态把令牌传给signal中指定的transition </p> <p>4)transition收到令牌?不强?马上把o牌传l下个状? </p> <p>5)Ҏ令牌的位|?程的状态已l发生改? </p> <p><br /> 1、process definition <br /> 一个process definition代表了一个正式的业务程Q它以一个流E图为基。这个流E图?许多node和transitionl成。每个node在这个流E图里都有着各自Ҏ的类型,q些不同的类型决定了node在运行时的不同行为。一个process definition只有一个start state ?<br /> 2、token <br /> 一个token代表了一条执行\径,它包含了q条执行路径的当前的执行状态(current stateQ?<br /> 3、process instance <br /> 一个process instanceQ流E实例)即一个process definitionQ流E定义)的流E执行实例。一个process definition可以对应多个process instance。当一个process instance被创建的时候,一个主执行路径token同时被创建,q个token叫做root tokenQ它指向程定义的start stateQprocessDefinition.getStartState()==token.getNode()Q?<br /> 4、signal <br /> 一个signal 发送给token通知token l箋程的执行。如果signal 没有指定transitionQtoken沿~省的transitiond当前状?如果signal 指定transitionQtoken沿指定的transitiond当前的状态。看源代码可以看到发lprocess instance的signal 其实都是发送给了root token?<br /> 5、Actions <br /> jbpm提供了灵zȝaction Q当程执行Qtoken q入node和transitionӞ会触发相应的一些eventQ事Ӟ。在q些event上附上我们自己写的actionQ就会带动action 的执行。action里是我们自己的相关java操作代码Q非常方ѝ注意的是eventQ事Ӟ是内|的Q无法扩展。另外,action也可以直接挂在node上,而不依赖于eventQ事Ӟ的触发,q个很重要! <br /> Node </p> <p><br /> 一个流E图p多node和transitionl成。每个node都有一U类型,q个cd军_了当程执行到这个node时的不同行ؓ。jbpm有一lnode type可以供你选择Q当然你可以定制自己node ?<br /> node的作?<br /> node有两个主要的作用Q?<br /> 1Q执行java代码Q比如说创徏task instanceQQ务实例)、发出通知、更新数据库{等。很典型的就是在node 上挂上我们的action <br /> 2) 控制程的执行: <br /> A、等待状?<br /> 程q入到这个node时将处于{待状态,直到一个signal 的发?<br /> B、流E将沿着一个leaving transition过q个node <br /> q种情况Ҏ一点,需要有个action挂在q个node上(注意q个action不是event触发的!Q,action中将会调用到API?<br /> executionContext.leaveNode(String transitionName)QtransitionName卌里的leaving transition名字?<br /> C、创建新的执行\?<br /> 很典型的是fork node。流E在q里会分叉,产生新的执行路径。这样就创徏了新的tokenQ每个新的token代表一个新的执行\径。注意的是,q些新的token和生前的token是父子关p! <br /> D、结束执行\?<br /> 一个node可以l束一条执行\径,q同h味着相应的token的结束和程的结束?/p> <p>程图中的node type </p> <p><br /> 1、task-node <br /> 一个task-node可以包含一个或多个taskQ这些task分配l特定的user。当程执行到task-nodeӞtask instance会被创建,一个task对应一个task instance。task instances 创徏后,task-node处于等待状态。当所有的task instances被特定的user执行完毕后,会发出一个新的signal 到tokenQ即程l箋执行?<br /> 2、state <br /> state是一个纯_的wait state({待状态)。它和task-node的区别就是它不会创徏task instances。很典型的用法是Q当q入q个节点Ӟ通过l定一个action到node-enter eventQ,发送一条消息到外部的系l,然后程处于等待状态。外部系l完成一些操作后q回一条消息,q个消息触发一个signal 到tokenQ然后流El执行。(不常用) <br /> 3、decision <br /> 当需要在程中根据不同条件来判断执行不同路径Ӟ可以用decision节点。两U方法:最单的是在transitions里增加condition elementsQ条ӞQcondition是beanshell script写的Q它q回一个boolean。当q行的时候,decision节点会在它?leaving transitions里@环,同时比较 leaving transitions里的conditionQ最先返?true'的conditionQ那个leaving transitions会被执行;作ؓ选择Q你可以实现DecisionHandler接口Q它有一个decide()ҎQ该Ҏq回一个String(leaving transition的名字)?<br /> 4、fork <br /> fork节点把一条执行\径分L多条同时q行Qƈ发)的执行\径,每条dfork节点的\径生一个子token?<br /> 5、join <br /> 默认情况下,join节点会认为所有到达该节点的token都有着相同的父token。join 节点会结束每一个到达该节点的token,当所有的子token都到达该节点后,父token会激zR当仍然有子token处于zd状态时Qjoin 节点是wait state({待状态)?<br /> 6、node <br /> node节点是让你挂自qaction用的Q注意:不是event触发Q!Q,当流E到达该节点Ӟaction会被执行。你的action要实现ActionHandler接口。同P在你的action里要控制程Q?/p> <p>Actions的说?</p> <p><br /> 存在两种actionQ一U是 event触发的actionQ一U是挂在node 节点的action。要注意它们的区别,event触发的action无法控制程Q也是说它无法军_程l过q个节点后下一步将到哪一个leaving transitionQ而挂在node 节点的action׃同,它可以控制流E。不是哪一Uaction都要实现ActionHandler接口?<br /> variable的管?</p> <p><br /> 程实例?存有contextInstance来管理token和variable. <br /> contextInstance是通过一个map来进行管理的,q个map的key是token,value是一个TokenVariableMap的对? </p> <p>TokenVariableMap本nq不是个map,而是一个普通的Object </p> <p>TokenVariableMap有三个属?一个是contextInstance,一个是Token对象本n,q有一个是 <br /> 一个Map,用来放variableInstance,q个Map的名UCؓvariableInstances. </p> <p>variableInstances是一个map,它的key是variable的名U??a",value是一个VariableInstance对象,VariableInstance对象放了四个属?一个是token对象本n,一个是variable的名U?一个是TokenVariableMap对象Q还有一个是processInsance,你可能会奇怪:variable的value攑ֈ哪里呢?实际上VariableInstance是一个抽象类Q具体的实现是它Ҏvalue的classcd选择它的子类Q子cM有个属性叫value。这个variable的value,?new Integer(3). </p> <p>一个流E实例可以有多个Token,Token间是有父子关pȝ: <br /> Token tokenAB=new Token(tokenA,"ab"); <br /> 上行代码的意思是在tokenA下面建立一个TokenAB,该新建的 <br /> Token的名字是"ab". </p> <p>ci.createVariable(tokenA, "a", new Integer(3)); <br /> 表示在tokenA范围内徏立一个variable,它的名称?a", <br /> gؓnew Integer(3) <br /> 建立q个variable?tokenA下面的token都可以看到该 <br /> variable,而上面的token则看不到. </p> <p>只有createVariable可以在某个token上徏立variable,其它?<br /> Ҏ只可以在rootToken上徏立variable. <br /> ?ci.setVariable(tokenA, "a", new Integer(3)); <br /> 其实是在rootToken上徏立了一个名UCؓ"a"的variable <br /> Map variables = new HashMap(); <br /> variables.put("a", new Integer(3)); <br /> variables.put("b", new Integer(4)); <br /> ci.addVariables(variables); <br /> 上面四行代码在rootToken上徏立了两个variable. <br /> 实际上在ExecutionContext中只有两个方法: <br /> public void setVariable(String name, Object value) { <br /> getContextInstance().setVariable(name, value, token); <br /> } <br /> public Object getVariable(String name) { <br /> return getContextInstance().getVariable(name, token); <br /> } <br /> 可以在子token中修改父token中徏立的variable.</p> <p>TaskQQ务) </p> <p><br /> jbpm一个相当重要的功能是对Q务进行管理?<br /> TaskQQ务)是流E定义里的一部分Q它军_了task instance的创建和分配?<br /> TaskQQ务)可以在task-node节点下定义,也可以挂在process-definition节点下。最普遍的方式是在task-node节点下定义一个或多个d。默认情况下Q流E在task-node节点会处于等待状态,直到所有的d被执行完毕。Q务的名称在整个流E中必须是唯一的?</p> <p>一个TaskNode对应多个Task <br /> 对于q样的流E定义: <br />  <br />  <br />  <br />  <br />  <br />  <br /> 只有当节点中的三个Q务都完成后,程才进入后面的节点 </p> <p>对于q样的流E定义: <br /> > <br />  <br />  <br />  <br />  <br />  <br /> 当第一个Q务完成后Qtoken指向后面的节点 </p> <p>对于q样的流E定义: <br /> > <br />  <br />  <br />  <br />  <br />  <br /> 三个d都完成后Qtoken仍然不会指向后面的节点;需要自己手动调?</p> <p>processInstance.signal()才会驱动程C面的节点 </p> <p>对于q样的流E定义: <br /> > <br />  <br />  <br />  <br />  <br />  <br /> token不会在本节点停留Q而是直接到后面的节点</p> <p>jbpm的Q务管理实?<br /> 一个Task instanceQQ务实例)可以被分配给一个actorId (java.lang.String)。所有的Task instance都被保存在数据库中的表jbpm_taskinstance里。当你想得到特定用户的Q务清单时Q你可以通过一个与用户兌的actorId来查询这张表?</p> <p>一个流E定义有一个TaskMgmtDefinitionQ一个TaskMgmtDefinition对应多个swimlane,同时对应多个task;一个swimlane有多个task,可以从TaskMgmtDefinition中通过task的名U直接获取相应的task; </p> <p>swimlane对象有四个属性,分别是nameQ名字)、assignmentDelegationQ分配代理类Q、taskMgmtDefinition、tasksQSet 对应多个task),可以增加task </p> <p>task对象主要的属性:taskMgmtDefinition、swimlane、assignmentDelegation、taskNodeQ需要注意的是swimlane和assignmentDelegation中间只是可以一个属性有|因ؓ它们都和d的分配有关系?</p> <p>一个流E实例有一个TaskMgmtInstanceQ一个TaskMgmtInstance对应多个swimlaneInstance,同时对应多个taskInstance;一个swimlaneInstance有多个taskInstance,可以从TaskMgmtInstance中直接获取相应的taskInstance; </p> <p>swimlaneInstance对象主要有五个属性,分别是name、actorId、pooledActorsQSetQ、swimlane、taskMgmtInstance?<br /> taskInstance对象的主要属性:name、actorId、task、swimlaneInstance、taskMgmtInstance、pooledActors?</p> <p>当对dq行分配Ӟ一般需要实现AssignmentHandlerq个接口Q这个接口的Ҏ只有一个: <br /> void assign( Assignable assignable, ExecutionContext executionContext ) throws Exception; <br /> 一个典型的实现Q把名字?change nappy'的Q务交lNappyAssignmentHandlerq个cL分配Q?<br />  <br />  <br />  <br /> NappyAssignmentHandlerc: <br /> public void assign(Assignable assignable, ExecutionContext executionContext) { <br /> assignable.setActorId("papa"); <br /> } <br /> 同样QAssignable只是一个接口,它有两个ҎQsetActorId()和setPooledActors()QAssignable的具体实现类也是两个 <br /> swimlaneInstancehe和taskInstance。这样就不不隄解整个Q务分配流E了Q?<br /> 1、流E进入TaskNode节点Q执行TaskNodecȝexecute()ҎQ该Ҏ首先获得TaskMgmtInstance实例Q然后通过它来创徏TaskInstance。taskMgmtInstance.createTaskInstance(task, executionContext); <br /> 2、在上面的createTaskInstance(task, executionContext)里,该方法调用了taskInstance.assign(executionContext)对taskInstanceq行分配?<br /> 3、在assign(executionContext)Ҏ里,首先会判断task属性里是否存在swimlaneQ如果有的话Q这个taskInstance׃分配lswimlane指定的ActorId?PooledActorsQ如果不存在Q再Ltask属性里 assignmentDelegationQ分配代理类Q通过代理c(x们自己写的实现AssignmentHandlerq个接口的类Q指定ActorId?PooledActors?<br /> jbpm的用戯色管?</p> <p><br /> jbpm在用戯色管理上p计了四个c:Entity?Membership?Group?User <br /> EntitycL其他三个cȝ父类Q它包含了两个属性:name(String)?permissions(Set) <br /> Usercȝ承Entityc,包含三个属性:password(String)?email(String)?memberships(Set) <br /> Groupcȝ承Entityc,包含四个属? type(String) 、parent(Group)?children(Set)?memberships(Set) <br /> Membershipcȝ承Entityc,包含三个属?role(String)?user(User)?group(Group) <br /> 很明显,一个user对应一个用P一个group对应一个用LQ它们之间通过membership兌Qƈ且一个user可以属于多个不同cdQtype)的groupQuser?group之间是多对多的关pR?<br /> Membershipcȝrole属性个人感觉用途不大,反倒是name属性代表了user在group里的roleQ角ԌQ?/p> <p><br /> Generated by Bo-blog 2.0.2 RC 1</p> <img src ="http://www.aygfsteel.com/libin2722/aggbug/143248.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/libin2722/" target="_blank">C物</a> 2007-09-06 18:11 <a href="http://www.aygfsteel.com/libin2722/articles/143248.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBPM部v在tomcat?/title><link>http://www.aygfsteel.com/libin2722/articles/143247.html</link><dc:creator>C物</dc:creator><author>C物</author><pubDate>Thu, 06 Sep 2007 10:10:00 GMT</pubDate><guid>http://www.aygfsteel.com/libin2722/articles/143247.html</guid><wfw:comment>http://www.aygfsteel.com/libin2722/comments/143247.html</wfw:comment><comments>http://www.aygfsteel.com/libin2722/articles/143247.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/libin2722/comments/commentRss/143247.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/libin2722/services/trackbacks/143247.html</trackback:ping><description><![CDATA[  <p><span style="font-family: 宋体">首先Q确认手Ҏ一?/span>jbpm3<span style="font-family: 宋体">?/span>user guide<span style="font-family: 宋体">Q有一份还?/span>JBPM3.0<span style="font-family: 宋体">源码的压~包</span></p> <p>JBPM<span style="font-family: 宋体">中是通过</span>org.jbpm.db. JbpmSessionFactory.getInstance()<span style="font-family: 宋体">q回一?/span>JbpmSessionFactory<span style="font-family: 宋体">实例Q?/span></p> <p><span style="font-family: 宋体">下面通过分析</span>getInstance()<span style="font-family: 宋体">的过E,说明怎么讄相关配置文g</span></p> <p>1<span style="font-family: 宋体">?/span>JbpmSessionFactory.getInstance()<span style="font-family: 宋体">Ҏ首先查找c\径中?/span>jbpm.properties<span style="font-family: 宋体">文g</span></p> <table style="border-right: medium none; border-top: medium none; background: #b3b3b3; margin-left: 5.4pt; border-left: medium none; border-bottom: medium none; border-collapse: collapse" cellspacing="0" cellpadding="0" border="1"> <tbody> <tr style="height: 210.75pt"> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 414pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; height: 210.75pt" valign="top" width="552"> <p>jbpm.scheduler.service.factory=org.jbpm.scheduler.impl.SchedulerServiceImpl</p> <p>jbpm.task.instance.class=org.jbpm.taskmgmt.exe.TaskInstance</p> <p># uncomment the next line if JbpmSessionFactory.getInstance()</p> <p># should lookup the singleton instance from JNDI instead of creating </p> <p># a default one.</p> <p>#</p> <p>jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory</p> <p># uncomment the next line to use the file system instead of the database for </p> <p># storing files related to a process definition</p> <p>#</p> <p># jbpm.files.dir=c:/jbpm.data</p> <p># resource path to a properties file that will overwrite all the hibernate </p> <p># properties. For database specific builds in db project there is a different</p> <p># hibernate.properties file on the classpath for each database. You could change</p> <p># the default database for any testing runs by uncommenting the next line and</p> <p># adding a hibernate.properties file in the basedir.</p> <p>#</p> <p>jbpm.hibernate.cfg.xml=jbpm.hibernate.cfg.xml</p> <p>jbpm.hibernate.properties=jbpm.hibernate.properties</p> </td> </tr> </tbody> </table> <p><span style="font-family: 宋体">扑ֈ最基本的设|,</span>jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory</p> <p><span style="font-family: 宋体">q行表示?/span>jndi<span style="font-family: 宋体">获取一?/span>JbpmSessionFactory<span style="font-family: 宋体">的一个实例,如果你可以用</span>JBPM3 demo<span style="font-family: 宋体">?/span>java:/jbpm/JbpmSessionFactory<span style="font-family: 宋体">是与</span>DataSource DefaultDS<span style="font-family: 宋体">l定在一LQ在</span>jboss-service.xml<span style="font-family: 宋体">中)。要部v?/span>tomcat<span style="font-family: 宋体">中,q行必须注释掉?/span></p> <table style="border-right: medium none; border-top: medium none; background: #b3b3b3; margin-left: 5.4pt; border-left: medium none; border-bottom: medium none; border-collapse: collapse" cellspacing="0" cellpadding="0" border="1"> <tbody> <tr style="height: 15.75pt"> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 414pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; height: 15.75pt" valign="top" width="552"> <p><?xml version="1.0" encoding="UTF-8"?></p> <p><server></p> <p> <mbean code="org.jbpm.db.jmx.JbpmService" </p> <p>         name="jboss.jbpm:name=DefaultJbpm,service=JbpmService"</p> <p>         description="Default jBPM Service"></p> <p>    <attribute name="JndiName">java:/jbpm/JbpmSessionFactory</attribute></p> <p>    <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends></p> <p> </mbean></p> <p></server></p> </td> </tr> </tbody> </table> <p>jboss-service.xml<span style="font-family: 宋体">文g内容Q如果你用源码包成功部v?/span>websale<span style="font-family: 宋体">的话Q可以在</span>JBOSS_HOME"server"jbpm"deploy"jbpm.sar"META-INF"<span style="font-family: 宋体">目录下找到该文g</span></p> <p>2<span style="font-family: 宋体">、如?/span>getInstance()<span style="font-family: 宋体">没有扑ֈ</span>jbpm.session.factory.jndi.name<span style="font-family: 宋体">的|会l查?/span>jbpm.hibernate.properties<span style="font-family: 宋体">的|扑ֈ</span>jbpm.hibernate.properties<span style="font-family: 宋体">的值后Q会用该g为配|文件取创徏</span>JbpmSessionFactory</p> <p>jbpm.hibernate.properties<span style="font-family: 宋体">内容Q?/span></p> <table style="border-right: medium none; border-top: medium none; background: #b3b3b3; margin-left: 5.4pt; border-left: medium none; border-bottom: medium none; border-collapse: collapse" cellspacing="0" cellpadding="0" border="1"> <tbody> <tr style="height: 31.5pt"> <td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 414pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; height: 31.5pt" valign="top" width="552"> <p>hibernate.dialect=org.hibernate.dialect.HSQLDialect</p> <p>hibernate.connection.datasource=java:/DefaultDS</p> <p># hibernate.show_sql=true</p> </td> </tr> </tbody> </table> <p><span style="font-family: 宋体">是用</span>DataSource<span style="font-family: 宋体">来创?/span>JbpmSessionFactory<span style="font-family: 宋体">Q?/span>DataSource<span style="font-family: 宋体">需要在</span>Server.xml<span style="font-family: 宋体">中配|,如果你不想配|?/span>DataSource<span style="font-family: 宋体">的话Q把q行也注释掉</span></p> <p>3<span style="font-family: 宋体">、上面两内定w被注释掉的话Q?/span>getInstance()<span style="font-family: 宋体">会查?/span>jbpm.hibernate.cfg.xml<span style="font-family: 宋体">的|用该g为配|文件创Z?/span>JbpmSessionFactory<span style="font-family: 宋体">?/span></p> <p><span style="font-family: 宋体">说明Q这里只是讲了怎么配置相关文gQ没有说到怎么部vQ关于这斚w内容Q请参?/span>User Guide chapter 5</p> <img src ="http://www.aygfsteel.com/libin2722/aggbug/143247.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/libin2722/" target="_blank">C物</a> 2007-09-06 18:10 <a href="http://www.aygfsteel.com/libin2722/articles/143247.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jBPM3.1 +Oracle10g+Tomcat-5.0.30安装实践http://www.aygfsteel.com/libin2722/articles/143246.htmlC物C物Thu, 06 Sep 2007 10:09:00 GMThttp://www.aygfsteel.com/libin2722/articles/143246.htmlhttp://www.aygfsteel.com/libin2722/comments/143246.htmlhttp://www.aygfsteel.com/libin2722/articles/143246.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143246.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143246.htmljBPM3.1 +Oracle10g+Tomcat-5.0.30安装实践

环境Q?/span>
jdk1.5.0_05
jakarta-tomcat-5.5.9
apache-ant-1.6.5(1.6.0
会报?/span>)
mysql-5.0.16-win32
jbpm-3.0.2


一?/span>JBPM_HOME即ؓ解开?/span>jbpm-3.0.2.zip文g
%JBPM_HOME%"lib
下,?/span>mysql目录Q将mysql?/span>jdbc驱动拷入Q?/span>
?/span>mysql中徏数据?/span>   CREATE DATABASE jbpm;


二、ؓant创徏jbpm相关数据库修改相关配|文?/span>
1
?/span>%JBPM_HOME%"src"resources目录下,?/span>“hsqldb”目录改名?/span>“mysql”Qƈ修改create.db.hibernate.properties文gQŞ如:
# these properties are used by the build script to create
# a hypersonic database in the build/db directory that contains
# the jbpm tables and a process deployed in there

hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/jbpm
hibernate.connection.username=root
hibernate.connection.password=
hibernate.c3p0.min_size=1
hibernate.c3p0.max_size=3
hibernate.show_sql=true

2
、修?/span>%JBPM_HOME%"build.deploy.xml文g?/span>“target”?/span>“create.db” 的內容,删除“db.start”Q?/span>“db.stop”Q将所有的“hsqldb”替换?/span>“mysql”
形如Q?/span>
  <target name="create.db" depends="declare.jbpm.tasks, db.clean" description="creates a hypersonic database with the jbpm tables and loads the processes in

there">
    <jbpmschema actions="create" properties="${basedir}/src/resources/mysql/create.db.hibernate.properties"/>
    <loadidentities file="${basedir}/src/resources/mysql/identity.db.xml" properties="${basedir}/src/resources/mysql/create.db.hibernate.properties"/>
    <ant antfile="build.xml" target="build.processes" inheritall="false" />
    <deploypar properties="${basedir}/src/resources/mysql/create.db.hibernate.properties">
        <fileset dir="build" includes="*.par" />
    </deploypar>
    <!--antcall target="db.stop" /-->
  </target>


三、ؓant创徏jbpm.war包修改相关配|文?/span>
1
、修?/span>%JBPM_HOME%"src"config.files"hibernate.cfg.xml文g中数据库q接配置部分QŞ如:
    ……
    <!-- jdbc connection properties -->
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpm</property>
    <property name="hibernate.connection.username">root</property>
    <property name="hibernate.connection.password">rootrootrootroot</property>
         
    <!-- c3p0 connection pooling properties -->
    <property name="hibernate.c3p0.min_size">1</property>
    <property name="hibernate.c3p0.max_size">3</property>

    <!-- other hibernate properties -->
    <property name="hibernate.show_sql">true</property>
    ……

2
、修?/span>%JBPM_HOME%"src"resources"jbpm.sar"jbpm.propertiesQŞ如:
jbpm.scheduler.service.factory=org.jbpm.scheduler.impl.SchedulerServiceImpl
jbpm.task.instance.class=org.jbpm.taskmgmt.exe.TaskInstance

# uncomment the next line if JbpmSessionFactory.getInstance()
# should lookup the singleton instance from JNDI instead of creating
# a default one.
#
# jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory

# uncomment the next line to use the file system instead of the database for
# storing files related to a process definition
#
# jbpm.files.dir=c:/jbpm.data

# resource path to a properties file that will overwrite all the hibernate
# properties. For database specific builds in db project there is a different
# hibernate.properties file on the classpath for each database. You could change
# the default database for any testing runs by uncommenting the next line and
# adding a hibernate.properties file in the basedir.
#
jbpm.hibernate.cfg.xml=jbpm.hibernate.cfg.xml
# jbpm.hibernate.properties=jbpm.hibernate.properties

3
、修?/span>%JBPM_HOME%"src"resources"jbpm.sar"jbpm.hibernate.propertiesQ只?/span>hibernate.cfg.xml来配|?/span>hibernateQ因此全部注释掉QŞ如:
# hibernate.dialect=org.hibernate.dialect.HSQLDialect
# hibernate.connection.datasource=java:/DefaultDS
# hibernate.show_sql=true

4
、修?/span>%JBPM_HOME%"build.deploy.xml文gQ?/span>“target”?/span>“build.webapp”的內容,原文件相关的jar包未包含全,因此补全QŞ如:
  <target name="build.webapp" description="builds jbpm.war">
    <ant antfile="build.xml" target="build" /><!--
原文件是target="build.webapp" -->
    <mkdir dir="build/jbpm.war.dir" />
    <copy todir="build/jbpm.war.dir">
        <fileset dir="src/resources/jbpm.war" />
    </copy>
    <copy todir="build/jbpm.war.dir/WEB-INF/lib">
        <fileset dir="build" includes="jbpm*.jar,converter.jar" excludes="*src*.jar" />
        <fileset dir="lib/jsf" includes="*.jar" />
        <fileset dir="lib/dom4j" includes="*.jar" />
        <!--fileset dir="lib/jaxen" includes="*.jar" / included in lib/hibernate -->
        <fileset dir="lib/hibernate" includes="*.jar" />
        <fileset dir="lib/mysql" includes="*.jar" />
        <fileset dir="lib/commons" includes="commons-digester-*.jar,   commons-beanutils-*.jar" />
        <fileset dir="lib/jboss" includes="*.jar"   excludes="jboss*.jar,*servlet*.jar,*hsql*.jar,dom4j*.jar" />
    </copy>
    <jar destfile="build/jbpm.war">
        <fileset dir="build/jbpm.war.dir" />
    </jar>
  </target>


四、执?/span>Ant
1
、创建ƈ初始?/span>jbpm例子所需?/span>table
ant create.db -buildfile build.deploy.xml
2
、生?/span>jbpm.war
ant build.webapp -buildfile build.deploy.xml


五?/span>tomcat拥抱jbpm
?/span>%JBPM_HOME%"build"jbpm.war文g复制?/span>Tomcat?/span>webapp目录下,启动Tomcat自动部vjbpmQ访?/span>http://localhost:8080/jbpmQ出现登录页面,配置成功?/span>



C物 2007-09-06 18:09 发表评论
]]>
表的中文意?/title><link>http://www.aygfsteel.com/libin2722/articles/143243.html</link><dc:creator>C物</dc:creator><author>C物</author><pubDate>Thu, 06 Sep 2007 10:00:00 GMT</pubDate><guid>http://www.aygfsteel.com/libin2722/articles/143243.html</guid><wfw:comment>http://www.aygfsteel.com/libin2722/comments/143243.html</wfw:comment><comments>http://www.aygfsteel.com/libin2722/articles/143243.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/libin2722/comments/commentRss/143243.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/libin2722/services/trackbacks/143243.html</trackback:ping><description><![CDATA[附上中表的中文意?<br /> JBPM_ACTION action记录?<br /> JBPM_DECISIONCONDITIONS l果条g?<br /> JBPM_DELEGATION 委托?<br /> JBPM_EVENT 事g?处理q入或者离开事g <br /> JBPM_EXCEPTIONHANDLER 异常处理?<br /> JBPM_ID_GROUP 用户l表 <br /> JBPM_ID_MEMBERSHIP 用户成员?表现用户和组之间的多对多关系 <br /> JBPM_ID_PERMISSIONS 用户权限?<br /> JBPM_ID_USER 用户?<br /> JBPM_MODULEDEFINITION 模块定义?<br /> JBPM_MODULEINSTANCE 模块实例?<br /> JBPM_NODE 程节点?<br /> JBPM_POOLEDACTOR 汇集参与着?<br /> JBPM_PROCESSDEFINITION 程定义?<br /> JBPM_PROCESSFILE 程文g?<br /> JBPM_PROCESSFILEBLOCK 程文g块表 <br /> JBPM_PROCESSINSTANCE 程实例?<br /> JBPM_RUNTIMEACTION q行中行 <br /> JBPM_SCRIPTVARIABLES 脚本变量?<br /> JBPM_SWIMLANE 泳道?<br /> JBPM_SWIMLANEINSTANCE 泳道实例?<br /> JBPM_TASK d?<br /> JBPM_TASKACTORPOOL 用户行ؓ汇?<br /> JBPM_TASKINSTANCE d实例 <br /> JBPM_TIMER 计时?<br /> JBPM_TOKEN 令牌?<br /> JBPM_TOKENVARIABLEMAP 令牌变量影射?<br /> JBPM_TRANSITION 转换?<br /> JBPM_VARIABLEINSTANCE 变量实例?<br /> JBPM_VARIABLEINSTANCEBLOCK 变量实例块表 <br /> JBPM_VARIABLEMAPPING 变量影射?<br /> <img src ="http://www.aygfsteel.com/libin2722/aggbug/143243.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/libin2722/" target="_blank">C物</a> 2007-09-06 18:00 <a href="http://www.aygfsteel.com/libin2722/articles/143243.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>对Jbpm数据库应用的单分析和在Mysql上实现的demohttp://www.aygfsteel.com/libin2722/articles/143242.htmlC物C物Thu, 06 Sep 2007 09:59:00 GMThttp://www.aygfsteel.com/libin2722/articles/143242.htmlhttp://www.aygfsteel.com/libin2722/comments/143242.htmlhttp://www.aygfsteel.com/libin2722/articles/143242.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143242.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143242.html阅读全文

C物 2007-09-06 17:59 发表评论
]]>
spring+hibernate+jbpm整合成功 http://www.aygfsteel.com/libin2722/articles/143241.htmlC物C物Thu, 06 Sep 2007 09:58:00 GMThttp://www.aygfsteel.com/libin2722/articles/143241.htmlhttp://www.aygfsteel.com/libin2722/comments/143241.htmlhttp://www.aygfsteel.com/libin2722/articles/143241.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143241.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143241.html最后的配置l果是:

 

 

hibernate.cfg.xml、jbpm.cfg.xml在关联spring后保持不变,只需要更改spirng的配|文件就好了?


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd"
>

<beans>
    
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        
<property name="driverClassName">
            
<value>com.mysql.jdbc.Driver</value>
        
</property>
        
<property name="url">

 


            
<value>jdbc:mysql://localhost:3306/test</value>
        
</property>
        
<property name="username">
            
<value>root</value>

        
</property>
        
<property name="password">
            
<value/>

 


        
</property>
    
</bean>
    
<!-- Hibernate SessionFactory -->

 


    
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        
<property name="dataSource">
            
<ref local="dataSource"/>
        
</property>
        
<property name="mappingLocations">  
           
<value>classpath*:/org/jbpm/**/*.hbm.xml</value>  
           
</property>
        
<property name="hibernateProperties">  
           
<props>  
               
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
               
<prop key="hibernate.hbm2ddl.auto">update</prop>
               
<prop key="hibernate.jdbc.batch_size">0</prop>

 


           
</props>
       
</property> 
    
</bean>
    
<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
    
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        
<property name="sessionFactory">
            
<ref local="sessionFactory"/>
        
</property>
    
</bean>
    
    
<!-- reading jBPM process definitions -->
    
<bean id="websaleWorkflow1" class="org.springmodules.workflow.jbpm31.definition.ProcessDefinitionFactoryBean">
        
<property name="definitionLocation"    value="processdefinition.xml"/>
    
</bean>
    
<!-- jBPM configuration--> 
    
<bean id="jbpmConfiguration" class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">

        
<property name="sessionFactory" ref="sessionFactory"/>
        
<property name="configuration" value="jbpm.cfg.xml"/>
        
<property name="processDefinitions">
            
<list>
                
<ref local="websaleWorkflow1"/>
            
</list>
        
</property>
        
<property name="createSchema" value="true"/>
    
</bean>
    
<!-- jBPM template -->
    
<bean id="jbpmTemplate" class="org.springmodules.workflow.jbpm31.JbpmTemplate">
        
<constructor-arg index="0" ref="jbpmConfiguration"/>
        
<constructor-arg index="1" ref="websaleWorkflow1"/>
    
</bean>

</beans>

 

 

其中

<property name="mappingLocations">  
           
<value>classpath*:/org/jbpm/**/*.hbm.xml</value>  

 


           
</property>

很关键,我就是想spring会通过jbpm扑ֈhibernate.cfg.xml而没有设|,才失败的?

 


C物 2007-09-06 17:58 发表评论
]]>
jbpm例子http://www.aygfsteel.com/libin2722/articles/143239.htmlC物C物Thu, 06 Sep 2007 09:57:00 GMThttp://www.aygfsteel.com/libin2722/articles/143239.htmlhttp://www.aygfsteel.com/libin2722/comments/143239.htmlhttp://www.aygfsteel.com/libin2722/articles/143239.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143239.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143239.html阅读全文

C物 2007-09-06 17:57 发表评论
]]>
jbpm用户指南译Q第6章 配置 http://www.aygfsteel.com/libin2722/articles/143237.htmlC物C物Thu, 06 Sep 2007 09:52:00 GMThttp://www.aygfsteel.com/libin2722/articles/143237.htmlhttp://www.aygfsteel.com/libin2722/comments/143237.htmlhttp://www.aygfsteel.com/libin2722/articles/143237.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143237.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143237.html阅读全文

C物 2007-09-06 17:52 发表评论
]]>
jBPM3.12用户指南中文译----W五?部v http://www.aygfsteel.com/libin2722/articles/143142.htmlC物C物Thu, 06 Sep 2007 04:36:00 GMThttp://www.aygfsteel.com/libin2722/articles/143142.htmlhttp://www.aygfsteel.com/libin2722/comments/143142.htmlhttp://www.aygfsteel.com/libin2722/articles/143142.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143142.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143142.htmlChapter 5. Deployment部v

jBPM is an embeddable BPM engine, which means that you can take jBPM and embed it into your own java project, rather then installing a separate product and integrate with it. One of the key aspects that make this possible is minimizing the dependencies. This chapter discusses the jbpm libraries and their dependencies.

   jBPM是一个嵌入式的BPMQ业务程序管理)引擎。本章讨论jbpm库和它的依赖库?/p>

5.1. Java runtime environment

jBPM 3 requires J2SE 1.4.2+

5.2. jBPM libraries

jbpm-[version].jar is the library with the core jbpm functionality.是jbpm的核心功能库?/p>

jbpm-identity-[version].jar is the (optional) library containing an identity component as described in Section 11.11, “The identity component”.

可选的Q这个库包含了n份验证组件。用于流E的参与者的理?/p>

5.3. Third party librariesW三方库

In a minimal deployment, you can create and run processes with jBPM by putting only the commons-logging and dom4j library in your classpath. Beware that persisting processes to a database is not supported. The dom4j library can be removed if you don't use the process xml parsing, but instead build your object graph programatically.

最的jbpm部vQ只需要核心jbpm库和commons-logging库,以及dom4j库到你的classpath中。此Ӟ不支持持久化业务E序到数据库?/p>

Table 5.1. 

Library?/span>

Usage用?/span>

Description描述

Directory目录

commons-logging.jar

logging in jbpm and hibernate

The jBPM code logs to commons logging. The commons logging library can be configured to dispatch the logs to e.g. java 1.4 logging, log4j, ... See the apache commons user guide for more information on how to configure commons logging. if you're used to log4j, the easiest way is to put the log4j lib and a log4j.properties in the classpath. commons logging will automatically detect this and use that configuration.

lib/jboss (from jboss 4.0.3)

dom4j-1.6.1.jar

process definitions and hibernate persistence

xml parsing

lib/dom4j

A typical deployment for jBPM will include persistent storage of process definitions and process executions. In that case, jBPM does not have any dependencies outside hibernate and its dependent libraries.

典型的jBPM部v包括持久化业务程序定义和执行的功能?需要Hibernate

Of course, hibernate's required libraries depend on the environment and what features you use. For details refer to the hibernate documentation. The next table gives an indication for a plain standalone POJO development environment.

下面的表l出了简单的标准POJO部v环境需要的W三方库?/p>

jBPM is distributed with hibernate 3.1 final. But it can also work with 3.0.x. In that case, you might have to update a few hibernate queries in the hibernate.queries.hbm.xml configuration file. For more info about customizing queries, see Section 7.6, “Customizing queries”

Table 5.2. 

Library?/span>

Usage

Description

Directory

hibernate3.jar

hibernate persistence

the best O/R mapper

lib/hibernate (hibernate 3.1 final)

antlr-2.7.5H3.jar

used in query parsing by hibernate persistence

parser library

lib/jboss (from jboss 4.0.3)

cglib-2.1_2jboss.jar

hibernate persistence

reflection library used for hibernate proxies

lib/jboss (from jboss 4.0.3)

commons-collections.jar

hibernate persistence

lib/jboss (from jboss 4.0.3)

ehcache-1.1.jar

hibernate persistence (in the default configuration)

second level cache implementation.二~存实现?/span>

When configuring a different cache provider for hibernate, this library is not required.

lib/hibernate

jaxen-1.1-beta-4.jar

process definitions and hibernate persistence

XPath library (used by dom4j)

lib/hibernate

jdbc2_0-stdext.jar

hibernate persistence

lib/hibernate

asm.jar

hibernate persistence

asm byte code library

二进制代码修改库

lib/hibernate

asm-attrs.jar

hibernate persistence

asm byte code library

lib/hibernate

The beanshell library is optional. If you don't include it, you won't be able to use the beanshell integration in the jbpm process language and you you'll get a log message saying that jbpm couldn't load the Script class and hence, the script element won't be available.

Beanshell库是可选的?/p>

Table 5.3. 

Library

Usage

Description

Directory

bsh-1.3.0.jar

beanshell script interpreter

Only used in the script's and decision's. When you don't use these process elements, the beanshell lib can be removed, but then you have to comment out the Script.hbm.xml mapping line in the hibernate.cfg.xml

lib/jboss


v

C物 2007-09-06 12:36 发表评论
]]>
jBPM3.12用户指南中文译----W四?面向图表~程 http://www.aygfsteel.com/libin2722/articles/143141.htmlC物C物Thu, 06 Sep 2007 04:33:00 GMThttp://www.aygfsteel.com/libin2722/articles/143141.htmlhttp://www.aygfsteel.com/libin2722/comments/143141.htmlhttp://www.aygfsteel.com/libin2722/articles/143141.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143141.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143141.html阅读全文

C物 2007-09-06 12:33 发表评论
]]>
jBPM3.12用户指南中文译----W二?h http://www.aygfsteel.com/libin2722/articles/143140.htmlC物C物Thu, 06 Sep 2007 04:30:00 GMThttp://www.aygfsteel.com/libin2722/articles/143140.htmlhttp://www.aygfsteel.com/libin2722/comments/143140.htmlhttp://www.aygfsteel.com/libin2722/articles/143140.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143140.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143140.html        同时Q对于其中的部分内容Q我会在译中做释和写上我的理解?br />


Chapter 2. Getting startedh

This chapter takes you through the first steps of getting JBoss jBPM and provides the initial pointers to get up and running in no time.

初始化JBpm3.12

2.1. Downloadables Overview

Listed below are the different jBPM packages that are available today. Each of these packages contains one or more downloadable files. Along with each of these files goes a description of its contents and a pointer to any relevant installation instructions if they are available.

All downloads described below can be found on the sourceforge jbpm downloads page.

2.1.1. jBPM 3

Download JBoss jBPM 3 at sourceforge.net. This is the main distribution package containing the core engine and a number of additional modules that you may need to work with jBPM. 包括JBpm核心和其他包?/span>

  • The Starters Kit (jbpm-starters-kit-<version>.zip): If you want to get started with jBPM quickly, this is the file you want to download. It contains all the other modules of this package plus the graphical designer in one single download. Extract the zipped archive into a folder of your choice and read the file named 'readme.html' for more info and further installation instructions. With this starters kit you can immediately get started with the Chapter 3, Tutorial.

包含了包括图形化设计器在内的所有模块,能够帮助你快速启动?/span>

  • Core Engine and Identity Component (jbpm-<version>.zip): The download contains the jBPM core engine as well as the identity component for actor and group management. To start working with it, extract the archive into a folder of your choice. You will find pointers to the User's Guide and other important information resources in the 'readme.html' file in the 'jbpm-<version>' folder.

核心Q包括核心引擎和w䆾l徏Q内有用h南文档?/span>

  • Database Extensions (jbpm-db-<version>.zip):数据库扩?/span> The database extension pack contains the jBPM core engine as well as the identity component for actor and group management. To start working with it, extract the archive into a folder of your choice. You will find pointers to the User's Guide and other important information resources in the 'readme.html' file in the 'jbpm-<version>' folder.

2.1.2. jBPM Process Designer

jBPMq程设计?/span>

Download JBoss jBPM Process Designer at sourceforge.net. The designer is an eclipse plugin and enables you to author 创作your process definitionsq程定义 and to easily deploy them. The plug-in is available for download either as a zipped Eclipse feature or as a zipped Eclipse update site. There is no difference in content, the only difference is in the way you have to do the installation.

  • Eclipse Update Site (jbpm-gpd-site-<version>.zip): If you want to be absolutely sure that the designer installation goes smoothly, we recommend to use the update site mechanism together with a new Eclipse installation. Of cource the Eclipse version should match the downloaded update site archive. To get started with the designer plugin, follow the instructions in the 'readme.html' file included in the archives root folder to succesfully install the GPD.

使用本地站点更新方式部v?/span>

  • Eclipse Feature (jbpm-gpd-feature-<version>.zip): If you are tired of each time having to do a fresh Eclipse installation and you are willing to cope with some possible issues, you can try the feature download. In this case installation is as easy as extracting the archive into your Eclipse installation (make sure the included 'plugins' and 'features' folders end up in the same location of your Eclipse installation) overwriting the files and folders with the same name that are possibly already present. This installation is very easy, but you could run into incompatibility issues when you overwrite plugins already present in your installation because of other features that you did install. Though they have the same name it could happen that the versions of these colliding plugins are not equal, hence the possible incompatibilities. The installation instructions are repeated in the 'readme.html' file.

q个是手工部|Ӏ?/span>

2.1.3. jBPM BPEL extension

Download JBoss jBPM BPEL extension at sourceforge.net. It contains only one file : jbpm-bpel-<version>.zip. To get started with the BPEL extensions, look in the User's Guide in the 'doc' subfolder of the toplevel folder.

jbpm-bpelQ含?/span>JBoss jBPM?/span>BPEL扩展件方面的信息?/span>

BPEL是一个规范的SOAlg。因ZJBoss jBPM使用的许可证不同Q所以被独立了出来?/span>

2.2. The JBoss jBPM project directory

  • professional support: JBoss is the company that backs this project with professional support, training and consultancy services.
  • user guide: is the document you're reading and serves as the main entry point into the project.
  • forums: get in contact with the community, ask questions and discuss jBPM   论坛Q社区?/span>
  • wiki: extra information, mostly provided by the community
  • issue tracker: for submitting bugs and feature requests
  • downloads: sourceforge download page for jBPM
  • mailing lists: mailing lists are used for announcements
  • javadocs: part of the download in the doc/javadoc directory.

2.3. CVS access

2.3.1. Anonymous CVS access

Alternatively, you can get JBoss jBPM from cvs with the following information:

  • Connection type: pserver
  • User: anonymous
  • Host: anoncvs.forge.jboss.com
  • Port: 2401 (which is the default)
  • Repository path: /cvsroot/jbpm
  • Label: :pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jbpm

2.3.2. Developer CVS access

To get cvs developer access, you must sign contributors agreement and you need an ssh key. More information on both can be found on the JBoss cvs repository wiki page

  • Connection type: ext over ssh (extssh in eclipse)
  • User: sf.net username or jboss username
  • Host: cvs.forge.jboss.com
  • Port: 2401 (which is the default)
  • Repository path: /cvsroot/jbpm
  • Label: :pserver:anonymous@cvs.forge.jboss.com:/cvsroot/jbpm
v

C物 2007-09-06 12:30 发表评论
]]>
jBPM3.12用户指南中文译----W三?指南 http://www.aygfsteel.com/libin2722/articles/143139.htmlC物C物Thu, 06 Sep 2007 04:29:00 GMThttp://www.aygfsteel.com/libin2722/articles/143139.htmlhttp://www.aygfsteel.com/libin2722/comments/143139.htmlhttp://www.aygfsteel.com/libin2722/articles/143139.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143139.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143139.html 同时Q对于其中的部分内容Q我会在译中做释和写上我的理解?br />


Chapter 3. Tutorial指南

This tutorial will show you basic process constructs q程建造in jpdl and the usage of the API for managing the runtime executions.

q本指南告诉你使用jpdl语言构徏基本的工作流E,以及理q行时执行的API的用法?br />
The format of this tutorial is explaining a set of examples. The examples focus on a particular topic and contain extensive comments. The examples can also be fond in the jBPM download package in the directory src/java.examples.

q篇指南解释一pd的例子。例子聚焦于一个特D的主题和包含很多的注释?br />
The best way to learn is to create a project and experiment by creating variations on the examples given.

最好的学习方式是在例子的基上创Z个略Z同的目?br />
To get started for eclipse users: download jbpm-3.0-[version].zip and unzip it to your sytem. Then do "File" --> "Import..." --> "Existing Project into Workspace". Click "Next" Then, browse for the jBPM root directory and click "Finish". Now you have a jbpm.3 project in your workspace. You can now find the examples of the tutorial in src/java.examples/.... When you open these examples, you can run them with "Run" --> "Run As..." --> "JUnit Test"

用Junitq行自带的例子?br />


jBPM includes a graphical designer tool for authoring 创作the XML that is shown in the examples. You can find download instructions指o for the graphical designer in Section 2.1, “Downloadables Overview”. You don't need the graphical designer tool to complete this tutorial.

State machines can be

你不需要图形设计器p完成q篇指南。图形设计器仅仅帮助你制作xml程定义文g?br />


3.1. Hello World example

A process definition is a directed graph, made up of nodes and transitions. The hello world process has 3 nodes. To see how the pieces fit together, we're going to start with a simple process without the use of the designer tool. The following picture shows the graphical representation of the hello world process:



一个过E定义是一个直接的图表Q由“节点”?#8220;转向”l成。Hello worldq个例子的过E定义有3个节炏V?br />
下面的图像显CZhello worldq程定义的图形化表示?br />
V:SHAPE id=_x0000_i1025 style="WIDTH: 63.75pt; HEIGHT: 120pt" type="#_x0000_t75">



Figure 3.1. The hello world process graph

Hello world业务处理图表

publicvoid testHelloWorldProcess() {

// This method shows a process definition and one execution

// of the process definition. The process definition has

// 3 nodes: an unnamed start-state, a state 's' and an

// end-state named 'end'.

//q个Ҏ昄了一个过E定义和q个q程定义的执行?br />
// The next line parses a piece of xml text into a

// ProcessDefinition. A ProcessDefinition is the formal

// description of a process represented as a java object.

/*

* 下一行把一Dxml文本解析qProcessDefinition对象。ProcessDefinition?br />
* q程作ؓ一个Java对象在内存中的正式的描述

* */

ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(

" " +

" " +

" " +

"
" +

" " +

" " +

"
" +

" " +

"
"

);



// The next line creates one execution of the process definition.

// After construction, the process execution has one main path

// of execution (=the root token) that is positioned in the

// start-state.

/**

*下一行用代表过E定义的Model对象--ProcessDefinition实例Q创Z个业务处理定义的执行

*构造之后,在开始状?节点Q业务处理执行对象有一个主要的执行路径

*

*/

ProcessInstance processInstance =

new ProcessInstance(processDefinition);



// After construction, the process execution has one main path

// of execution (=the root token).

/*记号Q得C要的执行路径?br />
* Token记号c,代表一条过E的执行路径和在q程定义中维护一个指向节点的指针

*

* */

Token token = processInstance.getRootToken();



// Also after construction, the main path of execution is positioned

// in the start-state of the process definition.

assertSame(processDefinition.getStartState(), token.getNode());



// Let's start the process execution, leaving the start-state

// over its default transition.

/*

* token.signal();用来执行一步状态,利用“转向”跛_下一步状态?br />
*

* */

token.signal();

// The signal method will block until the process execution

// enters a wait state.



// The process execution will have entered the first wait state

// in state 's'. So the main path of execution is not

// positioned in state 's'

assertSame(processDefinition.getNode("s"), token.getNode());



// Let's send another signal. This will resume execution by

// leaving the state 's' over its default transition.

/*

* 让我们发送另一个信受这执行离开状态s的{向?br />
* */

token.signal();

// Now the signal method returned because the process instance

// has arrived in the end-state.



assertSame(processDefinition.getNode("end"), token.getNode());

}

参考:

1Q记LQ代表一个工作处理定义的一条工作流E?br />
public class Token

extends java.lang.Object

implements java.io.Serializable

represents one path of execution and maintains a pointer to a node in the ProcessDefinition. Most common way to get a hold of the token objects is with ProcessInstance.getRootToken() or ProcessInstance.findToken(String).

q个cM表了一个过E的执行程。?br />
public void signal()

provides a signal to the token. this method activates this token and leaves the current state over the default transition.

Ҏ执行一步?br />


2Q工作处理实?c?br />
public class ProcessInstance

extends java.lang.Object

implements java.io.Serializable

is one execution of a ProcessDefinition. To create a new process execution of a process definition, just use the ProcessInstance(ProcessDefinition).

q个cL据作为Model数据容器cȝProcessDefinition工作处理定义cȝ一个实例创建。代表一个工作处理定义的执行。主要关注于工作处理相关的操作?br />


getRootToken
public TokengetRootToken()
得到工作处理定义的从start状态开始的一条记?---工作程?br />




findToken
public TokenfindToken(java.lang.String tokenPath)
looks up the token in the tree, specified by the slash-separated token path.

Parameters:

tokenPath - is a slash-separated name that specifies a token in the tree.

Returns:

the specified token or null if the token is not found.

在工作处理定义的树中Q根据记可\?工作程路径得到一条工作流E?br />
?br />




3.2. Database example

数据库例?br />
One of the basic features of jBPM is the ability to persist executions of processes in the database when they are in a wait state. The next example will show you how to store a process instance in the jBPM database. The example also suggests a context in which this might occur. Separate methods are created for different pieces of user code. E.g. an piece of user code in a web application starts a process and persists the execution in the database. Later, a message driven bean loads the process instance from the database and resumes its execution.

jBPM的一个基本的Ҏ是Q它能够在业务处理处于等待状态时Q把业务处理的执行结果储存到数据库中。下一个例子讲告诉你怎样把一个业务处理的实例保存qjBPM数据库。例子也展示了可能发生这U情늚场景。如Q用L业务处理代码由几个独立的Ҏl成Q例如,一部分用户代码是,在一个Web应用E序中开始一个处理,q且把这个处理保存进数据库。然后,一个消息驱动的bean从数据库中引D个业务处理实?---也就是业务处理定义的一个执行的实例Q注?ProcessDefinition业务处理定义是一个ModelQ保存xml格式的业务处理图表,一UDSL特定领域语言Q而ProcessInstance业务处理实例Q也是一个ModelQ它是保存业务处理定义的一ơ执行的信息。具体的操作׃它得到的Token记号cL行。TokencLActionc,真正执行业务处理的流E。Tokencd该叫?#8220;工作程c?#8221;Q代表了业务处理的一条工作流E)Q恢复它的执行?br />
q样QjBPM的业务处理具有分Dc异步执行的能力?br />


More about the jBPM persistence can be found in Chapter 7, Persistence.

API参考:

1,Jbpm配置

public class JbpmConfiguration

extends java.lang.Object

implements java.io.Serializable

configuration of one jBPM instance.一个jBPM实例的配|。也是_jBPM可以使用多个jBPM配置。基本上Q一个jBPM的业务处理可以用一个JbpmConfiguration对象的实例?br />
During process execution, jBPM might need to use some services. A JbpmConfiguration contains the knowledge on how to create those services.

在业务处理的执行q程中,jBPM可能需要用一些服务。一个Jbpm配置cd含了怎样创徏q些服务的知识?br />
A JbpmConfiguration is a thread safe object and serves as a factory for JbpmContexts, which means one JbpmConfiguration can be used to create JbpmContexts for all threads. The single JbpmConfiguration can be maintained in a static member or in the JNDI tree if that is available.

一个JbpmConfiguration能够被用来ؓ所有的U程创徏JbpmContext。JbpmConfiguration.createJbpmContext()Q方法创建Jbpm上下文环境类的一个实例?br />
JbpmConfiguration应该使用单例Q如静态成员,或者JNDI树,或者IOC容器理的单例等?

A JbpmConfiguration can be obtained in following ways:

from a resource (by default jbpm.cfg.xml is used):
· JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();



or

String myXmlResource = "...";

JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(myXmlResource);

from an XML string:
· JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(

· "" +

· ...

· ""

· );



By specifying a custom implementation of an object factory. This can be used to specify a JbpmConfiguration in other bean-style notations such as used by JBoss Microcontainer or Spring.
通过指定一个对象工厂的定制实现。被用在JBoss或者Spring容器中?br />


· ObjectFactory of = new MyCustomObjectFactory();

· JbpmConfiguration.Configs.setDefaultObjectFactory(of);

· JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();



JbpmConfigurations can be configured using a spring-like XML notation (in relax ng compact notation):

datatypes xs = "http://www.w3.org/2001/XMLSchema-datatypes"



start = element beans { element object* }



object = {

jbpm-context |

bean |

ref |

map |

list |

string |

int |

long |

float |

double |

char |

bool |

true |

false |

null

}



jbpm-context = element jbpm-context {

( attribute name {xsd:string},

service*,

save-operations?

)

}



service = element service {

( attribute name {xsd:string},

( attribute factory {xsd:string} ) |

( factory )

)

}



factory = element factory {

( bean |

ref

)

}



save-operations = element save-operations {

( save-operation* )

}



save-operation = element save-operation {

( ( attribute class {xsd:string} ) |

( bean |

ref

)

)

}



bean = element bean {

( attribute ref-name {xsd:string} ) |

( attribute name {xsd:string}?,

attribute class {xsd:string}?,

attribute singleton { "true" | "false" }?,

constructor*,

field*,

property*

)

}



ref = element ref {

( attribute bean (xsd:string) )

}



constructor = element constructor {

attribute class {xsd:string}?,

( attribute factory {xsd:string},

attribute method {xsd:string}

)?,

parameter*

}



parameter = element parameter {

attribute class {xsd:string},

object

}



field = element field {

attribute name {xsd:string},

object

}



property = element property {

( attribute name {xsd:string} |

attribute setter {xsd:string}

),

object

}



map = element map {

entry*

}



entry = element entry {

key,

value

}



key = element key {

object

}



value = element value {

object

}



list = element list {

object*

}



string = element string {xsd:string}

int = element integer {xsd:integer}

long = element long {xsd:long}

float = element float {xsd:string}

double = element string {xsd:double}

char = element char {xsd:character}

bool = element bool { "true" | "false" }

true = element true {}

false = element false {}

null = element null {}



Other configuration properties

jbpm.msg.wait.timout


jbpm.files.dir


jbpm.types







2QJbpm上下文环?br />
public class JbpmContext

extends java.lang.Object

implements java.io.Serializable

is used to surround persistent operations to processes.

被用来负责业务处理的持久化操作。它底层使用Hibernate{数据库持久化技术来与数据库中的保存业务处理图表、业务处理的执行{的数据库表交互?br />
Obtain JbpmContext's via JbpmConfiguration.createJbpmContext() and put it in a try-finally block like this:

作ؓ一个数据库持久化资源,必须要关闭?br />
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();

try {

TaskInstance taskInstance = ...



...do your process operations...



// in case you update a process object that was not fetched

// with a ...ForUpdate method, you have to save it.

/*





*/

jbpmContext.save(processInstance);

finally {

jbpmContext.close();

}



A JbpmContext separates jBPM from a sprecific environment. For each service that jBPM uses, there is an interface specified in the jBPM codebase. jBPM also includes implementations that implement these services by using services in a specific environment. e.g. a hibernate session, a JMS asynchronous messaging system, ...

JbpmContext从一个jBPM实例的环境中分离而来。每一个jBPM使用的服务,在jBPM的代码库中有指定的借口。jBPM也包括在一个特定环境中使用q些服务的实现类?br />
A JbpmContext can demarcate a transaction. When a PersistenceService is fetched from the JbpmContext, the default implementation for the persistence service will create a hibernate session and start a transaction. So that transactions can be configured in the hibernate configuration.

JbpmContext能够使用事务。如果一个持久化服务是从JbpmContext中来的,那么默认的持久化实现是HibernateQ那么将会创Z个Hibernate会话和事务?br />
A JbpmContext allows the user to overwrite重写 (or make complete) the configuration by injecting objects programmatically~程注入对象. like e.g. a hibernate session factory or a hibernate session or any other resource that can be fetched or created from the configuration.

Last but not least, JbpmContext provides convenient方便?access to the most common operations such as getTaskList(String), newProcessInstance(String)loadTaskInstanceForUpdate(long) and save(ProcessInstance).

All the ...ForUpdate(...) methods will automatically save the loaded objects at jbpmContext.close();

所有这些涉及到数据库更新的操作Q都会在jbpmContext.close()调用时被自动保存到数据库中?br />


3QGraphSessionc?业务处理图表会话c,更确切的名字Q业务处理定?会话c?br />






/*

* JBoss, Home of Professional Open Source

* Copyright 2005, JBoss Inc., and individual contributors as indicated

* by the @authors tag. See the copyright.txt in the distribution for a

* full listing of individual contributors.

*

* This is free software; you can redistribute it and/or modify it

* under the terms of the GNU Lesser General Public License as

* published by the Free Software Foundation; either version 2.1 of

* the License, or (at your option) any later version.

*

* This software is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

* Lesser General Public License for more details.

*

* You should have received a copy of the GNU Lesser General Public

* License along with this software; if not, write to the Free

* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA

* 02110-1301 USA, or see the FSF site: http://www.fsf.org.

*/

package org.jbpm.tutorial.db;



import java.util.List;



import junit.framework.TestCase;



import org.jbpm.JbpmConfiguration;

import org.jbpm.JbpmContext;

import org.jbpm.db.GraphSession;

import org.jbpm.graph.def.ProcessDefinition;

import org.jbpm.graph.exe.ProcessInstance;

import org.jbpm.graph.exe.Token;



public class HelloWorldDbTest extends TestCase {



static JbpmConfiguration jbpmConfiguration = null;



static {

// An example configuration file such as this can be found in

// 'src/config.files'. Typically the configuration information is in the

// resource file 'jbpm.cfg.xml', but here we pass in the configuration

// information as an XML string.



// First we create a JbpmConfiguration statically. One JbpmConfiguration

// can be used for all threads in the system, that is why we can safely

// make it static.

/**

*单例对象?br />
*JbpmConfiguration能够被系l中所有线E所使用?br />
*jbpm.cfg.xmlq个命名方式和Hibernate配置文g的命名方式一致?br />
*

*/



jbpmConfiguration = JbpmConfiguration.parseXmlString(

"" +



// A jbpm-context mechanism separates the jbpm core

// engine from the services that jbpm uses from

// the environment.

/*jbpm-context机制在环境中把jbpm核心引擎和jbpm使用的服务分开?br />
* 持久化服务是jbpm核心引擎使用的一个服务?br />
*

* */



" " +

" " +

"
" +



// Also all the resource files that are used by jbpm are

// referenced from the jbpm.cfg.xml

/*

*stringQ配|了所有jbpm使用的资源文件的路径?br />
* */



" " +

" " +

" " +

" " +

" " +

" " +

" " +

"
"

);

}



public void setUp() {

//创徏计划

jbpmConfiguration.createSchema();

}



public void tearDown() {

//删除计划

jbpmConfiguration.dropSchema();

}



public void testSimplePersistence() {

// Between the 3 method calls below, all data is passed via the

// database. Here, in this unit test, these 3 methods are executed

// right after each other because we want to test a complete process

// scenario情节. But in reality, these methods represent different

// requests to a server.



// Since we start with a clean, empty in-memory database, we have to

// deploy the process first. In reality, this is done once by the

// process developer.

/**

* q个Ҏ把业务处理定义通过Hibernate保存到数据库中?br />
*/

deployProcessDefinition();



// Suppose we want to start a process instance (=process execution)

// when a user submits a form in a web application...

/*假设当一个用h交一个表单时Q我们要开始一个业务处理的实例/执行?br />
* q可以在Action中执行处理?br />
*/

processInstanceIsCreatedWhenUserSubmitsWebappForm();



// Then, later, upon the arrival of an asynchronous message the

// execution must continue.

/*

* 然后Q直到异步消息来刎ͼ才l执行业务处理实例的余下的工作流E?br />
* */

theProcessInstanceContinuesWhenAnAsyncMessageIsReceived();

}



public void deployProcessDefinition() {

// This test shows a process definition and one execution

// of the process definition. The process definition has

// 3 nodes: an unnamed start-state, a state 's' and an

// end-state named 'end'.

/*

* q个Ҏ把业务处理定义通过Hibernate保存到数据库中?br />
*

* */

ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(

" " +

" " +

" " +

"
" +

" " +

" " +

"
" +

" " +

"
"

);



// Lookup the pojo persistence context-builder that is configured above

JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();

try {

// Deploy the process definition in the database

jbpmContext.deployProcessDefinition(processDefinition);



} finally {

// Tear down the pojo persistence context.

// This includes flush the SQL for inserting the process definition

// to the database.

/*

* 关闭jbpm上下文。删除pojo持久化上下文?br />
* q包括刷新SQL来真正的把业务处理定义插入到数据库中?br />
* */

jbpmContext.close();

}

}



public void processInstanceIsCreatedWhenUserSubmitsWebappForm() {

// The code in this method could be inside a struts-action

// or a JSF managed bean.



// Lookup the pojo persistence context-builder that is configured above

JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();

try {

/*

* 图表会话Q是图表定义/业务处理定义 相关的数据库层面的会话。应该也是一个Hibernate会话?br />
* 可以从JBpm上下文这个数据库----业务处理定义、实例等 得到 业务处理定义会话?br />
*

* */

GraphSession graphSession = jbpmContext.getGraphSession();

//从数据库中根据业务处理定义的名字得到一个业务处理定义?br />
ProcessDefinition processDefinition =

graphSession.findLatestProcessDefinition("hello world");



// With the processDefinition that we retrieved from the database, we

// can create an execution of the process definition just like in the

// hello world example (which was without persistence).

/*

* 创徏业务处理定义的一个实例?br />
*

* */

ProcessInstance processInstance =

new ProcessInstance(processDefinition);



Token token = processInstance.getRootToken();

assertEquals("start", token.getNode().getName());

// Let's start the process execution

token.signal();

// Now the process is in the state 's'.

assertEquals("s", token.getNode().getName());



// Now the processInstance is saved in the database. So the

// current state of the execution of the process is stored in the

// database.

/*

* 执行一步工作流E后Q用jbpmContext保存q个业务处理实例q数据库?br />
* 所以现在就把业务处理实例的执行状态也保存q了数据库?br />
* 因ؓQ业务处理定义的实例 q个cM是一个Modelc,用于理一个业务处理定义的执行的所有信息,

* 是一个多例模式的Model?br />
*

* */

jbpmContext.save(processInstance);

// The method below will get the process instance back out

// of the database and resume execution by providing another

// external signal.



} finally {

// Tear down the pojo persistence context.

jbpmContext.close();

}

}



public void theProcessInstanceContinuesWhenAnAsyncMessageIsReceived() {

// The code in this method could be the content of a message driven bean.

//q个Ҏ可能在消息驱动Beanq个q程业务代理cM?br />
// Lookup the pojo persistence context-builder that is configured above

JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();

try {



GraphSession graphSession = jbpmContext.getGraphSession();

// First, we need to get the process instance back out of the database.

// There are several options to know what process instance we are dealing

// with here. The easiest in this simple test case is just to look for

// the full list of process instances. That should give us only one

// result. So let's look up the process definition.



ProcessDefinition processDefinition =

graphSession.findLatestProcessDefinition("hello world");



// Now, we search for all process instances of this process definition.

/*

* Ҏ业务处理定义的id得到数据库中所有的业务处理实例。这表明Q数据库中应该存?张表

* 它们?一对多 的关pR?br />
*

* */

List processInstances =

graphSession.findProcessInstances(processDefinition.getId());



// Because we know that in the context of this unit test, there is

// only one execution. In real life, the processInstanceId can be

// extracted from the content of the message that arrived or from

// the user making a choice.

ProcessInstance processInstance =

(ProcessInstance) processInstances.get(0);



// Now we can continue the execution. Note that the processInstance

// delegates signals to the main path of execution (=the root token).

processInstance.signal();



// After this signal, we know the process execution should have

// arrived in the end-state.

assertTrue(processInstance.hasEnded());



// Now we can update the state of the execution in the database

jbpmContext.save(processInstance);



} finally {

// Tear down the pojo persistence context.

jbpmContext.close();

}

}

}



3.3. Context example: process variables

上下文例子:处理变量

The process variables contain the context information during process executions. The process variables are similar to a java.util.Map that maps variable names to values, which are java objects. The process variables are persisted as a part of the process instance. To keep things simple, in this example we only show the API to work with variables, without persistence.

ContextInstancecȝ实例保存 在ProcessInstance中。是它的一个成员对象。是一个MapQ保存名值对。它们会被保存在数据库中?应该是一个独立的表。和业务处理定义的实?执行??#8220;一对多”的关p!

可以在这里保存一些必要的信息Q用于工作流E处理的交流的需要!

More information about variables can be found in Chapter 10, Context

publicclass ContextTest extends TestCase {



publicvoid testContext() {

// Also this example starts from the hello world process.

// This time even without modification.

ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(

" " +

" " +

" " +

"
" +

" " +

" " +

"
" +

" " +

"
"

);



ProcessInstance processInstance =

new ProcessInstance(processDefinition);



// Fetch the context instance from the process instance

// for working with the process variableInstances.

//得到一个mapQ业务处理实例的上下文实例Map。包含业务处理实例的一些上下文信息?br />
ContextInstance contextInstance =

processInstance.getContextInstance();



// Before the process has left the start-state,

// we are going to set some process variableInstances in the

// context of the process instance.

contextInstance.setVariable("amount", new Integer(500));

contextInstance.setVariable("reason", "i met my deadline");



// From now on, these variableInstances are associated with the

// process instance. The process variableInstances are now accessible

// by user code via the API shown here, but also in the actions

// and node implementations. The process variableInstances are also

// stored into the database as a part of the process instance.



processInstance.signal();



// The variableInstances are accessible via the contextInstance.



assertEquals(new Integer(500),

contextInstance.getVariable("amount"));

assertEquals("i met my deadline",

contextInstance.getVariable("reason"));

}



}



3.4. Task assignment exampled委派例子

In the next example we'll show how you can assign a task to a user. Because of the separation between the jBPM workflow engine and the organisational model, an expression language for calculating actors would always be too limited. Therefore, you have to specify an implementation of AssignmentHandler for including the calculation of actors for tasks.

在下一个例子中Q我们将高叔你怎样l一个用户分配Q务。因为jBPM工作引擎和l织的模型时各自独立的,用一U表辑ּ语言来计动作执行者L太受限了。因此,你必L定一个分z֤理器的实现来包括d执行者的计算工作?br />
API参考:

1QQ务实?br />
public class TaskInstance

extends VariableContainer

implements Assignable

is one task instance that can be assigned to an actor (read: put in someones task list) and that can trigger the coninuation of execution of the token upon completion.

是一个Q务实例,它能够被分配l一个用P能够触发工作的l箋执行?br />


publicclass TaskAssignmentTest extends TestCase {



publicvoid testTaskAssignment() {

// The process shown below is based on the hello world process.

// The state node is replaced by a task-node. The task-node

// is a node in JPDL that represents a wait state and generates

// task(s) to be completed before the process can continue to

// execute.

/*

* d节点是一个JPDL的节点,它表CZ个等待状态,生成d被完成之前,业务处理不能执行?br />
*

* */

ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(

" " +

" " +

" " +

"
" +

" " +

" " +

" " +

"
" +

" " +

"
" +

" " +

"
"

);



// Create an execution of the process definition.

ProcessInstance processInstance =

new ProcessInstance(processDefinition);

Token token = processInstance.getRootToken();



// Let's start the process execution, leaving the start-state

// over its default transition.

token.signal();

// The signal method will block until the process execution

// enters a wait state. In this case, that is the task-node.

assertSame(processDefinition.getNode("t"), token.getNode());



// When execution arrived in the task-node, a task 'change nappy'

// was created and the NappyAssignmentHandler was called to determine

// to whom the task should be assigned. The NappyAssignmentHandler

// returned 'papa'.



// In a real environment, the tasks would be fetched from the

// database with the methods in the org.jbpm.db.TaskMgmtSession.

// Since we don't want to include the persistence complexity in

// this example, we just take the first task-instance of this

// process instance (we know there is only one in this test

// scenario.

/*

* 执行CQ务时Q需要执行指定的cR这个类讄了执行者的id?br />
* 在真实环境中Q应该是从数据库中返回Q务,

* org.jbpm.db.TaskMgmtSession

* TaskInstance包含Qid,d名,用户id?br />
* 业务处理实例---d

* 1 n

*

* 用户-------====d

* 1 n

*

* */

TaskInstance taskInstance = (TaskInstance)

processInstance

.getTaskMgmtInstance()

.getTaskInstances()

.iterator().next();



// Now, we check if the taskInstance was actually assigned to 'papa'.

assertEquals("papa", taskInstance.getActorId() );



// Now suppose that 'papa' has done his duties and marks the task

// as done.

taskInstance.end();

// Since this was the last (only) task to do, the completion of this

// task triggered the continuation of the process instance execution.



assertSame(processDefinition.getNode("end"), token.getNode());

}



}

3.5. Custom action example定制动作例子

Actions are a mechanism to bind your custom java code into a jBPM process. Actions can be associated with its own nodes (if they are relevant in the graphical representation of the process). Or actions can be placed on events like e.g. taking a transition, leaving a node or entering a node. In that case, the actions are not part of the graphical representation, but they are executed when execution fires the events in a runtime process execution.

We'll start with a look at the action implementation that we are going to use in our example : MyActionHandler. This action handler implementation does not do really spectacular things不是真的做伟大的事情... it just sets the boolean variable isExecuted to true. The variable isExecuted is static so it can be accessed from within the action handler as well as from the action to verify it's value.

More information about actions can be found in Section 9.5, “Actions”

// MyActionHandler represents a class that could execute

// some user code during the execution of a jBPM process.

publicclass ActionTest extends TestCase {



// Each test will start with setting the static isExecuted

// member of MyActionHandler to false.

publicvoid setUp() {

MyActionHandler.isExecuted = false;

}



publicvoid testTransitionAction() {

// The next process is a variant of the hello world process.

// We have added an action on the transition from state s

// to the end-state. The purpose of this test is to show

// how easy it is to integrate java code in a jBPM process.

ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(

" " +

" " +

" " +

"
" +

" " +

//转向执行Ӟ执行该动?br />
" " +

" " +

"
" +

"
" +

" " +

"
"

);



// Let's start a new execution for the process definition.

ProcessInstance processInstance =

new ProcessInstance(processDefinition);



// The next signal will cause the execution to leave the start

// state and enter the state 's'

processInstance.signal();



// Here we show that MyActionHandler was not yet executed.

assertFalse(MyActionHandler.isExecuted);

// ... and that the the main path of execution is positioned in

// the state 's'

assertSame(processDefinition.getNode("s"),

processInstance.getRootToken().getNode());



// The next signal will trigger the execution of the root

// token. The token will take the transition with the

// action and the action will be executed during the

// call to the signal method.

processInstance.signal();



// Here we can see that MyActionHandler was executed during

// the call to the signal method.

assertTrue(MyActionHandler.isExecuted);

}

The next example shows the same action, but now the actions are placed on the enter-nodeq入节点事g and leave-node events d节点事grespectively. Note that a node has more then one event type in contrast to a transition, which has only one event. Therefore actions placed on a node should be put in an event element.

Transition转向只有一个节炏V?br />


publicvoid testNodeActions() {

ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(

" " +

" " +

" " +

"
" +

" " +

//节点q入事gQ进入节ҎQ事件激zR执行该动作?br />
" " +

" " +

"
" +

//节点d事gQ离开节点Ӟ事gȀzR执行该动作?br />
" " +

" " +

"
" +

" " +

"
" +

" " +

"
"

);



ProcessInstance processInstance =

new ProcessInstance(processDefinition);



assertFalse(MyActionHandler.isExecuted);

// The next signal will cause the execution to leave the start

// state and enter the state 's'. So the state 's' is entered

// and hence因此 the action is executed.

processInstance.signal();

assertTrue(MyActionHandler.isExecuted);



// Let's reset the MyActionHandler.isExecuted

MyActionHandler.isExecuted = false;



// The next signal will trigger execution to leave the

// state 's'. So the action will be executed again.

processInstance.signal();

// Voila.

assertTrue(MyActionHandler.isExecuted);

}

}





动作c?br />
publicclass MyActionHandler implements ActionHandler {



privatestaticfinallongserialVersionUID = 1L;



// Before each test (in the setUp), the isExecuted member

// will be set to false.

publicstaticbooleanisExecuted = false;



// The action will set the isExecuted to true so the

// unit test will be able to show when the action

// is being executed.

publicvoid execute(ExecutionContext executionContext) {

isExecuted = true;

}

}



API参考:

1Q?br />
ExecutionContext 执行上下文类?br />
作ؓ参数回调模式的参敎ͼ用于得到业务处理实例的东ѝ?br />
JbpmContext
getJbpmContext()


Node
getNode()


ProcessDefinition
getProcessDefinition()


ProcessInstance
getProcessInstance()



可以通过它得到所?#8220;业务处理”相关的对象?br />


C物 2007-09-06 12:29 发表评论
]]>
jBPM3.12用户指南中文译----W一?l论http://www.aygfsteel.com/libin2722/articles/143135.htmlC物C物Thu, 06 Sep 2007 04:19:00 GMThttp://www.aygfsteel.com/libin2722/articles/143135.htmlhttp://www.aygfsteel.com/libin2722/comments/143135.htmlhttp://www.aygfsteel.com/libin2722/articles/143135.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/143135.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/143135.html        同时Q对于其中的部分内容Q我会在译中做释?br /> 下面是从|络上找到的W一章,q是jBPM3.0的用h南的译文。但是第一章,3.0?.1内容相差不大Q我׃做翻译了。直接用这一?br />

目录

W一?/span>l论

 JBoss jBPM 是一个灵zȝQ易扩展的工作流理pȝ?/span>JBoss jBPM有一套直观的程建模语言Q这套语a能用dQ?/span>taskQ,异步通信的等待状态(wait state Q,定时器(timerQ,自动化的动作Q?/span>automated actionQ等来图形化的表CZ务流E。ؓ了把q些操作集成在一

PJBoss jBPM拥有强大的,易扩展的控制程机制?/span>

JBoss jBPM对外依赖E度很小Q你完全可以像用java的类库一L它。ƈ且它也可以被部v在高性能?/span>J2EE集群应用服务器上?/span>

JBoss jBPM能配|在M数据库上Qƈ且能被部|在M的应用服务器上?/span>

1.1 总览

 工作和业务程处理功能的核心部分被打包成一个简单的javacd。这个类库包括了q样一个服务:程信息的存储,更新Q和从数据库中重新取回?/span>

   

?/span>1.1Q?/span>JBoss jBPMl成模块的概略图

1.2 JBoss jBPM starter kit

starter kit是一个包?/span>jbpm所有模块的下蝲包。这个下载包中包括以下模块:

·                                 jbpm-server, 一个预选配|好的jboss应用服务器?/span>

·                                 jbpm-designer, 囑Ş化定制流E的eclipse插g?/span>

·                                 jbpm-db, jBPM的数据库兼容?(见后边论q??/span>

·                                 jbpm, jbpm的核心模块,其中包括libs文g夹和q个用户说明?/span>

·                                 jbpm-bpel, JBoss jBPM对BPEL扩展的一些参考资?/span>

预先配置好的JBoss应用服务器具有如下组成部分:

jBPM核心模块Q被打包成一个用于提供服务的存档文g

带有jbpm表的集成数据?/span>Q默认的hypersonic数据库拥?/span>jbpm表,q且q个表已l拥有一个流E了?/span>

Jbpm?/span>web控制?/span>Q它既可以被Jbpm理员用也可以被程的参与者用?/span>

执行定时器的Jbpm的调度程序,q个调度E序?/span>starter kit里边被配|成一?/span>servlet。这?/span>servlet会生一个新的线E来监视和执行定时器?/span>

一个具体流E的例子Q它已经被部|在jbpm数据库中了?/span>

1.3 JBoss jBPM 程囑Ş定制?/span>

JBoss jBPMq拥有一套图形化的设计工兗这个设计器是一个图形化的业务流E定制工兗?/span>

JBoss jBPM程囑Ş定制器是eclipse的一个插件。单独安装这个定制器非常单?/span>

q个囑Ş设计器最重要的特性是Q业务分析h员也能像技术开发h员一L它来完成d。这使得业务程建模能^滑的转换到具体技术实现?/span>

q个插g可以利用eclipse的一般升U机刉过一个升U站点得到安装(zip文g格式Q。也可以通过解压一个特定的包到eclipse的安装目录来安装此插件?/span>

1.4 JBoss jBPM的核心模?/span>

JBoss jBPM的核心模块是一个用来管理流E定义和程实例的执行环境的普?/span>javaE序?/span>

JBoss jBPM是一?/span>javacd。所以它可以被用在Q?/span>java环境中,比如Q?/span>web应用E序Q?/span>swing应用E序Q?/span>EJBQ?/span>web service……?/span>JBPMcdq可以被打包q被当成无状态会?/span>EJBQ?/span>stateless session EJBQ用。这样可使它被部|在集群上ƈ且适应高性能应用。这些无状态会?/span>EJB必须W合J2EE1.3规范q样才能使它可以被部|在M应用服务器上?/span>

JBoss jBPM的核心模块被打包成一个简单的java库文件。依你功能的需要,jbpm-3.0.jarq个库文件对一些第三方的类库比?/span>hibernate, dom4j有所依赖。这些依赖在W五章(部vQ中作了详细的说明?/span>

至于持久化,JBPM在内部用?/span>hibernate。除了传l的O/R映射功能Q?/span>hibernateq解决了不同数据SQL dialect差异的问题,q?/span>JBPM能适应现在所有的数据库?/span>

JBoss jBPM API可以被你工程中Q何的java代码调用Q比如,你的web应用E序Q?/span>EJBQ?/span>web service 模块Q消息驱?/span>bean或其它Q?/span>java模块?/span>

1.5 JBoss jBPM web应用E序的控制台

jBPM web应用E序的控制台提供两种服务。首先,它被用来当作一个用来和程执行q程中生的dq行交互的主要用h口,其次Q它q是一个用来检查和操作q行实例的管理和监控q_?/span>

1.6 JBoss jBPM人员l织模块

JBoss jBPM可以和Q何包括h员和其他l织信息的公司结构集成在一赗但是对那些l织l构信息模块很难获取的项目,JBoss jBPM提供了这个模块。这个模块用的模型要比传统?/span>servlet, ejb,portlet模型丰富的多?/span>

更多信息Q请参照W九章第九节人员l织模块

1.7 JBoss jBPM调度E序

JBoss jBPM调度E序是一个用来监和执行在流E执行过E中讄的定时器的模块?/span>

定时器模块被打包?/span>jbpm的核心包中,但是它必被部v在以下环境中Q或者你必须订制一个调?/span>servletQ它来生一个监线E,或者你必须启动一个单独的JVM来执行调度程序?/span>

1.8 JBoss jBPM 数据库兼容包

JBoss jBPM 数据库兼容包是一个下载包Q它包括所有的资料Q?/span>drivers?/span>scripts,用这些你可以?/span>jbpmq行在你选择的数据库上?/span>

1.9 JBoss jBPM BPE的扩?/span>

JBoss jBPM BPE的扩展是一个ؓ了支?/span>BPEL独立的扩展包?/span>BPEL的本质就是一l用来参照别?/span>web service?/span>web service?/span>xml脚本语言?/span>



C物 2007-09-06 12:19 发表评论
]]>
վ֩ģ壺 ʦ| | | Į| | | | ƽ| ³ɽ| ߱| | | | ĩ| ƽ| | | ƽ| ˳ƽ| | | | | | | ƽ| | | ƽ| ƽ| º| | | | | | Ϫ| | ɽ| | |