- 浏览: 3420873 次
- 性别:
- 来自: 珠海
文章分类
- 全部博客 (1633)
- Java (250)
- Android&HTML5 (111)
- Struts (10)
- Spring (236)
- Hibernate&MyBatis (115)
- SSH (49)
- jQuery插件收集 (55)
- Javascript (145)
- PHP (77)
- REST&WebService (18)
- BIRT (27)
- .NET (7)
- Database (105)
- 设计模式 (16)
- 自动化和测试 (19)
- Maven&Ant (43)
- 工作流 (36)
- 开源应用 (156)
- 其他 (16)
- 前台&美工 (119)
- 工作积累 (0)
- OS&Docker (83)
- Python&爬虫 (28)
- 工具软件 (157)
- 问题收集 (61)
- OFbiz (6)
- noSQL (12)
最新评论
-
HEZR曾嶸:
你好博主,这个不是很理解,能解释一下嘛//左边+1,上边+1, ...
java 两字符串相似度计算算法 -
天使建站:
写得不错,可以看这里,和这里的这篇文章一起看,有 ...
jquery 遍历对象、数组、集合 -
xue88ming:
很有用,谢谢
@PathVariable映射出现错误: Name for argument type -
jnjeC:
厉害,困扰了我很久
MyBatis排序时使用order by 动态参数时需要注意,用$而不是# -
TopLongMan:
非常好,很实用啊。。
PostgreSQL递归查询实现树状结构查询
参考: http://www.iteye.com/topic/1130389
database不能使用
,否在很慢,应该使用
自动部署的配置:
pom.xml
web.xml
src/main/resources/applicationContext.xml
src/main/webapp/WEB-INF/spring-mvc.xml
src/main/resources/MyProcess.bpmn
TestController.java
http://localhost:8080/activiti_demo/a/t
开始执行工作流的方法
发布
4
启动
9
遍历所有
#Task available: 926:User Task
complete#Task: 926:User Task
18
遍历所有
22
问题:为什么耗时那么多?待解决。
database不能使用
<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://192.168.0.196:3306/activiti_demo" /> <property name="username" value="root" /> <property name="password" value="" /> </bean>
,否在很慢,应该使用
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://192.168.0.196:3306/activiti_demo" /> <property name="username" value="root" /> <property name="password" value="" /> </bean>
自动部署的配置:
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"> ... <property name="deploymentResources" value="classpath*:/org/activiti/spring/test/autodeployment/autodeploy.*.bpmn20.xml" /> </bean>
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.pandy</groupId> <artifactId>activiti_demo</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>activiti_demo</name> <url>http://maven.apache.org</url> <properties> <spring.version>3.1.2.RELEASE</spring.version> <activiti.version>5.13</activiti.version> <spring-data-jpa.version>1.3.4.RELEASE</spring-data-jpa.version> <commons-dbcp.version>1.4</commons-dbcp.version> <commons-io.version>2.4</commons-io.version> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <!-- Activiti --> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-engine</artifactId> <version>${activiti.version}</version> </dependency> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-spring</artifactId> <version>${activiti.version}</version> </dependency> <!-- Spring --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> <version>${spring-data-jpa.version}</version> <exclusions> <exclusion> <groupId>junit</groupId> <artifactId>junit-dep</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <!-- WEB begin --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <!-- mysql --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.26</version> </dependency> <!-- dbcp connection pool --> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>${commons-dbcp.version}</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>${commons-io.version}</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2.2</version> </dependency> </dependencies> <repositories> <repository> <id>Alfresco Maven Repository</id> <url>https://maven.alfresco.com/nexus/content/groups/public/</url> </repository> </repositories> <build> <finalName>activiti_demo</finalName> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.3.v20120416</version> <configuration> <webApp> <contextPath>/activiti_demo</contextPath> </webApp> </configuration> </plugin> </plugins> </build> </project>
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>activiti5.9web</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:/applicationContext.xml </param-value> </context-param> <!--Spring的ApplicationContext 载入 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- Spring MVC Servlet --> <servlet> <servlet-name>springServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring-mvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
src/main/resources/applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd"> <context:component-scan base-package="com"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan> <bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://192.168.0.196:3306/activiti_demo" /> <property name="username" value="root" /> <property name="password" value="" /> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"> <property name="dataSource" ref="dataSource" /> <property name="transactionManager" ref="transactionManager" /> <property name="databaseSchemaUpdate" value="true" /> <property name="jobExecutorActivate" value="false" /> </bean> <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"> <property name="processEngineConfiguration" ref="processEngineConfiguration" /> </bean> <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/> <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/> <bean id="formService" factory-bean="processEngine" factory-method="getFormService"/> <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService"/> <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/> <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/> <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/> <!-- Activiti end --> </beans>
src/main/webapp/WEB-INF/spring-mvc.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"> <!-- 自动扫描且只扫描@Controller --> <context:component-scan base-package="com" use-default-filters="false"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> </context:component-scan> <mvc:annotation-driven /> <mvc:default-servlet-handler /> <!-- 定义JSP --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/" /> <property name="suffix" value=".jsp" /> </bean> </beans>
src/main/resources/MyProcess.bpmn
<?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> <process id="myProcess" name="My process" isExecutable="true"> <startEvent id="startevent1" name="Start"></startEvent> <userTask id="usertask1" name="User Task" activiti:assignee="test"></userTask> <endEvent id="endevent1" name="End"></endEvent> <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow> <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess"> <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess"> <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> <omgdc:Bounds height="35.0" width="35.0" x="110.0" y="90.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> <omgdc:Bounds height="55.0" width="105.0" x="310.0" y="200.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> <omgdc:Bounds height="35.0" width="35.0" x="710.0" y="240.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> <omgdi:waypoint x="127.0" y="125.0"></omgdi:waypoint> <omgdi:waypoint x="362.0" y="200.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> <omgdi:waypoint x="415.0" y="227.0"></omgdi:waypoint> <omgdi:waypoint x="727.0" y="227.0"></omgdi:waypoint> <omgdi:waypoint x="727.0" y="240.0"></omgdi:waypoint> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </definitions>
TestController.java
package com; import org.activiti.engine.RepositoryService; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.annotation.Resource; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created with IntelliJ IDEA. * User: pandy * Date: 13-9-16 * Time: 上午9:36 * To change this template use File | Settings | File Templates. */ @Controller @RequestMapping("/a") public class TestController { @Resource(name = "taskService") private TaskService taskService; @Resource(name = "runtimeService") private RuntimeService runtimeService; @Resource(name = "repositoryService") private RepositoryService repositoryService; @RequestMapping("/t") public String mytest() { System.out.println("开始执行工作流的方法"); Date d1=new Date(); //发布 System.out.println("发布"); repositoryService.createDeployment() .addClasspathResource("MyProcess.bpmn") .deploy(); time(d1); Map<String, Object> variables = new HashMap<String, Object>(); /* variables.put("employeeName", "Kermit"); variables.put("numberOfDays", new Integer(4)); variables.put("vacationMotivation", "I'm really tired!");*/ //启动 System.out.println("启动"); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess", variables); time(d1); //遍历任务 System.out.println("遍历所有"); //List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup("management").list(); //List<Task> tasks = taskService.createTaskQuery().taskCandidateUser("test").list(); List<Task> tasks = taskService.createTaskQuery().list(); for (Task task : tasks) { System.out.println("#Task available: " + task.getId() + ":" + task.getName()); Map<String, Object> taskVariables = new HashMap<String, Object>(); taskService.complete(task.getId(), taskVariables); System.out.println("complete#Task: " + task.getId() + ":" + task.getName()); } time(d1); //查看任务 System.out.println("遍历所有"); tasks = taskService.createTaskQuery().list(); for (Task task : tasks) { System.out.println("@Task available: " + task.getId() + ":" + task.getName()); } time(d1); return "index"; } private void time(Date d1){ Date d2 = new Date(); long l = d2.getTime()-d1.getTime(); System.out.println(l/1000); } }
http://localhost:8080/activiti_demo/a/t
开始执行工作流的方法
发布
4
启动
9
遍历所有
#Task available: 926:User Task
complete#Task: 926:User Task
18
遍历所有
22
问题:为什么耗时那么多?待解决。
发表评论
-
drools 规则文件 —— 语法
2014-06-09 21:53 3416原文:http://liureying.blog.163.co ... -
使用eclipse创建bpmn2文件的一些问题
2014-06-07 15:18 1728使用bpmn2 diagram Editor编辑器的问题 1 ... -
JBPM6入门资料: Spring4 + Hibernate4 + JBPM6整合
2014-05-21 19:39 18772参考资料: =============== ... -
我的Activiti例子
2013-09-21 15:01 6897Spring 与Activiti的入门整合 http://ww ... -
各种状态的任务查询以及和业务对象关联
2013-09-21 14:26 1942http://www.kafeitu.me/activiti/ ... -
Activiti: 三种部署方式和几种启动方式
2013-09-20 00:24 4715三种部署: 1.自动部署: <property name ... -
Activiti modeler 国际化要点
2013-09-18 15:33 25401. 界面文本:src/main/resources/sten ... -
两篇整合Activiti Modeler到业务系统
2013-09-17 14:29 8694整合Activiti Modeler到业务系统(或BPM平台) ... -
Activiti5.12共22张表
2013-09-17 14:10 1959(1)用户管理表 ACT_ID_GROUP; ... -
Activiti: 关于表单的一些接口
2013-09-17 09:31 2480获得流程启动的时候的表单信息 ProcessInstance ... -
Activiti5: TaskQuery查询API
2013-09-16 13:34 3465http://blog.csdn.net/iflow/arti ... -
kft-activiti-demo: 部署记录
2013-09-13 17:36 20092.SpringMvc + Activiti + Hibern ... -
SSH 整合 Activiti
2013-09-09 14:45 2015原文:http://blog.chinaunix.net/ui ... -
Activiti BPM Platform工作流的一些资料
2013-09-03 16:07 2925Activiti官方: http://www.activiti ... -
JBPM5.4发送email
2013-05-29 15:57 2073JBPM5.4配置参考: http://panyongzhen ... -
Spring3.1 + Hibernate4.2.1 + JBPM5.4 + Ehache整合例子
2013-05-29 11:17 9472pom.xml ----------------------- ... -
JBPM5 Designer 2.3源码问题
2013-05-24 09:50 2336最新本2.4发布,但是里面是使用Maven的module方式来 ... -
Spring 3 & jBPM 5 & LocalTaskService
2013-05-24 09:52 1820帖子地址:https://community.jboss.or ... -
JBPM Designer 部署
2013-05-24 09:53 1627版本:2.4 把war放到tomcat下面之后,进入的url是 ... -
Dynamic Process Creation Using API [JBPM 5.1]
2013-05-23 08:53 1726http://atulkotwale.blogspot.com ...
相关推荐
activiti-spring-5.13.jar
1. **快速入门**:介绍如何安装和配置Activiti,以及如何启动第一个流程实例。 2. **BPMN 2.0 知识**:BPMN(Business Process Model and Notation)是一种标准化的语言,用于描述业务流程。手册会解释各种图形元素...
Activiti 是一个开源的工作流和业务流程管理(BPM)引擎,它被广泛用于企业级应用中,以实现流程自动化。版本5.13是该引擎的一个特定版本,包含了对某些功能的改进和修复。本篇文章将深入探讨Activiti 5.13中的关键...
NULL 博文链接:https://whatisjavabean.iteye.com/blog/2017035
本项目是关于"activiti+spring+spring Mvc+mybatis+maven"的整合,旨在创建一个基于Activiti工作流引擎、Spring、Spring MVC、MyBatis以及Maven的开发环境。下面将详细介绍这些技术及其整合过程。 首先,`activiti`...
Activiti5.13帮助文档.CHM
Activiti 5.13 版本是该引擎的一个重要迭代,它提供了丰富的功能和改进,使得开发者能够更有效地设计、实现和管理业务流程。 Eclipse 插件是集成开发环境(IDE)的一种扩展,它可以增强 Eclipse 的功能,使其更...
Activiti 是一个开源的工作流和业务流程管理(BPM)平台,它基于Java技术栈,设计用于企业级应用。在“activiti-5.13.zip”这个压缩包中,我们能够获取到Activiti 5.13版本的相关资源,包括核心引擎、用户界面以及...
Activiti 是一个开源的工作流和业务流程管理(BPM)平台,它被广泛用于构建企业级的应用程序。在"activiti-5.13."这个版本中,我们聚焦于 Activiti 的核心特性和使用环境。 首先,理解 BPM(Business Process ...
Activiti 5.13是该平台的一个版本,提供了相对成熟和完整的流程设计、执行、管理和分析功能。Activiti用户指南是帮助用户了解和使用Activiti产品的官方文档。下面将基于文档的部分内容,介绍与Activiti 5.13相关的...
activiti 工作流idea+eclipse 需要的插件 idea 用actiBpm导入 eclipse 安装前需从文件夹中复制4个jar包
首先,`activiti-spring-5.7.jar`是Activiti与Spring框架的一个特定版本的集成库,它包含了Activiti流程引擎和Spring框架的适配器,使得Activiti可以在Spring环境中无缝运行。5.7版本是Activiti的一个稳定版本,提供...
这个项目似乎是一个使用Spring Boot、MyBatis、Shiro、Redis、Activiti、Quartz和Quartz库的综合系统。以下是这些技术的详细说明: **1. Spring Boot** Spring Boot是Spring框架的一个扩展,旨在简化Java Web应用的...
Activiti 是一个开源的工作流程和业务自动化引擎,广泛应用于企业级应用中,提供流程定义、执行、监控等全套解决方案。这个“Activiti7完整jar包.rar”包含了 Activiti v7.1.0.M6 版本的一系列核心组件,便于在项目...
1. **配置 Spring**:首先,你需要创建一个 Spring 配置文件(如 `applicationContext.xml`),并引入 Activiti 的核心库和 Spring 的 Activiti 支持。配置数据源、事务管理器以及 Activiti 的工厂bean,例如 `...
springboot2+vue2+activiti7+myflow(vue下public目录下 window.open打开)工作流设计请假实战例子。。
Activiti 是一个开源的工作流和业务自动化引擎,广泛应用于企业级应用中,提供流程定义、执行、监控和分析等功能。版本5.13是该引擎的一个稳定版本,它支持多种集成框架,如SpringMVC、MyBatis和Hibernate,使得在...
总结起来,这个压缩包提供了一个经过修改的Activiti 7.x版本,它不仅支持达梦数据库,还兼容了JDK 11,这对那些希望在使用达梦数据库的环境中运行Activiti的企业来说是个好消息。同时,结合Spring和Java的特性,...
Activiti 是一个开源的工作流程引擎,它为业务流程自动化提供了强大的支持。在本文中,我们将深入探讨Activiti Engine API 5.13版本的核心概念、功能以及如何利用它来实现高效的工作流管理。 首先,我们要了解什么...
SpringBoot 是 Spring Framework 的一个扩展,它简化了创建独立的、生产级别的基于 Spring 的应用程序的过程。SpringBoot 通过自动配置、起步依赖和内嵌式服务器等特性,让开发者能快速构建可运行的应用程序,无需...