断点

每天进步一点点!
posts - 174, comments - 56, trackbacks - 0, articles - 21

2010年10月5日

1、http://www.jar114.com/site.html
该网站可以提供我们项目中经常需要的jar包,如果缺少包,就可以在这里查找。

posted @ 2010-10-07 11:54 断点 阅读(409) | 评论 (1)编辑 收藏

流程定义文件*.jpdl.xml中如果有中文乱码,肯定是task中有中文。

需要在eclipse安装软件下,即E:\eclipse\eclipse.ini增加
-Dfile.encoding=UTF-8
然后重启eclipse即可解决。

posted @ 2010-10-05 21:06 断点 阅读(795) | 评论 (0)编辑 收藏

配置jbpm4工程的运行环境:
1、添加依赖库。
E:\JBPM\jbpm-4.3\jbpm.jar
E:\JBPM\jbpm-4.3\lib下的jar包。

2、添加配置文件。
E:\JBPM\jbpm-4.3\examples\src下的配置文件拷贝到自己java工程的src下。

---------------------------------------------------------------
管理流程定义:发布流程定义、查看流程定义、删除流程定义。
RepositoryService repositoryService = processEngine.getRepositoryService();

String deploymentId = repositoryService.createDeployment().addResourceFromClasspath

("helloworld.jpdl.xml").deploy();
List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().list();  
repositoryService.deleteDeploymentCascade(deploymentId);
---------------------------------------------------------------

管理流程实例:发起新流程、执行等待的流程、查看流程实例、终止流程实例、删除流程实例。
ExecutionService executionService = processEngine.getExecutionService();

ProcessInstance pi = executionService.startProcessInstanceByKey("helloworld");
ProcessInstance pi = executionService.signalExecutionById(pi.getId()); //执行等待的流程.
List<ProcessInstance> list = executionService.createProcessInstanceQuery().list();
executionService.endProcessInstance(pi.getId(), "cancel");
executionService.deleteProcessInstanceCascade(pi.getId());


TaskService taskService = processEngine.getTaskService();
taskService.completeTask(taskId, map);

控制流程的活动:Start、End、Decision、Fork、Join、Sub-process、State、task.
原子活动:java、script、sql、hql、email。

posted @ 2010-10-05 21:01 断点 阅读(438) | 评论 (0)编辑 收藏

配置开发环境:
1、jbpm4:http://sourceforge.net/projects/jbpm/files/ 下选择jbpm-4.3.zip  137.9M

2、eclipse3.5版本以上 : http://www.eclipse.org/downloads/ 下选择 Eclipse IDE for Java EE  190M

3、GPD (Graphical Process Designer)插件,路径:E:\jbpm-4.3\install\src\gpd\jbpm-gpd-site.zip。
通过Eclipse-->help-->Install New Software-->Add-->Archive到插件所在路径。

 

posted @ 2010-10-05 16:37 断点 阅读(696) | 评论 (1)编辑 收藏

java.lang.NullPointerException
 at jxl.read.biff.File.<init>(File.java:77)
 at jxl.Workbook.getWorkbook(Workbook.java:250)
 at jxl.Workbook.getWorkbook(Workbook.java:235)
 at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:76)
 at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:89)
 at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:68)
 at com.sample.DecisionTableTest.readDecisionTable(DecisionTableTest.java:59)
 at com.sample.DecisionTableTest.main(DecisionTableTest.java:36)

Drools调用readDecisionTable()方法里面一处为:
InputStream is = DecisionTableTest.class.getResourceAsStream("rules\\Sample.xls");
final String drl = converter.compile( is, InputType.XLS );  
     
需改为如下,取的class即错误解决。
InputStream is = DecisionTableTest.class.getClassLoader().getResourceAsStream("rules\\Sample.xls");
final String drl = converter.compile( is, InputType.XLS );

posted @ 2010-10-05 00:39 断点 阅读(684) | 评论 (0)编辑 收藏

org.mvel.CompileException: can not resolve identifier: 'declr'
 at org.mvel.ASTNode.getReducedValue(ASTNode.java:315)
 at org.mvel.ast.PropertyASTNode.getReducedValue(PropertyASTNode.java:29)
 at org.mvel.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:103)
 at org.mvel.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:51)
 at org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:428)
 at org.mvel.TemplateInterpreter.parse(TemplateInterpreter.java:320)
 at org.drools.rule.builder.dialect.java.AbstractJavaBuilder.generatTemplates(AbstractJavaBuilder.java:113)
 at org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:95)
 at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:67)
 at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)
 at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)
 at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
 at com.sample.DecisionTableTest.readDecisionTable(DecisionTableTest.java:63)
 at com.sample.DecisionTableTest.main(DecisionTableTest.java:36)

替换mvel.jar为mvel14-1.2.10.jar后不再报错,好像是jar包的问题。
看了下jar包里面的org.mvel.ASTNode.getReducedValue方法已经注释掉了。

posted @ 2010-10-05 00:32 断点 阅读(702) | 评论 (0)编辑 收藏

WARNING: Wasn't able to correctly close stream for decision table. nulljava.lang.NullPointerException
 at jxl.read.biff.File.<init>(File.java:77)
 at jxl.Workbook.getWorkbook(Workbook.java:250)
 at jxl.Workbook.getWorkbook(Workbook.java:235)
 at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:76)
 at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:89)
 at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:68)
 at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:110)
 at com.sample.DecisionTableTest.readDecisionTable(DecisionTableTest.java:57)
 at com.sample.DecisionTableTest.main(DecisionTableTest.java:35)

在web项目中的原先的写法为:
final String drl = converter.compile( "rules\\Sample.xls", InputType.XLS );

参考了下别人的写法,改为下面的方式进行处理:  
InputStream is = DecisionTableTest.class.getClassLoader().getResourceAsStream("rules\\Sample.xls");
final String drl = converter.compile( is, InputType.XLS );

posted @ 2010-10-05 00:22 断点 阅读(602) | 评论 (0)编辑 收藏