首先!要安装JBPM的插件。

 

使用的是 jbpm-jpdl-designer-site-3.1.7!在myEclipse 图标点属性,查找目标

D:/Program Files/Genuitec/MyEclipse 7.5/dropins

 

把以上插件安入dropins 既可!

 

JbpmConfiguration jbpmConfiguration =JbpmConfiguration.getInstance();
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
ProcessDefinuration pd = jbpmConfiguration.parseParResource("helloworld/helloworld.zip");


        创建表结构
        部署预定义的processDefinition
        创建/启动流程实例
 // 办理任务(循环)
 // 3,获取我的任务列表

 // 4,开始任务

      / / 5,结束任务

使用Hibernate 的API
首先要在hibernate.cfg.xml
<property name="hbm2ddl">update|save|..</property> 每
public void createDa(){

 new Configuration().config().createSessionFactory();

}

部署这个预定义的实例

public void destory(){
 
  JbpmConfiguration jbpmCOnfiguration = JbpmConfiguration.getInstatice();//
  JbpmContext jbpmContext =  jbpmConfiguration.createJbpmContext();
  ProcessDefinition processDefinition = ProcessDefinition.parseParResource("helloworld/helloworld.zip");

  jbpmContext.destoryProcessDefinition(processDefinition);

}

  创建/启动流程实例

  public void createPdInstance(){

   JbpmConfiguration jbpmCOnfiguration = JbpmConfiguration.getInstatice();//
   JbpmContext jbpmContext =  jbpmConfiguration.createJbpmContext();
   ProcessDefinition pd = jbpmContext.getGraphSession().findLatesProcessDefinition("helloworld");
   ProcessInstance pi =   pd.createProcessInstanice();
  pi.getRootTesk().sigle();
}