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

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 block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.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了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值