activiti自定义流程之Spring整合activiti-modeler5.16实例(五):流程定义列表
(2)创建流程模型:activiti自定义流程之Spring整合activiti-modeler5.16实例(二):创建流程模型
(3)流程模型列表展示:activiti自定义流程之Spring整合activiti-modeler5.16实例(三):流程模型列表展示
(4)部署流程定义:activiti自定义流程之Spring整合activiti-modeler5.16实例(四):部署流程定义
1.流程定义依旧属于流程资源,因此查询流程定义也还是使用repositoryService进行操作
2.后台业务代码,
(1)自定义的流程定义实体类:
- package model;
- public class processModel {
- private String id;
- private String deploymentId;
- private String key;
- private String resourceName;
- private int version;
- private String name;
- private String diagramResourceName;
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getDiagramResourceName() {
- return diagramResourceName;
- }
- public void setDiagramResourceName(String diagramResourceName) {
- this.diagramResourceName = diagramResourceName;
- }
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
- public String getDeploymentId() {
- return deploymentId;
- }
- public void setDeploymentId(String deploymentId) {
- this.deploymentId = deploymentId;
- }
- public String getKey() {
- return key;
- }
- public void setKey(String key) {
- this.key = key;
- }
- public String getResourceName() {
- return resourceName;
- }
- public void setResourceName(String resourceName) {
- this.resourceName = resourceName;
- }
- public int getVersion() {
- return version;
- }
- public void setVersion(int version) {
- this.version = version;
- }
- @Override
- public String toString() {
- return "processModel [id=" + id + ", deploymentId=" + deploymentId
- + ", key=" + key + ", resourceName=" + resourceName
- + ", version=" + version + ", name=" + name
- + ", diagramResourceName=" + diagramResourceName + "]";
- }
- }
(2)业务逻辑:
- /**
- * 流程定义列表
- *
- * @author:tuzongxun
- * @Title: processList
- * @param @return
- * @return Object
- * @date Mar 17, 2016 12:34:10 PM
- * @throws
- */
- @RequestMapping(value = "/processList.do", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
- @ResponseBody
- public Object processList(HttpServletRequest req) {
- Map<String, Object> map = new HashMap<String, Object>();
- boolean isLogin = this.isLogin(req);
- if (isLogin) {
- List<processModel> processList = new ArrayList<processModel>();
- List<ProcessDefinition> processList1 = repositoryService
- .createProcessDefinitionQuery().list();
- for (ProcessDefinition pro : processList1) {
- processModel processModel = new processModel();
- processModel.setDeploymentId(pro.getDeploymentId());
- processModel.setId(pro.getId());
- processModel.setKey(pro.getKey());
- processModel.setResourceName(pro.getResourceName());
- processModel.setVersion(pro.getVersion());
- processModel.setName(pro.getName());
- processModel.setDiagramResourceName(pro
- .getDiagramResourceName());
- processList.add(processModel);
- }
- map.put("isLogin", "yes");
- map.put("userName",
- (String) req.getSession().getAttribute("userName"));
- map.put("result", "success");
- map.put("data", processList);
- } else {
- map.put("isLogin", "no");
- }
- return map;
- }
3.angular js前台代码,:
(1)app.js中配置路由:
- $stateProvider
- .state('processList', {
- url: "/processList",
- views: {
- 'view': {
- templateUrl: 'activi_views/processList.html',
- controller: 'processCtr'
- }
- }
- });
(2)逻辑相关代码:
- angular.module('activitiApp')
- .controller('processCtr', ['$rootScope','$scope','$http','$location', function($rootScope,$scope,$http,$location){
- $scope.init=function(){
- $http.post("./processList.do").success(function(result) {
- if(result.isLogin==="yes"){
- console.log(result.data);
- $rootScope.userName=result.userName;
- $scope.processList=result.data;
- }else{
- $location.path("/login");
- }
- });
- }
- //这个方法主要是为下一节,启动流程实例时使用
- $scope.toProcess=function(process){
- console.log(process);
- $http.post("./startProcess.do",process).success(function(deployResult){
- $rootScope.process=process;
- $location.path("/startProcess");
- });
- }
- }])
4.对应的流程定义列表的页面:
- <div id="logdiv1" ng-init="init();">
- <p style="font-size:24px;margin-top:10px">模型列表</p>
- <center>
- <table border="1px" style="width:87%;font-size:18px;text-align:center;margin-left:2px;margin-top:auto;position:relative;float:left;" cellSpacing="0px" cellPadding="0px">
- <tr style="background-color:#ccc">
- <td>ID</td>
- <td>NAME</td>
- <td>KEY</td>
- <td>描 述</td>
- <td>版本</td>
- <td>创建时间</td>
- <td>修改时间</td>
- <td>操 作</td>
- </tr>
- <tr ng-repeat="model in modelList | orderBy:'id'" >
- <td>{{model.id}}</td>
- <td>{{model.name}}</td>
- <td>{{model.key}}</td>
- <td>{{model.metaInfo}}</td>
- <td>{{model.version}}</td>
- <td>{{model.createTime | date:"yyyy-MM-dd HH:mm:ss"}}</td>
- <td>{{model.lastUpdateTime | date:"yyyy-MM-dd HH:mm:ss"}}</td>
- <td><a href="script:;" ng-click="deploye(model)">部署</a>
- <a href="script:;" ng-click="delete(model)">删除</a>
- <a href="script:;" ng-click="update(model.id)">修改</a>
- </td>
- </tr>
- </table>
- </center>
- </div>
5.页面示图如下:
- 顶
- 0
- 踩
activiti自定义流程之Spring整合activiti-modeler5.16实例(五):流程定义列表的更多相关文章
- activiti自定义流程之Spring整合activiti-modeler5.16实例(九):历史任务查询
注:(1)环境搭建:activiti自定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建 (2)创建流程模型:activiti自定义流程之Spring ...
- activiti自定义流程之Spring整合activiti-modeler5.16实例(八):完成个人任务
注:(1)环境搭建:activiti自定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建 (2)创建流程模型:activiti自定义流程之Spring ...
- activiti自定义流程之Spring整合activiti-modeler5.16实例(七):任务列表展示
注:(1)环境搭建:activiti自定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建 (2)创建流程模型:activiti自定义流程之Spring ...
- activiti自定义流程之Spring整合activiti-modeler5.16实例(六):启动流程
注:(1)环境搭建:activiti自定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建 (2)创建流程模型:activiti自定义流程之Spring ...
- activiti自定义流程之Spring整合activiti-modeler5.16实例(四):部署流程定义
注:(1)环境搭建:activiti自定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建 (2)创建流程模型:activiti自定义流程之Spring ...
- activiti自定义流程之Spring整合activiti-modeler5.16实例(三):流程模型列表展示
注:(1)环境搭建:activiti自定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建 (2)创建流程模型:activiti自定义流程之Spring ...
- activiti自定义流程之Spring整合activiti-modeler5.16实例(二):创建流程模型
注:(1)环境搭建:activiti自定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建 1.maven导包,这里就没有什么多的好说了,直接代码: <depe ...
- activiti自定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建
项目中需要整合activiti-modeler自定义流程,找了很多资料后,终于成功的跳转到activiti-modeler流程设计界面,以下是记录: 一.整合基础:eclipse4.4.1.tomca ...
- activiti自己定义流程之Spring整合activiti-modeler5.16实例(四):部署流程定义
注:(1)环境搭建:activiti自己定义流程之Spring整合activiti-modeler5.16实例(一):环境搭建 (2)创建流程模型:activiti自己定义流程之Spr ...
随机推荐
- sublime text3 本地化
博客園中搜到n篇 同題日誌 沒一篇靠譜 超級反感這種行為,浪費別人的時間無異於謀財害命 自動: Control+` (注意不是cmd+p) import urllib.request,os,hashl ...
- zboot/xtract.c
/* * linux/zBoot/xtract.c * * Copyright (C) 1993 Hannu Savolainen * * Extracts the system imag ...
- Codeforces Round #135 (Div. 2)
A. k-String 统计每个字母出现次数即可. B. Special Offer! Super Price 999 Bourles! 枚举末尾有几个9,注意不要爆掉\(long\ long\)的范 ...
- GRANT ALL PRIVILEGES 限制某个或所有客户端都可以连接至mysql
GRANT ALL PRIVILEGES 1. 改表法.可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mys ...
- 通过laravel理解IoC(控制反转)容器和DI(依赖注入)
原文地址: http://www.insp.top/learn-laravel-container ,转载务必保留来源,谢谢了! 容器,字面上理解就是装东西的东西.常见的变量.对象属性等都可以算是容器 ...
- 详解LUA开发工具及其环境配置
LUA开发工具及其环境配置是本文要介绍的内容,主要是来了解并学习lua开发工具的使用和环境的配置,第一次接触LUA的话,就跟本人一起学习吧.看我能不能忽悠到你. LUA是语言,那么一定有编写的工具.第 ...
- 运用@media实现网页自适应中的几个关键分辨率
http://jingyan.baidu.com/article/6f2f55a1ab36c3b5b83e6c46.html http://www.5imoban.net/jiaocheng/div+ ...
- Python-描述符
Python中包含了许多内建的语言特性,它们使得代码简洁且易于理解.这些特性包括列表/集合/字典推导式,属性(property).以及装饰器(decorator).对于大部分特性来说,这些“中级”的语 ...
- 伪类选择器:root的妙用
css3的元素旋转功能非常强大,也非常吸引人,但是很多时候因为浏览器使用率的问题,我们必需要想办法兼容一些低版本的浏览器,特别是ie这朵奇葩. 想要实现元素旋转本来很简单的一个属性就能实现,那就是tr ...
- SVN server环境搭建
VisualSVN server搭建: 1. 下载VisualSVN server for Windows安装包:https://www.visualsvn.com/ 2. 安装过程,基本就是下一步一 ...