jbpm-jpdl-3.2.3 的学习之路_第一天

来源:互联网 发布:webuploader php接收 编辑:程序博客网 时间:2024/06/05 10:24

one day
下载各种软件:
  http://developer.51cto.com/art/200906/128273.htm
只需要下这里面的软件就行

如果需要为sql文件加分号的,我把代码符上

private final static String FILE_PATH="E:\\self\\jbpm3.2.3\\jbpm-jpdl-3.2.3\\db\\jbpm.jpdl.mysql.sql";private final static String FILE_PATH_NEW="E:\\self\\jbpm3.2.3\\jbpm-jpdl-3.2.3\\db\\jbpm.jpdl.mysql.new.sql";/** * @param args */public static void main(String[] args) {File file=new File(FILE_PATH);try {BufferedReader read=new BufferedReader(new FileReader(file));List<String> list=new ArrayList<String>();String s=read.readLine();while(s!=null){list.add(s+";");s=read.readLine();}read.close();BufferedWriter writer=new BufferedWriter(new FileWriter(FILE_PATH_NEW));for(String str:list){writer.write(str);writer.newLine();}writer.close();} catch (FileNotFoundException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}System.out.println("创建新的文件完成");}



开始我的helloworld.
用eclipse新建一个helloworld的java项目
导入:commons-logging.jar/jbpm-jpdl.jar/dom4j.jar
先写一个junit的类:

import org.jbpm.graph.def.ProcessDefinition;import org.jbpm.graph.exe.ProcessInstance;import org.jbpm.graph.exe.Token;import junit.framework.TestCase;public class HelloWorld extends TestCase { public void testHelloWorld(){  //创建各节点流程的xml文件  StringBuffer sb=new StringBuffer();  sb.append("<process-definition><start-state><transition to='s'/></start-state>");  sb.append("<state name='s'><transition to='end'/></state><end-state name='end'/>");  sb.append("</process-definition>");  ProcessDefinition processDefinition=ProcessDefinition.parseXmlString(sb.toString());  ProcessInstance processInstance=new ProcessInstance(processDefinition);  Token token = processInstance.getRootToken();  assertSame(processDefinition.getStartState(), token.getNode());  token.signal();  assertSame(processDefinition.getNode("s"), token.getNode());  token.signal();  assertSame(processDefinition.getNode("end"), token.getNode()); }}



以上代码来自于3.2学习手册.
代码的功能先不说了。。我也不是很清楚。呵呵..看到縁条在说
右键运行。。红的。。。
org.jbpm.JbpmException: couldn't parse jbpm configuration from resource 'jbpm.cfg.xml'
在网上找啊找。。
答案来了:
在jpdl根目录下的config文件夹内将jbpm.cfg.xml直接复制这个文件到src目录下
縁条出现。。

==========写完了才想起来我把eclipse的插件已经安装上面了=====

安装方法:

在jbpm-jpdl-3.2.3\designer下将eclipse文件夹,copy到你的ecplise哪里,盖上去。重启一下eclipse就OK了

原创粉丝点击