From 177ffee766aea67c4cd62f01edd906849a2963bc Mon Sep 17 00:00:00 2001 From: Henry Yan Date: Fri, 25 Jan 2013 13:12:20 +0800 Subject: [PATCH 001/173] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e683d29e74..db00747311 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Demo提供Maven版本和no-maven版本,分别适用于会用mavne和不会用m ## Changelog -### 1.6.0(2013-01-06) +### 1.6.0(2013-01-06):+1: 1. 添加多实例(发文会签)演示 2. 添加自动部署流程定义演示 From e4af863f29963a7ad5c72e76e84497f8a5ab20bb Mon Sep 17 00:00:00 2001 From: Henry Yan Date: Thu, 7 Feb 2013 23:11:10 +0800 Subject: [PATCH 002/173] =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=9A=84=E5=9B=BE=E7=89=87=E6=97=B6=E4=BB=8E?= =?UTF-8?q?=E9=9D=99=E6=80=81=E6=9C=8D=E5=8A=A1=E8=AF=BB=E5=8F=96=EF=BC=8C?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=EF=BC=9Ahttp://localhost:10000/leave-formkey?= =?UTF-8?q?/1/leave-formkey.png?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WorkflowProcessDefinitionService.java | 259 ++++++++++-------- .../demo/activiti/util/WorkflowUtils.java | 92 +++++-- .../web/workflow/ActivitiController.java | 50 ++-- src/main/resources/application.properties | 5 +- src/main/resources/applicationContext.xml | 79 ++---- .../dynamic/dynamic-form-process-list.jsp | 2 +- .../form/formkey/formkey-process-list.jsp | 2 +- .../WEB-INF/views/form/running-list.jsp | 4 +- .../webapp/WEB-INF/views/oa/leave/running.jsp | 2 +- .../WEB-INF/views/workflow/process-list.jsp | 11 +- src/main/webapp/common/global.jsp | 9 +- .../webapp/js/module/activiti/workflow.js | 4 +- .../activiti/process/ProcessTestDispatch.java | 7 - .../oa/leave/LeaveWorkflowServiceTest.java | 2 +- .../web/workflow/ActivitiControllerTest.java | 4 +- 15 files changed, 312 insertions(+), 220 deletions(-) diff --git a/src/main/java/me/kafeitu/demo/activiti/service/activiti/WorkflowProcessDefinitionService.java b/src/main/java/me/kafeitu/demo/activiti/service/activiti/WorkflowProcessDefinitionService.java index 1d92319863..b424884fb2 100644 --- a/src/main/java/me/kafeitu/demo/activiti/service/activiti/WorkflowProcessDefinitionService.java +++ b/src/main/java/me/kafeitu/demo/activiti/service/activiti/WorkflowProcessDefinitionService.java @@ -2,12 +2,16 @@ import java.io.IOException; import java.io.InputStream; +import java.util.List; import java.util.zip.ZipInputStream; +import me.kafeitu.demo.activiti.util.WorkflowUtils; + import org.activiti.engine.HistoryService; import org.activiti.engine.RepositoryService; import org.activiti.engine.RuntimeService; import org.activiti.engine.history.HistoricProcessInstance; +import org.activiti.engine.repository.Deployment; import org.activiti.engine.repository.ProcessDefinition; import org.apache.commons.lang3.ArrayUtils; import org.slf4j.Logger; @@ -22,124 +26,149 @@ * 工作流中流程以及流程实例相关Service * * @author HenryYan - * + * */ @Service public class WorkflowProcessDefinitionService { - protected Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - protected RuntimeService runtimeService; - - @Autowired - protected RepositoryService repositoryService; - - @Autowired - protected HistoryService historyService; - - /** - * 根据流程实例ID查询流程定义对象{@link ProcessDefinition} - * @param processInstanceId 流程实例ID - * @return 流程定义对象{@link ProcessDefinition} - */ - public ProcessDefinition findProcessDefinitionByPid(String processInstanceId) { - HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() - .processInstanceId(processInstanceId).singleResult(); - String processDefinitionId = historicProcessInstance.getProcessDefinitionId(); - ProcessDefinition processDefinition = findProcessDefinition(processDefinitionId); - return processDefinition; - } - - /** - * 根据流程定义ID查询流程定义对象{@link ProcessDefinition} - * @param processDefinitionId 流程定义对象ID - * @return 流程定义对象{@link ProcessDefinition} - */ - public ProcessDefinition findProcessDefinition(String processDefinitionId) { - ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery() - .processDefinitionId(processDefinitionId).singleResult(); - return processDefinition; - } - - /** - * 部署classpath下面的流程定义 - * 从属性配置文件中获取属性workflow.modules扫描**deployments** - * 然后从每个**deployments/${module}**查找在属性配置文件中的属性**workflow.module.keys.${submodule}** - * 配置实例: - * - * #workflow for deploy - * workflow.modules=budget,erp,oa - * workflow.module.keys.budget=budget - * workflow.module.keys.erp=acceptInsurance,billing,effectInsurance,endorsement,payment - * workflow.module.keys.oa=caruse,leave,officalstamp,officesupply,out,overtime - *
从属性配置文件中获取属性workflow.modules扫描**deployments**
然后从每个**deployments/${module}**查找在属性配置文件中的属性**workflow.module.keys.${submodule}** - *
配置实例: - *
- * #workflow for deploy - * workflow.modules=budget,erp,oa - * workflow.module.keys.budget=budget - * workflow.module.keys.erp=acceptInsurance,billing,effectInsurance,endorsement,payment - * workflow.module.keys.oa=caruse,leave,officalstamp,officesupply,out,overtime - *
+ * 从属性配置文件中获取属性workflow.modules扫描**deployments** + *
+ * 然后从每个**deployments/${module}**查找在属性配置文件中的属性**workflow.module.keys.${ + * submodule}** + *
+ * 配置实例: + * + *
+ * #workflow for deploy + * workflow.modules=budget,erp,oa + * workflow.module.keys.budget=budget + * workflow.module.keys.erp=acceptInsurance,billing,effectInsurance,endorsement,payment + * workflow.module.keys.oa=caruse,leave,officalstamp,officesupply,out,overtime + *