JEECG pom
来源:互联网 发布:手机淘宝店铺名片在哪 编辑:程序博客网 时间:2024/06/04 18:42
bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"> <property name="dataSource" ref="dataSource" /> <property name="transactionManager" ref="txManager" /> <property name="databaseSchemaUpdate" value="true" /> <property name="jobExecutorActivate" value="false" /> <!-- 使用spring的自动资源加载部署方式部署 --> <property name="deploymentResources" value="classpath*:design/*.*" /> </bean> <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"> <property name="processEngineConfiguration" ref="processEngineConfiguration" /> </bean> <span style="white-space:pre"></span><span style="white-space:pre"></span> <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" /> <bean id="formService" factory-bean="processEngine" factory-method="getFormService" /> <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" /> <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" /> <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" />
package com.framework.controller;import java.util.List;import org.activiti.engine.*; import org.activiti.engine.task.Task;import org.junit.Test;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;import com.framework.service.UserService;@Controller@RequestMapping("/first")<span style="white-space:pre"></span>public class FirstController {<span style="white-space:pre"></span> @Autowired<span style="white-space:pre"></span> RepositoryService repositoryService;<span style="white-space:pre"></span> @Autowired<span style="white-space:pre"></span> RuntimeService runtimeService;<span style="white-space:pre"></span> @Autowired<span style="white-space:pre"></span> TaskService taskService;<span style="white-space:pre"></span> <span style="white-space:pre"></span> @Autowired<span style="white-space:pre"></span> UserService taskSesrvice;<span style="white-space:pre"></span> @RequestMapping("/test1")<span style="white-space:pre"></span> @ResponseBody<span style="white-space:pre"></span><span style="white-space:pre"></span> public String test(){<span style="white-space:pre"></span> // 加载配置文件activiti.cfg.xml,创建引擎,如果出现null,可能原因<span style="white-space:pre"></span> //1.加载路径不是根目录。<span style="white-space:pre"></span> //2.依赖包不完全<span style="white-space:pre"></span> // 获取配置文件后,引擎开始创建数据库。<span style="white-space:pre"></span> ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();<span style="white-space:pre"></span> // 获取流程储存服务组件<span style="white-space:pre"></span> RepositoryService rs = engine.getRepositoryService();<span style="white-space:pre"></span> // 获取运行时服务组件<span style="white-space:pre"></span> RuntimeService rse = engine.getRuntimeService();<span style="white-space:pre"></span> // 获取流程中的任务TASK组件<span style="white-space:pre"></span> TaskService ts = engine.getTaskService();<span style="white-space:pre"></span> // 部署流程,只要是符合BPMN2规范的XML文件,理论上都可以被ACTIVITI部署<span style="white-space:pre"></span> rs.createDeployment().addClasspathResource("design/MyProcess.bpmn").deploy();<span style="white-space:pre"></span> // 开启流程,myprocess是流程的ID<span style="white-space:pre"></span> rse.startProcessInstanceByKey("myProcess");<span style="white-space:pre"></span> // 查询历史表中的Task<span style="white-space:pre"></span> List<Task> task = ts.createTaskQuery().list();<span style="white-space:pre"></span> Task task1 = task.get(task.size()-1);<span style="white-space:pre"></span> System.out.println("第一环节:"+task1);<span style="white-space:pre"></span> System.out.println("推动流程到下一环节:"+task1);<span style="white-space:pre"></span> ts.complete(task1.getId());<span style="white-space:pre"></span> task1 = ts.createTaskQuery().executionId(task1.getExecutionId()).singleResult();<span style="white-space:pre"></span> System.out.println("第二环节:" + task1);<span style="white-space:pre"></span> return "测试成功";<span style="white-space:pre"></span> }<span style="white-space:pre"></span><span style="white-space:pre"></span> @RequestMapping("/test2") <span style="white-space:pre"></span> public String test2(){<span style="white-space:pre"></span> StringBuffer sb = new StringBuffer();<span style="white-space:pre"></span> // 部署流程,只要是符合BPMN2规范的XML文件,理论上都可以被ACTIVITI部署<span style="white-space:pre"></span> repositoryService.createDeployment().addClasspathResource("com/pzr/demo2/diagrams/MyProcess.bpmn").deploy();<span style="white-space:pre"></span> // 开启流程,myprocess是流程的ID<span style="white-space:pre"></span> runtimeService.startProcessInstanceByKey("myProcess");<span style="white-space:pre"></span> // 查询历史表中的Task<span style="white-space:pre"></span> List<Task> task = taskService.createTaskQuery().list();<span style="white-space:pre"></span> Task task1 = task.get(task.size()-1);<span style="white-space:pre"></span> sb.append("第一环节:"+task1 +"<br/>");<span style="white-space:pre"></span> sb.append("推动流程到下一环节:"+task1+"<br/>");<span style="white-space:pre"></span> taskService.complete(task1.getId());<span style="white-space:pre"></span> task1 = taskService.createTaskQuery().executionId(task1.getExecutionId()).singleResult();<span style="white-space:pre"></span> sb.append("第二环节:" + task1+"<br/>");<span style="white-space:pre"></span> return sb.toString();<span style="white-space:pre"></span> }<span style="white-space:pre"></span><span style="white-space:pre"></span> <span style="white-space:pre"></span> }
0 0
- JEECG pom
- Myeclipse导入jeecg后pom.xml出错
- JEECG
- JEECG
- pom
- POM
- pom
- pom
- POM
- POM
- POM
- pom
- 关于 JEECG
- JEECG很牛啊。。
- 初识JEECG
- JEECG初始化
- jeecg理解
- jeecg心得
- [LeetCode]--237. Delete Node in a Linked List
- MFC中判断文件夹是否存在及创建文件夹的方法
- 抛弃Android自带webview,使用腾讯qq浏览器x5内核的webview浏览器
- Elasticsearch集群安装
- printf函数中用到格式符%5s,其中数字5表示输出的字符串占用5列,如果字符串长度大于5,则输出方式?
- JEECG pom
- 将Office Web App整合到自己的项目中(WOPI Host 开发)
- 第二天
- SpringMVC原理&MVC设计思想
- iOS中.a与.framework库的区别
- android intent 传递list或者对象
- 智能路由器火爆 成开启智能家居时代的钥匙
- Tomcat安装配置图解
- poj 3070