├── .gitignore ├── Chapter02 ├── README.md ├── first-act │ ├── pom.xml │ ├── resources │ │ ├── MyFirstProcess.bpmn │ │ ├── activiti.cfg.xml │ │ └── log4j.properties │ └── src │ │ ├── main │ │ └── java │ │ │ ├── MyFirstProcess.bpmn │ │ │ └── com │ │ │ └── coderdream │ │ │ └── first_act │ │ │ └── App.java │ │ └── test │ │ └── java │ │ └── com │ │ └── coderdream │ │ └── first_act │ │ └── AppTest.java └── images │ ├── 01_Deploy.png │ ├── 02_Login.png │ ├── 03_MainIdentityManagement.png │ ├── 04_Users.png │ ├── 05_CreateUser.png │ ├── 06_UserList.png │ ├── 07_MainPage.png │ ├── 08_CreateProcess.png │ ├── 09_Process1.png │ ├── 10_Process2.png │ ├── 11_Process3.png │ ├── 12_Process4.png │ ├── 14_Process5.png │ ├── 15_Process6.png │ ├── 16_Process7.png │ ├── 17_ProcessInfo.png │ ├── 18_CreateApp.png │ ├── 19_AppInfo.png │ ├── 20_AddModelsToApp.png │ ├── 21_AddModel.png │ ├── 22_ModelAdded.png │ ├── 23_AppPublish.png │ ├── 24_PublishConfirm.png │ ├── 25_AppAdded.png │ ├── 26_StartProcess1.png │ ├── 27_StartProcess2.png │ ├── 28_StartProcess3.png │ ├── 29_StartProcess4.png │ ├── 30_StartProcess5.png │ ├── 31_ProcessAudit1.png │ ├── 32_ProcessAudit2.png │ ├── 33_ProcessAudit3.png │ ├── 34_AdminLogin.png │ ├── 35_AdminMain.png │ ├── 36_Config.png │ ├── 37_ConfigCheck.png │ ├── 38_Info1.png │ ├── 39_Info2.png │ ├── 40_Info3.png │ ├── 41_Info4.png │ ├── 42_Assignments.png │ ├── 43_Info5.png │ ├── 44_Info6.png │ ├── 45_Project.png │ ├── 46_ProcessFile.png │ ├── 47_TableRecord1.png │ ├── 48_TableRecord2.png │ ├── 49_TableRecord3.png │ └── 50_TableRecord4.png ├── Chapter06 ├── README.md └── query-act │ ├── pom.xml │ ├── resources │ ├── MyFirstProcess.bpmn │ ├── activiti.cfg.xml │ └── log4j.properties │ └── src │ ├── main │ └── java │ │ ├── MyFirstProcess.bpmn │ │ └── com │ │ └── coderdream │ │ └── first_act │ │ ├── CountGroup.java │ │ ├── FieldQuery.java │ │ ├── ListGroup.java │ │ ├── ListPageGroup.java │ │ ├── NativeQuery.java │ │ ├── SaveGroup.java │ │ ├── SingleResult.java │ │ ├── SortGroup.java │ │ └── SortMultiGroup.java │ └── test │ └── java │ └── com │ └── coderdream │ └── first_act │ └── AppTest.java ├── Chapter07 ├── README.md ├── content1.txt ├── content2.txt └── deploy-act │ ├── pom.xml │ ├── resources │ ├── MyFirstProcess.bpmn │ ├── activiti.cfg.xml │ ├── error │ │ ├── bpmn_error.bpmn │ │ └── schema_error.bpmn │ ├── log4j.properties │ ├── my_text.txt │ └── result.png │ └── src │ ├── main │ └── java │ │ ├── MyFirstProcess.bpmn │ │ └── com │ │ └── coderdream │ │ └── first_act │ │ ├── AddBpmnModelTest.java │ │ ├── AddZipInputStreamTest.java │ │ ├── BpmnErrorTest.java │ │ ├── BpmnQueryTest.java │ │ ├── ImageQueryTest.java │ │ ├── SchemaErrorTest.java │ │ └── TextQueryTest.java │ └── test │ └── java │ └── com │ └── coderdream │ └── first_act │ └── AppTest.java ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | 25 | 26 | /.settings/ 27 | /target/ 28 | .settings/ 29 | target/ 30 | .classpath 31 | .project 32 | target/ -------------------------------------------------------------------------------- /Chapter02/README.md: -------------------------------------------------------------------------------- 1 | # 第2章 安装与运行Activiti 2 | ## 2.1 下载与运行Activiti 3 | ### 2.1.1 下载和安装JDK 4 | ### 2.1.2 下载和安装MySQL 5 | ### 2.1.3 下载和安装Activiti 6 | - 在浏览器输入 https://github.com/Activiti/Activiti/releases?after=7-201711-EA 进入 Activiti的GitHub网页; 7 | - 下载zip包并解压; 8 | - 将war文件夹的activiti-admin.war、activiti-app.war和activiti-rest.war拷贝到D:\Java\apache-tomcat-8.5.12\webapps目录下; 9 | - 执行D:\Java\apache-tomcat-8.5.12\bin\startup.bat; 10 | - 启动成功需要一分钟左右。 11 | ![]() 12 | ## 2.2 运行官方的Activiti示例 13 | ### 2.2.1 请假流程概述 14 | ### 2.2.2 新建用户 15 | 16 | - 在浏览器输入 http://localhost:8080/activiti-app 进入app项目登陆界面,输入用户名和密码(amdin/test)进入系统: 17 | ![]() 18 | - 点击【Identity Management】图标,进入用户管理界面 19 | ![]() 20 | - 选择【Users】面板,点击【Create User】按钮,新建用户 21 | ![]() 22 | - 输入用户信息 23 | ![]() 24 | - 创建两个用户worker和leader,列表如下 25 | ![]() 26 | 27 | ### 2.2.3 定义流程 28 | 29 | - 点击页面左上角的图标,进入主界面 30 | ![]() 31 | - 点击【Kickstart App】图标,进入流程界面 32 | ![]() 33 | - 点击【Create Process】按钮:设置流程名称 34 | ![]() 35 | - 在开始节点点击头像图标,创建第一个节点 36 | ![]() 37 | - 设置第一个节点 38 | ![]() 39 | - 继续创建第二个节点和流程结束节点: 40 | ![]() 41 | - 设置节点的【Assignments】 42 | ![]() 43 | - 选择分配给单个用户 44 | ![]() 45 | - 第一个节点的设置结果 46 | ![]() 47 | - 第二个节点的设置结果 48 | ![]() 49 | - 点击左上角的按钮,保存流程 50 | ![]() 51 | 52 | ### 2.2.4 发布流程 53 | - 创建应用 54 | ![]() 55 | - 设置应用信息 56 | ![]() 57 | - 准备将流程添加到应用,点击【Edit included models】进入添加页面 58 | ![]() 59 | - 点击流程,将流程添加到应用,右上角的图标变成实心的即表示添加成功 60 | ![]() 61 | - 流程添加完成 62 | ![]() 63 | - 准备应用发布,点击右上角的【Publish】按钮 64 | ![]() 65 | - 确认发布 66 | ![]() 67 | - 应用发布完成 68 | ![]() 69 | 70 | ### 2.2.5 启动与完成流程 71 | 72 | - 使用worker账号登陆系统,准备发起流程 73 | ![]() 74 | - 点击【Start process】,发起流程,可以点击Comments旁边的+号填入备注信息 75 | ![]() 76 | - 流程流转图,现阶段节点在worker这里 77 | ![]() 78 | - 点击【Complete】按钮,发起流程 79 | ![]() 80 | - 流程流转图,现阶段节点已转到leader这里 81 | ![]() 82 | - 使用 leader 账号登陆系统,leader登陆后的界面,有一个任务需要审核,点击右上角的【Complete】可以进行审核 83 | ![]() 84 | - 直接点击【Process】面板,可以查看流程详情 85 | ![]() 86 | - 点击【Task】面板右上角的【Complete】完成审核 87 | ![]() 88 | - 在浏览器输入 http://localhost:8080/activiti-admin 进入admin项目登陆界面,输入用户名和密码(amdin/admin)进入系统: 89 | ![]() 90 | - admin项目首页 91 | ![]() 92 | - 修改端口信息,记得修改密码信息为test,因为app项目的admin账号对应的密码是test: 93 | ![]() 94 | - 校验信息 95 | ![]() 96 | - 已发布的信息列表 97 | ![]() 98 | - 流程定义列表 99 | ![]() 100 | - 单个流程信息详情 101 | ![]() 102 | - 实例信息列表 103 | ![]() 104 | - 任务信息列表 105 | ![]() 106 | - 任务详细信息 107 | ![]() 108 | ### 2.2.6 流程引擎管理 109 | ## 2.3 安装开发环境 110 | ### 2.3.1 下载Eclipse 111 | ### 2.3.2 安装Activiti插件 112 | ## 2.4 编写第一个Activiti程序 113 | ### 2.4.1 如何运行本书示例 114 | ### 2.4.2 建立工程环境 115 | - 创建一个Java的Maven工程 116 | ![]() 117 | - Maven 依赖 118 | ```xml 119 | 120 | 121 | junit 122 | junit 123 | 4.11 124 | test 125 | 126 | 127 | org.activiti 128 | activiti-engine 129 | 6.0.0 130 | 131 | 132 | org.slf4j 133 | slf4j-api 134 | 1.7.21 135 | 136 | 137 | org.slf4j 138 | slf4j-log4j12 139 | 1.7.21 140 | 141 | 142 | mysql 143 | mysql-connector-java 144 | 5.1.47 145 | 146 | 147 | ``` 148 | 149 | ### 2.4.3 创建配置文件 150 | - activiti.cfg.xml配置文件 151 | ```xml 152 | 153 | 157 | 158 | 160 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | ``` 169 | ### 2.4.4 创建流程文件 170 | - 流程文件MyFirstProcess.bpmn(两个节点) 171 | ![]() 172 | 173 | - xml内容 174 | ```xml 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | ``` 216 | ### 2.4.5 加载流程文件与启动流程 217 | 218 | - 自动创建数据库表 219 | ```java 220 | public class App { 221 | public static void main(String[] args) { 222 | // 新建流程引擎 223 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 224 | 225 | // 关闭流程引擎 226 | engine.close(); 227 | } 228 | } 229 | ``` 230 | 231 | - 运行结果(数据库中已自动创建28张表) 232 | ``` 233 | 04:04:56,050 [main] INFO org.activiti.engine.impl.db.DbSqlSession - 234 | performing create on engine with resource org/activiti/db/create/activiti.mysql.create.engine.sql 235 | 04:04:56,080 [main] INFO org.activiti.engine.impl.db.DbSqlSession - 236 | Found MySQL: majorVersion=5 minorVersion=7 237 | 04:05:25,503 [main] INFO org.activiti.engine.impl.db.DbSqlSession - 238 | performing create on history with resource org/activiti/db/create/activiti.mysql.create.history.sql 239 | 04:05:25,511 [main] INFO org.activiti.engine.impl.db.DbSqlSession - 240 | Found MySQL: majorVersion=5 minorVersion=7 241 | 04:05:29,757 [main] INFO org.activiti.engine.impl.db.DbSqlSession - 242 | performing create on identity with resource org/activiti/db/create/activiti.mysql.create.identity.sql 243 | 04:05:29,764 [main] INFO org.activiti.engine.impl.db.DbSqlSession - 244 | Found MySQL: majorVersion=5 minorVersion=7 245 | 04:05:31,511 [main] INFO org.activiti.engine.impl.ProcessEngineImpl - ProcessEngine default created 246 | 04:05:31,790 [main] INFO org.activiti.engine.ProcessEngines - initialised process engine default 247 | ``` 248 | - 表act_re_deployment新增1条记录 249 | ![]() 250 | - 表act_ge_bytearray新增2条记录 251 | ![]() 252 | - 第1条记录详情,xml格式文档 253 | ![]() 254 | - 第2条记录详情,图片格式的流程 255 | ![]() 256 | 257 | - 创建流程 258 | ```java 259 | public class App { 260 | public static void main(String[] args) { 261 | // 新建流程引擎 262 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 263 | // 存储服务 264 | RepositoryService repositoryService = engine.getRepositoryService(); 265 | // 运行时服务 266 | RuntimeService runtimeService = engine.getRuntimeService(); 267 | // 任务服务 268 | TaskService taskService =engine.getTaskService(); 269 | // 部署服务 270 | repositoryService.createDeployment().addClasspathResource("MyFirstProcess.bpmn").deploy(); 271 | // process的id属性 272 | ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess"); 273 | 274 | // 普通员工完成请假的任务 275 | Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); 276 | System.out.println("当前流程节点:" + task.getName()); 277 | taskService.complete(task.getId()); 278 | 279 | // 经理审批任务 280 | task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); 281 | System.out.println("当前流程节点:" + task.getName()); 282 | taskService.complete(task.getId()); 283 | 284 | // 流程结束 285 | task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); 286 | System.out.println("流程结束:" + task); 287 | // 关闭流程引擎 288 | engine.close(); 289 | } 290 | } 291 | ``` 292 | 293 | - 运行结果 294 | ``` 295 | 04:34:35,090 [main] INFO org.activiti.engine.compatibility.DefaultActiviti5CompatibilityHandlerFactory 296 | - Activiti 5 compatibility handler implementation not found or error during instantiation : 297 | - org.activiti.compatibility.DefaultActiviti5CompatibilityHandler. Activiti 5 backwards compatibility disabled. 298 | 04:34:35,196 [main] INFO org.activiti.engine.impl.ProcessEngineImpl - ProcessEngine default created 299 | 04:34:35,202 [main] INFO org.activiti.engine.ProcessEngines - initialised process engine default 300 | 当前流程节点:Write Vacation 301 | 当前流程节点:Audit 302 | 流程结束:null 303 | ``` 304 | 305 | ## 2.5 本章小结 306 | 307 | ## 查看MySql库中所有表的大小和记录数 308 | 309 | - 打开数据库 preformance_schema ,执行下面的语句 310 | ``` sql 311 | SELECT 312 | TABLE_NAME, 313 | DATA_LENGTH, 314 | INDEX_LENGTH, 315 | (DATA_LENGTH + INDEX_LENGTH) AS length, 316 | TABLE_ROWS, 317 | concat( 318 | round( 319 | (DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024, 320 | 3 321 | ), 322 | 'MB' 323 | ) AS total_size 324 | FROM 325 | information_schema. TABLES 326 | WHERE 327 | TABLE_SCHEMA = 'act' 328 | ORDER BY 329 | TABLE_ROWS DESC 330 | ``` 331 | - 运行结果 332 | ``` 333 | TABLE_NAME DATA_LENGTH INDEX_LENGTH length TABLE_ROWS total_size 334 | act_hi_actinst 16384 65536 81920 24 0.078MB 335 | act_ge_bytearray 98304 16384 114688 14 0.109MB 336 | act_hi_taskinst 16384 16384 32768 12 0.031MB 337 | act_re_deployment 16384 0 16384 7 0.016MB 338 | act_re_procdef 16384 16384 32768 7 0.031MB 339 | act_hi_procinst 16384 49152 65536 6 0.063MB 340 | act_ge_property 16384 0 16384 4 0.016MB 341 | act_re_model 16384 49152 65536 0 0.063MB 342 | act_id_group 16384 0 16384 0 0.016MB 343 | act_ru_job 16384 65536 81920 0 0.078MB 344 | act_ru_identitylink 16384 81920 98304 0 0.094MB 345 | act_hi_varinst 16384 0 16384 0 0.016MB 346 | act_procdef_info 16384 32768 49152 0 0.047MB 347 | act_evt_log 16384 0 16384 0 0.016MB 348 | act_ru_execution 16384 98304 114688 0 0.109MB 349 | act_id_user 16384 0 16384 0 0.016MB 350 | act_hi_identitylink 16384 0 16384 0 0.016MB 351 | act_ru_variable 16384 65536 81920 0 0.078MB 352 | act_hi_detail 16384 0 16384 0 0.016MB 353 | act_ru_event_subscr 16384 32768 49152 0 0.047MB 354 | act_ru_timer_job 16384 65536 81920 0 0.078MB 355 | act_hi_comment 16384 0 16384 0 0.016MB 356 | act_ru_deadletter_job 16384 65536 81920 0 0.078MB 357 | act_id_membership 16384 16384 32768 0 0.031MB 358 | act_hi_attachment 16384 0 16384 0 0.016MB 359 | act_ru_task 16384 65536 81920 0 0.078MB 360 | act_id_info 16384 0 16384 0 0.016MB 361 | act_ru_suspended_job 16384 65536 81920 0 0.078MB 362 | ``` 363 | -------------------------------------------------------------------------------- /Chapter02/first-act/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.coderdream 8 | first-act 9 | 0.0.1-SNAPSHOT 10 | 11 | first-act 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | org.activiti 30 | activiti-engine 31 | 6.0.0 32 | 33 | 34 | org.slf4j 35 | slf4j-api 36 | 1.7.21 37 | 38 | 39 | org.slf4j 40 | slf4j-log4j12 41 | 1.7.21 42 | 43 | 44 | mysql 45 | mysql-connector-java 46 | 5.1.47 47 | 48 | 49 | 50 | 51 | 53 | 54 | 55 | 56 | maven-clean-plugin 57 | 3.1.0 58 | 59 | 60 | 61 | maven-resources-plugin 62 | 3.0.2 63 | 64 | 65 | maven-compiler-plugin 66 | 3.8.0 67 | 68 | 69 | maven-surefire-plugin 70 | 2.22.1 71 | 72 | 73 | maven-jar-plugin 74 | 3.0.2 75 | 76 | 77 | maven-install-plugin 78 | 2.5.2 79 | 80 | 81 | maven-deploy-plugin 82 | 2.8.2 83 | 84 | 85 | 86 | maven-site-plugin 87 | 3.7.1 88 | 89 | 90 | maven-project-info-reports-plugin 91 | 3.0.0 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Chapter02/first-act/resources/MyFirstProcess.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Chapter02/first-act/resources/activiti.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter02/first-act/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | 3 | # Console Appender 4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n 7 | 8 | # Custom tweaks 9 | log4j.logger.com.codahale.metrics=WARN 10 | log4j.logger.com.ryantenney=WARN 11 | log4j.logger.com.zaxxer=WARN 12 | log4j.logger.org.apache=WARN 13 | log4j.logger.org.hibernate=WARN 14 | log4j.logger.org.hibernate.engine.internal=WARN 15 | log4j.logger.org.hibernate.validator=WARN 16 | log4j.logger.org.springframework=WARN 17 | log4j.logger.org.springframework.web=WARN 18 | log4j.logger.org.springframework.security=WARN -------------------------------------------------------------------------------- /Chapter02/first-act/src/main/java/MyFirstProcess.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Chapter02/first-act/src/main/java/com/coderdream/first_act/App.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import org.activiti.engine.ProcessEngine; 4 | import org.activiti.engine.ProcessEngines; 5 | import org.activiti.engine.RepositoryService; 6 | import org.activiti.engine.RuntimeService; 7 | import org.activiti.engine.TaskService; 8 | import org.activiti.engine.runtime.ProcessInstance; 9 | import org.activiti.engine.task.Task; 10 | 11 | /** 12 | * Hello world! 13 | * 14 | */ 15 | public class App { 16 | public static void main(String[] args) { 17 | // 新建流程引擎 18 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 19 | // 存储服务 20 | RepositoryService repositoryService = engine.getRepositoryService(); 21 | // 运行时服务 22 | RuntimeService runtimeService = engine.getRuntimeService(); 23 | // 任务服务 24 | TaskService taskService =engine.getTaskService(); 25 | // 部署服务 26 | repositoryService.createDeployment().addClasspathResource("MyFirstProcess.bpmn").deploy(); 27 | // process的id属性 28 | ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess"); 29 | 30 | // 普通员工完成请假的任务 31 | Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); 32 | System.out.println("当前流程节点:" + task.getName()); 33 | taskService.complete(task.getId()); 34 | 35 | // 经理审批任务 36 | task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); 37 | System.out.println("当前流程节点:" + task.getName()); 38 | taskService.complete(task.getId()); 39 | 40 | // 流程结束 41 | task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); 42 | System.out.println("流程结束:" + task); 43 | // 关闭流程引擎 44 | engine.close(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Chapter02/first-act/src/test/java/com/coderdream/first_act/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter02/images/01_Deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/01_Deploy.png -------------------------------------------------------------------------------- /Chapter02/images/02_Login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/02_Login.png -------------------------------------------------------------------------------- /Chapter02/images/03_MainIdentityManagement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/03_MainIdentityManagement.png -------------------------------------------------------------------------------- /Chapter02/images/04_Users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/04_Users.png -------------------------------------------------------------------------------- /Chapter02/images/05_CreateUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/05_CreateUser.png -------------------------------------------------------------------------------- /Chapter02/images/06_UserList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/06_UserList.png -------------------------------------------------------------------------------- /Chapter02/images/07_MainPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/07_MainPage.png -------------------------------------------------------------------------------- /Chapter02/images/08_CreateProcess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/08_CreateProcess.png -------------------------------------------------------------------------------- /Chapter02/images/09_Process1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/09_Process1.png -------------------------------------------------------------------------------- /Chapter02/images/10_Process2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/10_Process2.png -------------------------------------------------------------------------------- /Chapter02/images/11_Process3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/11_Process3.png -------------------------------------------------------------------------------- /Chapter02/images/12_Process4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/12_Process4.png -------------------------------------------------------------------------------- /Chapter02/images/14_Process5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/14_Process5.png -------------------------------------------------------------------------------- /Chapter02/images/15_Process6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/15_Process6.png -------------------------------------------------------------------------------- /Chapter02/images/16_Process7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/16_Process7.png -------------------------------------------------------------------------------- /Chapter02/images/17_ProcessInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/17_ProcessInfo.png -------------------------------------------------------------------------------- /Chapter02/images/18_CreateApp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/18_CreateApp.png -------------------------------------------------------------------------------- /Chapter02/images/19_AppInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/19_AppInfo.png -------------------------------------------------------------------------------- /Chapter02/images/20_AddModelsToApp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/20_AddModelsToApp.png -------------------------------------------------------------------------------- /Chapter02/images/21_AddModel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/21_AddModel.png -------------------------------------------------------------------------------- /Chapter02/images/22_ModelAdded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/22_ModelAdded.png -------------------------------------------------------------------------------- /Chapter02/images/23_AppPublish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/23_AppPublish.png -------------------------------------------------------------------------------- /Chapter02/images/24_PublishConfirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/24_PublishConfirm.png -------------------------------------------------------------------------------- /Chapter02/images/25_AppAdded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/25_AppAdded.png -------------------------------------------------------------------------------- /Chapter02/images/26_StartProcess1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/26_StartProcess1.png -------------------------------------------------------------------------------- /Chapter02/images/27_StartProcess2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/27_StartProcess2.png -------------------------------------------------------------------------------- /Chapter02/images/28_StartProcess3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/28_StartProcess3.png -------------------------------------------------------------------------------- /Chapter02/images/29_StartProcess4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/29_StartProcess4.png -------------------------------------------------------------------------------- /Chapter02/images/30_StartProcess5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/30_StartProcess5.png -------------------------------------------------------------------------------- /Chapter02/images/31_ProcessAudit1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/31_ProcessAudit1.png -------------------------------------------------------------------------------- /Chapter02/images/32_ProcessAudit2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/32_ProcessAudit2.png -------------------------------------------------------------------------------- /Chapter02/images/33_ProcessAudit3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/33_ProcessAudit3.png -------------------------------------------------------------------------------- /Chapter02/images/34_AdminLogin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/34_AdminLogin.png -------------------------------------------------------------------------------- /Chapter02/images/35_AdminMain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/35_AdminMain.png -------------------------------------------------------------------------------- /Chapter02/images/36_Config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/36_Config.png -------------------------------------------------------------------------------- /Chapter02/images/37_ConfigCheck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/37_ConfigCheck.png -------------------------------------------------------------------------------- /Chapter02/images/38_Info1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/38_Info1.png -------------------------------------------------------------------------------- /Chapter02/images/39_Info2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/39_Info2.png -------------------------------------------------------------------------------- /Chapter02/images/40_Info3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/40_Info3.png -------------------------------------------------------------------------------- /Chapter02/images/41_Info4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/41_Info4.png -------------------------------------------------------------------------------- /Chapter02/images/42_Assignments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/42_Assignments.png -------------------------------------------------------------------------------- /Chapter02/images/43_Info5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/43_Info5.png -------------------------------------------------------------------------------- /Chapter02/images/44_Info6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/44_Info6.png -------------------------------------------------------------------------------- /Chapter02/images/45_Project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/45_Project.png -------------------------------------------------------------------------------- /Chapter02/images/46_ProcessFile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/46_ProcessFile.png -------------------------------------------------------------------------------- /Chapter02/images/47_TableRecord1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/47_TableRecord1.png -------------------------------------------------------------------------------- /Chapter02/images/48_TableRecord2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/48_TableRecord2.png -------------------------------------------------------------------------------- /Chapter02/images/49_TableRecord3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/49_TableRecord3.png -------------------------------------------------------------------------------- /Chapter02/images/50_TableRecord4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter02/images/50_TableRecord4.png -------------------------------------------------------------------------------- /Chapter06/README.md: -------------------------------------------------------------------------------- 1 | # 第6章 用户组与用户 2 | ## 6.1 用户组管理 3 | ### 6.1.1 Group对象 4 | ### 6.1.2 创建用户组 5 | 6 | - 代码清单:SaveGroup.java 7 | ```java 8 | // 新建流程引擎 9 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 10 | 11 | IdentityService identityService = engine.getIdentityService(); 12 | 13 | Random ran = new Random(10); 14 | for (int i = 0; i < 10; i++) { 15 | Group group = identityService.newGroup(String.valueOf(i)); 16 | group.setName("Group_" + ran.nextInt(10)); 17 | group.setType("TYPE_" + ran.nextInt(10)); 18 | identityService.saveGroup(group); 19 | } 20 | 21 | // 关闭流程引擎 22 | engine.close(); 23 | ``` 24 | - 执行结果 25 | ``` 26 | 0 1 Group_3 TYPE_0 27 | 1 1 Group_3 TYPE_0 28 | 2 1 Group_6 TYPE_6 29 | 3 1 Group_7 TYPE_8 30 | 4 1 Group_1 TYPE_4 31 | 5 1 Group_3 TYPE_9 32 | 6 1 Group_1 TYPE_8 33 | 7 1 Group_5 TYPE_0 34 | 8 1 Group_6 TYPE_3 35 | 9 1 Group_3 TYPE_8 36 | ``` 37 | ### 6.1.3 修改用户组 38 | ### 6.1.4 删除用户组 39 | ## 6.2 Activiti数据查询 40 | ### 6.2.1 查询对象 41 | 42 | - 代码清单:FieldQuery.java 43 | ```java 44 | List groups = identityService.createGroupQuery() 45 | .groupName("Group_3").groupType("TYPE_0").list(); 46 | 47 | for (Group group : groups) { 48 | System.out.println(group.getId() + "---" + group.getName() + "---" 49 | + group.getType()); 50 | } 51 | ``` 52 | - 查询结果 53 | ``` 54 | 0---Group_3---TYPE_0 55 | 1---Group_3---TYPE_0 56 | ``` 57 | ### 6.2.2 list方法 58 | 59 | - 代码清单:ListGroup.java 60 | ```java 61 | List groups = identityService.createGroupQuery().list(); 62 | 63 | for (Group group : groups) { 64 | System.out.println(group.getId() + "---" + group.getName() + "---" + group.getType()); 65 | } 66 | ``` 67 | - 查询结果 68 | ``` 69 | 0---Group_3---TYPE_0 70 | 1---Group_3---TYPE_0 71 | 2---Group_6---TYPE_6 72 | 3---Group_7---TYPE_8 73 | 4---Group_1---TYPE_4 74 | 5---Group_3---TYPE_9 75 | 6---Group_1---TYPE_8 76 | 7---Group_5---TYPE_0 77 | 8---Group_6---TYPE_3 78 | 9---Group_3---TYPE_8 79 | ``` 80 | 81 | ### 6.2.3 listPage方法 82 | 83 | - 代码清单:ListPageGroup.java 84 | ```java 85 | List groups = identityService.createGroupQuery().listPage(1, 5); 86 | 87 | for (Group group : groups) { 88 | System.out.println(group.getId() + "---" + group.getName() + "---" 89 | + group.getType()); 90 | } 91 | ``` 92 | - 查询结果 93 | ``` 94 | 1---Group_3---TYPE_0 95 | 2---Group_6---TYPE_6 96 | 3---Group_7---TYPE_8 97 | 4---Group_1---TYPE_4 98 | 5---Group_3---TYPE_9 99 | ``` 100 | ### 6.2.4 count方法 101 | 102 | - 代码清单:CountGroup.java 103 | ```java 104 | Long count = identityService.createGroupQuery().count(); 105 | 106 | System.out.println(count); 107 | ``` 108 | - 查询结果 109 | ``` 110 | 10 111 | ``` 112 | ### 6.2.5 排序方法 113 | 114 | - 代码清单:SortGroup.java 115 | ```java 116 | List groups = identityService.createGroupQuery() 117 | .orderByGroupName().desc().list(); 118 | 119 | for (Group group : groups) { 120 | System.out.println(group.getId() + "---" + group.getName() + "---" 121 | + group.getType()); 122 | } 123 | ``` 124 | - 查询结果 125 | ``` 126 | 3---Group_7---TYPE_8 127 | 2---Group_6---TYPE_6 128 | 8---Group_6---TYPE_3 129 | 7---Group_5---TYPE_0 130 | 0---Group_3---TYPE_0 131 | 1---Group_3---TYPE_0 132 | 5---Group_3---TYPE_9 133 | 9---Group_3---TYPE_8 134 | 4---Group_1---TYPE_4 135 | 6---Group_1---TYPE_8 136 | ``` 137 | ### 6.2.6 ID排序问题 138 | ### 6.2.7 多字段排序 139 | 140 | - 代码清单:SortMultiGroup.java 141 | ```java 142 | // 先按名称降序,再按类型降序 143 | List groups = identityService.createGroupQuery() 144 | .orderByGroupName().desc().orderByGroupType().desc().list(); 145 | 146 | for (Group group : groups) { 147 | System.out.println(group.getId() + "---" + group.getName() + "---" 148 | + group.getType()); 149 | } 150 | ``` 151 | - 查询结果 152 | ``` 153 | 3---Group_7---TYPE_8 154 | 2---Group_6---TYPE_6 155 | 8---Group_6---TYPE_3 156 | 7---Group_5---TYPE_0 157 | 5---Group_3---TYPE_9 158 | 9---Group_3---TYPE_8 159 | 0---Group_3---TYPE_0 160 | 1---Group_3---TYPE_0 161 | 6---Group_1---TYPE_8 162 | 4---Group_1---TYPE_4 163 | ``` 164 | ### 6.2.8 singleResult方法 165 | 166 | *查询条件只能返回一条数据,否则会抛出异常* 167 | 168 | - 代码清单:SingleResult.java 169 | ```java 170 | Group group = identityService.createGroupQuery().groupName("Group_5") 171 | .singleResult(); 172 | 173 | System.out.println(group.getId() + "---" + group.getName() + "---" 174 | + group.getType()); 175 | ``` 176 | - 查询结果 177 | ``` 178 | 7---Group_5---TYPE_0 179 | ``` 180 | ### 6.2.9 用户组数据查询 181 | ### 6.2.10 原生SQL查询 182 | 183 | - 代码清单:NativeQuery.java 184 | ```java 185 | List groups = identityService.createNativeGroupQuery() 186 | .sql("SELECT * FROM ACT_ID_GROUP WHERE NAME_ = #{name}") 187 | .parameter("name", "Group_3").list(); 188 | 189 | for (Group group : groups) { 190 | System.out.println(group.getId() + "---" + group.getName() + "---" 191 | + group.getType()); 192 | } 193 | ``` 194 | - 查询结果 195 | ``` 196 | 0---Group_3---TYPE_0 197 | 1---Group_3---TYPE_0 198 | 5---Group_3---TYPE_9 199 | 9---Group_3---TYPE_8 200 | ``` 201 | ## 6.3 用户管理 202 | ### 6.3.1 User对象 203 | ### 6.3.2 添加用户 204 | ### 6.3.3 修改用户 205 | ### 6.3.4 删除用户 206 | ### 6.3.5 验证用户密码 207 | ### 6.3.6 用户数据查询 208 | ### 6.3.7 设置认证用户 209 | ## 6.4 用户信息管理 210 | ### 6.4.1 添加和删除用户信息 211 | ### 6.4.2 查询用户信息 212 | ### 6.4.3 设置用户图片 213 | ## 6.5 用户组与用户的关系 214 | ### 6.5.1 绑定关系 215 | ### 6.5.2 解除绑定 216 | ### 6.5.3 查询用户组下的用户 217 | ### 6.5.4 查询用户所属的用户组 218 | ## 6.6 本章小结 219 | -------------------------------------------------------------------------------- /Chapter06/query-act/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.coderdream 8 | query-act 9 | 0.0.1-SNAPSHOT 10 | 11 | query-act 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | org.activiti 30 | activiti-engine 31 | 6.0.0 32 | 33 | 34 | org.slf4j 35 | slf4j-api 36 | 1.7.21 37 | 38 | 39 | org.slf4j 40 | slf4j-log4j12 41 | 1.7.21 42 | 43 | 44 | mysql 45 | mysql-connector-java 46 | 5.1.47 47 | 48 | 49 | 50 | 51 | 53 | 54 | 55 | 56 | maven-clean-plugin 57 | 3.1.0 58 | 59 | 60 | 61 | maven-resources-plugin 62 | 3.0.2 63 | 64 | 65 | maven-compiler-plugin 66 | 3.8.0 67 | 68 | 69 | maven-surefire-plugin 70 | 2.22.1 71 | 72 | 73 | maven-jar-plugin 74 | 3.0.2 75 | 76 | 77 | maven-install-plugin 78 | 2.5.2 79 | 80 | 81 | maven-deploy-plugin 82 | 2.8.2 83 | 84 | 85 | 86 | maven-site-plugin 87 | 3.7.1 88 | 89 | 90 | maven-project-info-reports-plugin 91 | 3.0.0 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Chapter06/query-act/resources/MyFirstProcess.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Chapter06/query-act/resources/activiti.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter06/query-act/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | 3 | # Console Appender 4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n 7 | 8 | # Custom tweaks 9 | log4j.logger.com.codahale.metrics=WARN 10 | log4j.logger.com.ryantenney=WARN 11 | log4j.logger.com.zaxxer=WARN 12 | log4j.logger.org.apache=WARN 13 | log4j.logger.org.hibernate=WARN 14 | log4j.logger.org.hibernate.engine.internal=WARN 15 | log4j.logger.org.hibernate.validator=WARN 16 | log4j.logger.org.springframework=WARN 17 | log4j.logger.org.springframework.web=WARN 18 | log4j.logger.org.springframework.security=WARN -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/MyFirstProcess.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/CountGroup.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import org.activiti.engine.IdentityService; 4 | import org.activiti.engine.ProcessEngine; 5 | import org.activiti.engine.ProcessEngines; 6 | 7 | /** 8 | * Hello world! 9 | * 10 | */ 11 | public class CountGroup { 12 | public static void main(String[] args) { 13 | // 新建流程引擎 14 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 15 | 16 | IdentityService identityService = engine.getIdentityService(); 17 | // 18 | Long count = identityService.createGroupQuery().count(); 19 | 20 | System.out.println(count); 21 | 22 | // 关闭流程引擎 23 | engine.close(); 24 | } 25 | } 26 | // 10 27 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/FieldQuery.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.util.List; 4 | 5 | import org.activiti.engine.IdentityService; 6 | import org.activiti.engine.ProcessEngine; 7 | import org.activiti.engine.ProcessEngines; 8 | import org.activiti.engine.identity.Group; 9 | 10 | /** 11 | * 12 | */ 13 | public class FieldQuery { 14 | public static void main(String[] args) { 15 | // 新建流程引擎 16 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 17 | 18 | IdentityService identityService = engine.getIdentityService(); 19 | 20 | List groups = identityService.createGroupQuery() 21 | .groupName("Group_3").groupType("TYPE_0").list(); 22 | 23 | for (Group group : groups) { 24 | System.out.println(group.getId() + "---" + group.getName() + "---" 25 | + group.getType()); 26 | } 27 | 28 | // 关闭流程引擎 29 | engine.close(); 30 | } 31 | } 32 | // 0---Group_3---TYPE_0 33 | // 1---Group_3---TYPE_0 34 | 35 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/ListGroup.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.util.List; 4 | 5 | import org.activiti.engine.IdentityService; 6 | import org.activiti.engine.ProcessEngine; 7 | import org.activiti.engine.ProcessEngines; 8 | import org.activiti.engine.identity.Group; 9 | 10 | /** 11 | * Hello world! 12 | * 13 | */ 14 | public class ListGroup { 15 | public static void main(String[] args) { 16 | // 新建流程引擎 17 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 18 | 19 | IdentityService identityService = engine.getIdentityService(); 20 | 21 | List groups = identityService.createGroupQuery().list(); 22 | 23 | for (Group group : groups) { 24 | System.out.println(group.getId() + "---" + group.getName() + "---" + group.getType()); 25 | } 26 | 27 | // 关闭流程引擎 28 | engine.close(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/ListPageGroup.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.util.List; 4 | 5 | import org.activiti.engine.IdentityService; 6 | import org.activiti.engine.ProcessEngine; 7 | import org.activiti.engine.ProcessEngines; 8 | import org.activiti.engine.identity.Group; 9 | 10 | /** 11 | * Hello world! 12 | * 13 | */ 14 | public class ListPageGroup { 15 | public static void main(String[] args) { 16 | // 新建流程引擎 17 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 18 | 19 | IdentityService identityService = engine.getIdentityService(); 20 | 21 | List groups = identityService.createGroupQuery().listPage(1, 5); 22 | 23 | for (Group group : groups) { 24 | System.out.println(group.getId() + "---" + group.getName() + "---" 25 | + group.getType()); 26 | } 27 | 28 | // 关闭流程引擎 29 | engine.close(); 30 | } 31 | } 32 | // 1---Group_3---TYPE_0 33 | // 2---Group_6---TYPE_6 34 | // 3---Group_7---TYPE_8 35 | // 4---Group_1---TYPE_4 36 | // 5---Group_3---TYPE_9 37 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/NativeQuery.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.util.List; 4 | 5 | import org.activiti.engine.IdentityService; 6 | import org.activiti.engine.ProcessEngine; 7 | import org.activiti.engine.ProcessEngines; 8 | import org.activiti.engine.identity.Group; 9 | 10 | /** 11 | * 12 | */ 13 | public class NativeQuery { 14 | public static void main(String[] args) { 15 | // 新建流程引擎 16 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 17 | 18 | IdentityService identityService = engine.getIdentityService(); 19 | 20 | List groups = identityService.createNativeGroupQuery() 21 | .sql("SELECT * FROM ACT_ID_GROUP WHERE NAME_ = #{name}") 22 | .parameter("name", "Group_3").list(); 23 | 24 | for (Group group : groups) { 25 | System.out.println(group.getId() + "---" + group.getName() + "---" 26 | + group.getType()); 27 | } 28 | 29 | // 关闭流程引擎 30 | engine.close(); 31 | } 32 | } 33 | // 0---Group_3---TYPE_0 34 | // 1---Group_3---TYPE_0 35 | // 5---Group_3---TYPE_9 36 | // 9---Group_3---TYPE_8 37 | 38 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/SaveGroup.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.util.Random; 4 | 5 | import org.activiti.engine.IdentityService; 6 | import org.activiti.engine.ProcessEngine; 7 | import org.activiti.engine.ProcessEngines; 8 | import org.activiti.engine.identity.Group; 9 | 10 | /** 11 | * SaveGroup 12 | * 13 | */ 14 | public class SaveGroup { 15 | public static void main(String[] args) { 16 | // 新建流程引擎 17 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 18 | 19 | IdentityService identityService = engine.getIdentityService(); 20 | 21 | Random ran = new Random(10); 22 | for (int i = 0; i < 10; i++) { 23 | Group group = identityService.newGroup(String.valueOf(i)); 24 | group.setName("Group_" + ran.nextInt(10)); 25 | group.setType("TYPE_" + ran.nextInt(10)); 26 | identityService.saveGroup(group); 27 | } 28 | 29 | // 关闭流程引擎 30 | engine.close(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/SingleResult.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import org.activiti.engine.IdentityService; 4 | import org.activiti.engine.ProcessEngine; 5 | import org.activiti.engine.ProcessEngines; 6 | import org.activiti.engine.identity.Group; 7 | 8 | /** 9 | * 10 | */ 11 | public class SingleResult { 12 | public static void main(String[] args) { 13 | // 新建流程引擎 14 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 15 | 16 | IdentityService identityService = engine.getIdentityService(); 17 | // 18 | Group group = identityService.createGroupQuery().groupName("Group_5") 19 | .singleResult(); 20 | 21 | System.out.println(group.getId() + "---" + group.getName() + "---" 22 | + group.getType()); 23 | 24 | // 关闭流程引擎 25 | engine.close(); 26 | } 27 | } 28 | // 7---Group_5---TYPE_0 29 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/SortGroup.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.util.List; 4 | 5 | import org.activiti.engine.IdentityService; 6 | import org.activiti.engine.ProcessEngine; 7 | import org.activiti.engine.ProcessEngines; 8 | import org.activiti.engine.identity.Group; 9 | 10 | /** 11 | * Hello world! 12 | * 13 | */ 14 | public class SortGroup { 15 | public static void main(String[] args) { 16 | // 新建流程引擎 17 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 18 | 19 | IdentityService identityService = engine.getIdentityService(); 20 | 21 | List groups = identityService.createGroupQuery() 22 | .orderByGroupName().desc().list(); 23 | 24 | for (Group group : groups) { 25 | System.out.println(group.getId() + "---" + group.getName() + "---" 26 | + group.getType()); 27 | } 28 | 29 | // 关闭流程引擎 30 | engine.close(); 31 | } 32 | } 33 | // 1---Group_1---TYPE_1 34 | // 2---Group_2---TYPE_2 35 | // 3---Group_3---TYPE_3 36 | // 4---Group_4---TYPE_4 37 | // 5---Group_5---TYPE_5 38 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/main/java/com/coderdream/first_act/SortMultiGroup.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.util.List; 4 | 5 | import org.activiti.engine.IdentityService; 6 | import org.activiti.engine.ProcessEngine; 7 | import org.activiti.engine.ProcessEngines; 8 | import org.activiti.engine.identity.Group; 9 | 10 | /** 11 | * 多字段排序 [JAVA中的Random()函数](https://www.cnblogs.com/ningvsban/p/3590722.html) 12 | */ 13 | public class SortMultiGroup { 14 | public static void main(String[] args) { 15 | // 新建流程引擎 16 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 17 | 18 | IdentityService identityService = engine.getIdentityService(); 19 | 20 | // 先按名称降序,再按类型降序 21 | List groups = identityService.createGroupQuery() 22 | .orderByGroupName().desc().orderByGroupType().desc().list(); 23 | 24 | for (Group group : groups) { 25 | System.out.println(group.getId() + "---" + group.getName() + "---" 26 | + group.getType()); 27 | } 28 | 29 | // 关闭流程引擎 30 | engine.close(); 31 | } 32 | } 33 | // 3---Group_7---TYPE_8 34 | // 2---Group_6---TYPE_6 35 | // 8---Group_6---TYPE_3 36 | // 7---Group_5---TYPE_0 37 | // 5---Group_3---TYPE_9 38 | // 9---Group_3---TYPE_8 39 | // 0---Group_3---TYPE_0 40 | // 1---Group_3---TYPE_0 41 | // 6---Group_1---TYPE_8 42 | // 4---Group_1---TYPE_4 43 | 44 | -------------------------------------------------------------------------------- /Chapter06/query-act/src/test/java/com/coderdream/first_act/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter07/README.md: -------------------------------------------------------------------------------- 1 | # 第7章 流程存储 2 | ## 7.1 流程文件部署 3 | ### 7.1.1 Deployment对象 4 | ### 7.1.2 DeploymentBuilder对象 5 | ### 7.1.3 添加输入流资源 6 | ### 7.1.4 添加classpath资源 7 | ### 7.1.5 添加字符串资源 8 | ### 7.1.6 添加压缩包资源 9 | 10 | 11 | - 代码清单:AddZipInputStreamTest.java 12 | ```java 13 | // 新建流程引擎 14 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 15 | // 存储服务 16 | RepositoryService repositoryService = engine.getRepositoryService(); 17 | // 新建部署构造器 18 | DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); 19 | // 新建文件输入流 20 | FileInputStream fileInputStream = new FileInputStream(new File("resources/datas.zip")); 21 | // 新建Zip输入流 22 | ZipInputStream zipInputStream = new ZipInputStream(fileInputStream); 23 | // 将Zip输入流添加到部署构造器中 24 | deploymentBuilder.addZipInputStream(zipInputStream); 25 | // 发布部署构造器 26 | deploymentBuilder.deploy(); 27 | // 关闭流程引擎 28 | engine.close(); 29 | ``` 30 | - 执行结果 31 | ``` 32 | act_re_deployment表中得到ID 33 | 根据ID(DEPLOYMENT_ID_)在act_ge_bytearray表中查看数据 34 | ``` 35 | 36 | ### 7.1.7 添加BPMN模型资源 37 | 38 | - 代码清单:AddBpmnModelTest.java 39 | ```java 40 | public static void main(String[] args) throws Exception { 41 | // 新建流程引擎 42 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 43 | // 存储服务 44 | RepositoryService repositoryService = engine.getRepositoryService(); 45 | // 新建部署构造器 46 | DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); 47 | String resourceName = "My Process"; 48 | BpmnModel bpmnModel = createProcessModel(); 49 | // 发布部署构造器 50 | deploymentBuilder.addBpmnModel(resourceName, bpmnModel); 51 | // 发布部署构造器 52 | deploymentBuilder.deploy(); 53 | // 关闭流程引擎 54 | engine.close(); 55 | } 56 | 57 | private static BpmnModel createProcessModel() { 58 | // 创建BPMN模型 59 | BpmnModel model = new BpmnModel(); 60 | // 创建一个流程定义 61 | Process process = new Process(); 62 | model.addProcess(process); 63 | process.setId("myProcess"); 64 | process.setName("My Process"); 65 | // 开始事件 66 | StartEvent startEvent = new StartEvent(); 67 | startEvent.setId("startEvent"); 68 | process.addFlowElement(startEvent); 69 | // 用户任务 70 | UserTask userTask = new UserTask(); 71 | userTask.setName("User Task"); 72 | userTask.setId("userTask"); 73 | process.addFlowElement(userTask); 74 | // 结束事件 75 | EndEvent endEvent = new EndEvent(); 76 | endEvent.setId("endEvent"); 77 | process.addFlowElement(endEvent); 78 | // 添加流程顺序 79 | process.addFlowElement(new SequenceFlow("startEvent", "userTask")); 80 | process.addFlowElement(new SequenceFlow("userTask", "endEvent")); 81 | return model; 82 | } 83 | ``` 84 | - 执行结果 85 | ``` 86 | 通过查询数据库可以看到act_re_deployment表新增了一条数据; 87 | 根据最新ID(DEPLOYMENT_ID_)在act_ge_bytearray表中查看数据, 88 | 得到两条记录,一条为xml格式、另一条为图片格式 89 | ``` 90 | 91 | ### 7.1.8 修改部署信息 92 | ### 7.1.9 过滤重复部署 93 | ### 7.1.10 取消部署时的验证 94 | 95 | 96 | - 代码清单:SchemaErrorTest.java 97 | ```java 98 | // 新建部署构造器 99 | DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); 100 | // 增加错误的schema文件(包括无效的标签)test 101 | // 校验报错:发现了以元素 'test' 开头的无效内容。 102 | deploymentBuilder.addClasspathResource("error/schema_error.bpmn"); 103 | // 禁用Schema验证 104 | deploymentBuilder.disableSchemaValidation(); 105 | // 发布部署构造器 106 | deploymentBuilder.deploy(); 107 | ``` 108 | - 执行结果 109 | ``` 110 | 如果禁用验证,则会成功部署; 111 | 如果不禁用验证,则校验报错:发现了以元素 'test' 开头的无效内容。 112 | ``` 113 | 114 | 115 | - 代码清单:BpmnErrorTest.java 116 | ```java 117 | // 新建部署构造器 118 | DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); 119 | // 增加错误的schema文件(包括无效的标签)test 120 | // 报错信息:[Validation set: 'activiti-executable-process' | 121 | //Problem: 'activiti-start-event-multiple-found'] : 122 | //Multiple none start events are not supported - 123 | //[Extra info : processDefinitionId = myProcess | 124 | // processDefinitionName = My process | | id = startevent1 | 125 | //| activityName = Start | ] ( line: 4, column: 47) 126 | deploymentBuilder.addClasspathResource("error/bpmn_error.bpmn"); 127 | // 禁用Bpmn验证 128 | deploymentBuilder.disableBpmnValidation(); 129 | // 发布部署构造器 130 | deploymentBuilder.deploy(); 131 | ``` 132 | - 执行结果 133 | ``` 134 | 如果禁用验证,则会成功部署; 135 | 如果不禁用验证,则报错信息:[Validation set: 'activiti-executable-process' | 136 | //Problem: 'activiti-start-event-multiple-found'] : 137 | //Multiple none start events are not supported - 138 | //[Extra info : processDefinitionId = myProcess | 139 | // processDefinitionName = My process | | id = startevent1 | 140 | //| activityName = Start | ] ( line: 4, column: 47) 141 | ``` 142 | 143 | ## 7.2 流程定义的管理 144 | ### 7.2.1 ProcessDefinition对象 145 | ### 7.2.2 流程部署 146 | ### 7.2.3 流程图部署 147 | ### 7.2.4 流程图自动生成 148 | ### 7.2.5 中止与激活流程定义 149 | ### 7.2.6 流程定义缓存配置 150 | ### 7.2.7 自定义缓存 151 | ## 7.3 流程定义权限 152 | ### 7.3.1 设置流程定义的用户权限 153 | ### 7.3.2 设置流程定义的用户组权限 154 | ### 7.3.3 IdentityLink对象 155 | ### 7.3.4 查询权限数据 156 | ## 7.4 RepositoryService数据查询与删除 157 | ### 7.4.1 查询部署资源 158 | 159 | 在resources文件夹新建my_text.txt文本文件,内容为:my test content 160 | - 代码清单:TextQueryTest.java 161 | ```java 162 | // 新建部署构造器 163 | DeploymentBuilder deploymentBuilder = repositoryService 164 | .createDeployment(); 165 | deploymentBuilder.addClasspathResource("my_text.txt"); 166 | Deployment deployment = deploymentBuilder.deploy(); 167 | // 数据查询 168 | InputStream inputStream = repositoryService.getResourceAsStream( 169 | deployment.getId(), "my_text.txt"); 170 | int count = inputStream.available(); 171 | byte[] contents = new byte[count]; 172 | inputStream.read(contents); 173 | String result = new String(contents); 174 | // 输入结果 175 | System.out.println(result); 176 | ``` 177 | - 执行结果 178 | ``` 179 | my test content 180 | ``` 181 | ### 7.4.2 查询流程文件 182 | 183 | 184 | - 代码清单:BpmnQueryTest.java 185 | ```java 186 | // 部署一份流程文件 187 | Deployment dep = repositoryService.createDeployment() 188 | .addClasspathResource("MyFirstProcess.bpmn").deploy(); 189 | // 查询流程定义实体 190 | ProcessDefinition def = repositoryService.createProcessDefinitionQuery() 191 | .deploymentId(dep.getId()).singleResult(); 192 | // 查询资源文件 193 | InputStream is = repositoryService.getProcessModel(def.getId()); 194 | // 读取输入流 195 | int count = is.available(); 196 | byte[] contents = new byte[count]; 197 | is.read(contents); 198 | String result = new String(contents); 199 | //输入输出结果 200 | System.out.println(result); 201 | ``` 202 | - 执行结果 203 | ``` 204 | 205 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | ``` 253 | ### 7.4.3 查询流程图 254 | - 代码清单:ImageQueryTest.java 255 | ```java 256 | // 部署一份流程文件与相应的流程图文件 257 | Deployment dep = repositoryService.createDeployment() 258 | .addClasspathResource("MyFirstProcess.bpmn").deploy(); 259 | // 查询流程定义 260 | ProcessDefinition def = repositoryService 261 | .createProcessDefinitionQuery().deploymentId(dep.getId()) 262 | .singleResult(); 263 | // 查询资源文件 264 | InputStream is = repositoryService.getProcessDiagram(def.getId()); 265 | // 将输入流转换为图片对象 266 | BufferedImage image = ImageIO.read(is); 267 | // 保存为图片文件 268 | File file = new File("resources/result.png"); 269 | if (!file.exists()) { 270 | file.createNewFile(); 271 | } 272 | FileOutputStream fos = new FileOutputStream(file); 273 | ImageIO.write(image, "png", fos); 274 | fos.close(); 275 | is.close(); 276 | ``` 277 | - 执行结果 278 | ``` 279 | 在resources文件夹下生成图片result.png 280 | ``` 281 | ### 7.4.4 查询部署资源名称 282 | 283 | ### 7.4.5 删除部署资源 284 | 285 | 1. 不管是否指定级联删除,都会删除部署相关的身份数据、流程定义数据、流程资源与部署数据。 286 | 2. 如果设置为级联删除,则会将运行的流程实例、流程任务以及流程实例的历史数据删除。 287 | 3. 如果不级联删除,但是存在运行时数据,例如还有流程实例,就会删除失败。 288 | 289 | ### 7.4.6 DeploymentQuery对象 290 | ### 7.4.7 ProcessDefinitionQuery对象 291 | ## 7.5 本章小结 292 | 293 | 294 | 295 | -------------------------------------------------------------------------------- /Chapter07/content1.txt: -------------------------------------------------------------------------------- 1 | test 1 content -------------------------------------------------------------------------------- /Chapter07/content2.txt: -------------------------------------------------------------------------------- 1 | test 2 content -------------------------------------------------------------------------------- /Chapter07/deploy-act/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.coderdream 8 | deploy-act 9 | 0.0.1-SNAPSHOT 10 | 11 | deploy-act 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | org.activiti 30 | activiti-engine 31 | 6.0.0 32 | 33 | 34 | org.slf4j 35 | slf4j-api 36 | 1.7.21 37 | 38 | 39 | org.slf4j 40 | slf4j-log4j12 41 | 1.7.21 42 | 43 | 44 | mysql 45 | mysql-connector-java 46 | 5.1.47 47 | 48 | 49 | 50 | 51 | 53 | 54 | 55 | 56 | maven-clean-plugin 57 | 3.1.0 58 | 59 | 60 | 61 | maven-resources-plugin 62 | 3.0.2 63 | 64 | 65 | maven-compiler-plugin 66 | 3.8.0 67 | 68 | 69 | maven-surefire-plugin 70 | 2.22.1 71 | 72 | 73 | maven-jar-plugin 74 | 3.0.2 75 | 76 | 77 | maven-install-plugin 78 | 2.5.2 79 | 80 | 81 | maven-deploy-plugin 82 | 2.8.2 83 | 84 | 85 | 86 | maven-site-plugin 87 | 3.7.1 88 | 89 | 90 | maven-project-info-reports-plugin 91 | 3.0.0 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/resources/MyFirstProcess.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/resources/activiti.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/resources/error/bpmn_error.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/resources/error/schema_error.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | test 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | 3 | # Console Appender 4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n 7 | 8 | # Custom tweaks 9 | log4j.logger.com.codahale.metrics=WARN 10 | log4j.logger.com.ryantenney=WARN 11 | log4j.logger.com.zaxxer=WARN 12 | log4j.logger.org.apache=WARN 13 | log4j.logger.org.hibernate=WARN 14 | log4j.logger.org.hibernate.engine.internal=WARN 15 | log4j.logger.org.hibernate.validator=WARN 16 | log4j.logger.org.springframework=WARN 17 | log4j.logger.org.springframework.web=WARN 18 | log4j.logger.org.springframework.security=WARN -------------------------------------------------------------------------------- /Chapter07/deploy-act/resources/my_text.txt: -------------------------------------------------------------------------------- 1 | my test content -------------------------------------------------------------------------------- /Chapter07/deploy-act/resources/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderDream/CrazyWorkflowHandoutsActiviti6/7f33606684106583ba65dae45843f39c0ef938eb/Chapter07/deploy-act/resources/result.png -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/main/java/MyFirstProcess.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/main/java/com/coderdream/first_act/AddBpmnModelTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import org.activiti.bpmn.model.BpmnModel; 4 | import org.activiti.bpmn.model.EndEvent; 5 | import org.activiti.bpmn.model.Process; 6 | import org.activiti.bpmn.model.SequenceFlow; 7 | import org.activiti.bpmn.model.StartEvent; 8 | import org.activiti.bpmn.model.UserTask; 9 | import org.activiti.engine.ProcessEngine; 10 | import org.activiti.engine.ProcessEngines; 11 | import org.activiti.engine.RepositoryService; 12 | import org.activiti.engine.repository.DeploymentBuilder; 13 | 14 | /** 15 | * 添加BPMN模型 16 | * 17 | */ 18 | public class AddBpmnModelTest { 19 | public static void main(String[] args) throws Exception { 20 | // 新建流程引擎 21 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 22 | // 存储服务 23 | RepositoryService repositoryService = engine.getRepositoryService(); 24 | // 新建部署构造器 25 | DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); 26 | String resourceName = "My Process"; 27 | BpmnModel bpmnModel = createProcessModel(); 28 | // 发布部署构造器 29 | deploymentBuilder.addBpmnModel(resourceName, bpmnModel); 30 | // 发布部署构造器 31 | deploymentBuilder.deploy(); 32 | // 关闭流程引擎 33 | engine.close(); 34 | } 35 | 36 | private static BpmnModel createProcessModel() { 37 | // 创建BPMN模型 38 | BpmnModel model = new BpmnModel(); 39 | // 创建一个流程定义 40 | Process process = new Process(); 41 | model.addProcess(process); 42 | process.setId("myProcess"); 43 | process.setName("My Process"); 44 | // 开始事件 45 | StartEvent startEvent = new StartEvent(); 46 | startEvent.setId("startEvent"); 47 | process.addFlowElement(startEvent); 48 | // 用户任务 49 | UserTask userTask = new UserTask(); 50 | userTask.setName("User Task"); 51 | userTask.setId("userTask"); 52 | process.addFlowElement(userTask); 53 | // 结束事件 54 | EndEvent endEvent = new EndEvent(); 55 | endEvent.setId("endEvent"); 56 | process.addFlowElement(endEvent); 57 | // 添加流程顺序 58 | process.addFlowElement(new SequenceFlow("startEvent", "userTask")); 59 | process.addFlowElement(new SequenceFlow("userTask", "endEvent")); 60 | return model; 61 | } 62 | } 63 | 64 | // 65 | // 66 | // 67 | // 68 | // 69 | // 70 | // 71 | // 72 | // 73 | // 74 | // 75 | // 76 | // 77 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/main/java/com/coderdream/first_act/AddZipInputStreamTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.util.zip.ZipInputStream; 6 | 7 | import org.activiti.engine.ProcessEngine; 8 | import org.activiti.engine.ProcessEngines; 9 | import org.activiti.engine.RepositoryService; 10 | import org.activiti.engine.repository.DeploymentBuilder; 11 | 12 | /** 13 | * AddZipInputStreamTest 14 | * 15 | */ 16 | public class AddZipInputStreamTest { 17 | public static void main(String[] args) throws Exception { 18 | // 新建流程引擎 19 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 20 | // 存储服务 21 | RepositoryService repositoryService = engine.getRepositoryService(); 22 | // 新建部署构造器 23 | DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); 24 | // 新建文件输入流 25 | FileInputStream fileInputStream = new FileInputStream(new File("resources/datas.zip")); 26 | // 新建Zip输入流 27 | ZipInputStream zipInputStream = new ZipInputStream(fileInputStream); 28 | // 将Zip输入流添加到部署构造器中 29 | deploymentBuilder.addZipInputStream(zipInputStream); 30 | // 发布部署构造器 31 | deploymentBuilder.deploy(); 32 | // 关闭流程引擎 33 | engine.close(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/main/java/com/coderdream/first_act/BpmnErrorTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import org.activiti.engine.ProcessEngine; 4 | import org.activiti.engine.ProcessEngines; 5 | import org.activiti.engine.RepositoryService; 6 | import org.activiti.engine.repository.DeploymentBuilder; 7 | 8 | public class BpmnErrorTest { 9 | 10 | public static void main(String[] args) { 11 | // 新建流程引擎 12 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 13 | // 存储服务 14 | RepositoryService repositoryService = engine.getRepositoryService(); 15 | // 新建部署构造器 16 | DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); 17 | // 增加错误的schema文件(包括无效的标签)test 18 | // 报错信息:[Validation set: 'activiti-executable-process' | 19 | //Problem: 'activiti-start-event-multiple-found'] : 20 | //Multiple none start events are not supported - 21 | //[Extra info : processDefinitionId = myProcess | 22 | // processDefinitionName = My process | | id = startevent1 | 23 | //| activityName = Start | ] ( line: 4, column: 47) 24 | deploymentBuilder.addClasspathResource("error/bpmn_error.bpmn"); 25 | // 禁用Bpmn验证 26 | deploymentBuilder.disableBpmnValidation(); 27 | // 发布部署构造器 28 | deploymentBuilder.deploy(); 29 | // 关闭流程引擎 30 | engine.close(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/main/java/com/coderdream/first_act/BpmnQueryTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.io.InputStream; 4 | 5 | import org.activiti.engine.ProcessEngine; 6 | import org.activiti.engine.ProcessEngines; 7 | import org.activiti.engine.RepositoryService; 8 | import org.activiti.engine.repository.Deployment; 9 | import org.activiti.engine.repository.ProcessDefinition; 10 | 11 | public class BpmnQueryTest { 12 | 13 | public static void main(String[] args) throws Exception { 14 | // 创建流程引擎 15 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 16 | // 得到流程存储服务对象 17 | RepositoryService repositoryService = engine.getRepositoryService(); 18 | // 部署一份流程文件 19 | Deployment dep = repositoryService.createDeployment() 20 | .addClasspathResource("MyFirstProcess.bpmn").deploy(); 21 | // 查询流程定义实体 22 | ProcessDefinition def = repositoryService.createProcessDefinitionQuery() 23 | .deploymentId(dep.getId()).singleResult(); 24 | // 查询资源文件 25 | InputStream is = repositoryService.getProcessModel(def.getId()); 26 | // 读取输入流 27 | int count = is.available(); 28 | byte[] contents = new byte[count]; 29 | is.read(contents); 30 | String result = new String(contents); 31 | //输入输出结果 32 | System.out.println(result); 33 | // 关闭流程引擎 34 | engine.close(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/main/java/com/coderdream/first_act/ImageQueryTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.awt.image.BufferedImage; 4 | import java.io.File; 5 | import java.io.FileOutputStream; 6 | import java.io.InputStream; 7 | 8 | import javax.imageio.ImageIO; 9 | 10 | import org.activiti.engine.ProcessEngine; 11 | import org.activiti.engine.ProcessEngines; 12 | import org.activiti.engine.RepositoryService; 13 | import org.activiti.engine.repository.Deployment; 14 | import org.activiti.engine.repository.ProcessDefinition; 15 | 16 | public class ImageQueryTest { 17 | 18 | public static void main(String[] args) throws Exception { 19 | // 创建流程引擎 20 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 21 | // 得到流程存储服务对象 22 | RepositoryService repositoryService = engine.getRepositoryService(); 23 | // 部署一份流程文件与相应的流程图文件 24 | Deployment dep = repositoryService.createDeployment() 25 | .addClasspathResource("MyFirstProcess.bpmn").deploy(); 26 | // 查询流程定义 27 | ProcessDefinition def = repositoryService 28 | .createProcessDefinitionQuery().deploymentId(dep.getId()) 29 | .singleResult(); 30 | // 查询资源文件 31 | InputStream is = repositoryService.getProcessDiagram(def.getId()); 32 | // 将输入流转换为图片对象 33 | BufferedImage image = ImageIO.read(is); 34 | // 保存为图片文件 35 | File file = new File("resources/result.png"); 36 | if (!file.exists()) { 37 | file.createNewFile(); 38 | } 39 | FileOutputStream fos = new FileOutputStream(file); 40 | ImageIO.write(image, "png", fos); 41 | fos.close(); 42 | is.close(); 43 | // 关闭流程引擎 44 | engine.close(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/main/java/com/coderdream/first_act/SchemaErrorTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import org.activiti.engine.ProcessEngine; 4 | import org.activiti.engine.ProcessEngines; 5 | import org.activiti.engine.RepositoryService; 6 | import org.activiti.engine.repository.DeploymentBuilder; 7 | 8 | public class SchemaErrorTest { 9 | 10 | public static void main(String[] args) { 11 | // 新建流程引擎 12 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 13 | // 存储服务 14 | RepositoryService repositoryService = engine.getRepositoryService(); 15 | // 新建部署构造器 16 | DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); 17 | // 增加错误的schema文件(包括无效的标签)test 18 | // 校验报错:发现了以元素 'test' 开头的无效内容。 19 | deploymentBuilder.addClasspathResource("error/schema_error.bpmn"); 20 | // 禁用Schema验证 21 | deploymentBuilder.disableSchemaValidation(); 22 | // 发布部署构造器 23 | deploymentBuilder.deploy(); 24 | // 关闭流程引擎 25 | engine.close(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/main/java/com/coderdream/first_act/TextQueryTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import java.io.InputStream; 4 | 5 | import org.activiti.engine.ProcessEngine; 6 | import org.activiti.engine.ProcessEngines; 7 | import org.activiti.engine.RepositoryService; 8 | import org.activiti.engine.repository.Deployment; 9 | import org.activiti.engine.repository.DeploymentBuilder; 10 | 11 | public class TextQueryTest { 12 | 13 | public static void main(String[] args) throws Exception { 14 | // 新建流程引擎 15 | ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); 16 | // 存储服务 17 | RepositoryService repositoryService = engine.getRepositoryService(); 18 | // 新建部署构造器 19 | DeploymentBuilder deploymentBuilder = repositoryService 20 | .createDeployment(); 21 | deploymentBuilder.addClasspathResource("my_text.txt"); 22 | Deployment deployment = deploymentBuilder.deploy(); 23 | // 数据查询 24 | InputStream inputStream = repositoryService.getResourceAsStream( 25 | deployment.getId(), "my_text.txt"); 26 | int count = inputStream.available(); 27 | byte[] contents = new byte[count]; 28 | inputStream.read(contents); 29 | String result = new String(contents); 30 | // 输入结果 31 | System.out.println(result); 32 | // 关闭流程引擎 33 | engine.close(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Chapter07/deploy-act/src/test/java/com/coderdream/first_act/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.coderdream.first_act; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 CoderDream 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CrazyWorkflowHandoutsActiviti6 2 | 《疯狂工作流讲义(第 2 版)基于 Activiti6.X》作者:杨恩雄 3 | 4 | 5 | ## 课程资源 6 | 7 | 配套源码地址:http://pan.baidu.com/s/1eRHYf1C 8 | 提取密码: 06o2 9 | 10 | 教学视频地址:https://pan.baidu.com/s/12YjylKeDxKQtbV6uMf7TPQ 11 | 提取密码: r6pc 12 | 13 | ## 内容简介 14 |    15 | 工作流引擎Activiti经过多年的发展,已经变成一个成熟的工作流框架,在2017年,Activiti推出了全新的6.0版本,除了完善对BPMN规范的支持外,还加入了对DMN规范的支持。为了能让广大的程序开发者一探新版本Activiti的功能,笔者在第一版的基础上,编写了本书的第二版。 16 | 17 | 书中会对Activiti的知识进行全面讲解,并从源码角度对Activiti进行深度剖析。本书会以Activiti为基础,讲述该框架的API使用、BPMN规范,除了这些工作流的基本知识外,还讲解了新的DMN规范引擎、Activiti整合SpringBoot等内容。在本书的第18章,深入Activiti的源代码,展示舍弃流程虚拟机(PVM)之后的Activiti,如何对流程进行控制,让读者能一窥Activiti的庐山真面目。zui后一章,以一个案例结束本书的内容,案例中整合Spring、Struts2等主流框架,目的是让读者在学习的过程中更贴近实际案例。 18 |    19 | ## 作者简介 20 | 杨恩雄,从事十多年JavaEE企业应用开发,曾任中企动力系统设计师、中企开源项目经理、数码辰星科技公司项目经理,参与过多个企业级项目的设计与架构工作,曾负责辰星“电影票网络销售系统”的整体架构。精通Activiti、Drools、ESB等开源技术,在SOA、SaaS、大数据应用、互联网系统架构方面有着丰富的经验,曾出版《疯狂Java实战演义》《疯狂Workflow讲义》《疯狂SpringCloud微服务架构实战》等书籍。 21 | 22 | ## 目录 23 | ### 第1章 Activiti介绍 1 24 | - 1.1 工作流介绍 2 25 | - 1.2 BPMN 2.0规范简述 2 26 | - 1.2.1 BPMN 2.0概述 3 27 | - 1.2.2 BPMN 2.0元素 3 28 | - 1.2.3 BPMN 2.0的XML结构 5 29 | - 1.3 Activiti介绍 5 30 | - 1.3.1 Activiti的出现 5 31 | - 1.3.2 Activiti的发展 5 32 | - 1.3.3 选择Activiti还是jBPM 5 33 | - 1.4 本章小结 6 34 | ### [第2章 安装与运行Activiti](Chapter02/) 35 | - 2.1 下载与运行Activiti 8 36 | - 2.1.1 下载和安装JDK 8 37 | - 2.1.2 下载和安装MySQL 9 38 | - 2.1.3 下载和安装Activiti 10 39 | - 2.2 运行官方的Activiti示例 11 40 | - 2.2.1 请假流程概述 11 41 | - 2.2.2 新建用户 11 42 | - 2.2.3 定义流程 12 43 | - 2.2.4 发布流程 14 44 | - 2.2.5 启动与完成流程 15 45 | - 2.2.6 流程引擎管理 16 46 | - 2.3 安装开发环境 17 47 | - 2.3.1 下载Eclipse 17 48 | - 2.3.2 安装Activiti插件 18 49 | - 2.4 编写第一个Activiti程序 19 50 | - 2.4.1 如何运行本书示例 19 51 | - 2.4.2 建立工程环境 19 52 | - 2.4.3 创建配置文件 20 53 | - 2.4.4 创建流程文件 20 54 | - 2.4.5 加载流程文件与启动流程 21 55 | - 2.5 本章小结 22 56 | ### 第3章 Activiti数据库设计 23 57 | - 3.1 通用数据表 24 58 | - 3.1.1 资源表 24 59 | - 3.1.2 属性表 24 60 | - 3.2 流程存储表 25 61 | - 3.2.1 部署数据表 25 62 | - 3.2.2 流程定义表 25 63 | - 3.3 身份数据表 25 64 | - 3.3.1 用户表 25 65 | - 3.3.2 用户账号(信息)表 26 66 | - 3.3.3 用户组表 26 67 | - 3.3.4 关系表 26 68 | - 3.4 运行时数据表 26 69 | - 3.4.1 流程实例(执行流)表 26 70 | - 3.4.2 流程任务表 27 71 | - 3.4.3 流程参数表 27 72 | - 3.4.4 流程与身份关系表 27 73 | - 3.4.5 工作数据表 28 74 | - 3.4.6 事件描述表 28 75 | - 3.5 历史数据表 28 76 | - 3.5.1 流程实例表 28 77 | - 3.5.2 流程明细表 29 78 | - 3.5.3 历史任务表和历史行为表 29 79 | - 3.5.4 附件表和评论表 29 80 | - 3.6 DMN规则引擎表 30 81 | - 3.6.1 决策部署表 30 82 | - 3.6.2 决策表 30 83 | - 3.6.3 部署资源表 30 84 | - 3.7 本章小结 30 85 | ### 第4章 Activiti流程引擎配置 31 86 | - 4.1 流程引擎配置对象 32 87 | - 4.1.1 读取默认的配置文件 32 88 | - 4.1.2 读取自定义的配置文件 33 89 | - 4.1.3 读取输入流的配置 33 90 | - 4.1.4 使用createStandaloneInMemProcess- EngineConfiguration方法 34 91 | - 4.1.5 使用createStandaloneProcessEngine- Configuration方法 34 92 | - 4.2 数据源配置 35 93 | - 4.2.1 Activiti支持的数据库 35 94 | - 4.2.2 Activiti与Spring 35 95 | - 4.2.3 JDBC配置 35 96 | - 4.2.4 DBCP数据源配置 36 97 | - 4.2.5 C3P0数据源配置 37 98 | - 4.2.6 Activiti其他数据源配置 38 99 | - 4.2.7 数据库策略配置 38 100 | - 4.2.8 databaseType配置 39 101 | - 4.3 其他属性配置 40 102 | - 4.3.1 history配置 40 103 | - 4.3.2 asyncExecutorActivate配置 41 104 | - 4.3.3 邮件服务器配置 41 105 | - 4.4 ProcessEngineConfiguration bean 41 106 | - 4.4.1 ProcessEngineConfiguration及其子类 41 107 | - 4.4.2 自定义ProcessEngineConfiguration 42 108 | - 4.5 Activiti的命令拦截器 43 109 | - 4.5.1 命令模式 44 110 | - 4.5.2 责任链模式 45 111 | - 4.5.3 编写自定义拦截器 47 112 | - 4.6 本章小结 49 113 | ### 第5章 流程引擎的创建 50 114 | - 5.1 ProcessEngineConfiguration的buildProcessEngine方法 51 115 | - 5.2 ProcessEngines对象 51 116 | - 5.2.1 init方法与getDefaultProcessEngine方法 51 117 | - 5.2.2 registerProcessEngine方向和unregister方法 52 118 | - 5.2.3 retry方法 53 119 | - 5.2.4 destroy方法 53 120 | - 5.3 ProcessEngine对象 54 121 | - 5.3.1 服务组件 54 122 | - 5.3.2 关闭流程引擎 55 123 | - 5.3.3 流程引擎名称 56 124 | - 5.4 本章小结 56 125 | ### [第6章 用户组与用户](Chapter06/) 126 | - 6.1 用户组管理 58 127 | - 6.1.1 Group对象 58 128 | - 6.1.2 创建用户组 58 129 | - 6.1.3 修改用户组 59 130 | - 6.1.4 删除用户组 60 131 | - 6.2 Activiti数据查询 61 132 | - 6.2.1 查询对象 61 133 | - 6.2.2 list方法 61 134 | - 6.2.3 listPage方法 62 135 | - 6.2.4 count方法 63 136 | - 6.2.5 排序方法 63 137 | - 6.2.6 ID排序问题 64 138 | - 6.2.7 多字段排序 66 139 | - 6.2.8 singleResult方法 67 140 | - 6.2.9 用户组数据查询 68 141 | - 6.2.10 原生SQL查询 69 142 | - 6.3 用户管理 71 143 | - 6.3.1 User对象 71 144 | - 6.3.2 添加用户 71 145 | - 6.3.3 修改用户 72 146 | - 6.3.4 删除用户 72 147 | - 6.3.5 验证用户密码 73 148 | - 6.3.6 用户数据查询 74 149 | - 6.3.7 设置认证用户 75 150 | - 6.4 用户信息管理 77 151 | - 6.4.1 添加和删除用户信息 77 152 | - 6.4.2 查询用户信息 78 153 | - 6.4.3 设置用户图片 78 154 | - 6.5 用户组与用户的关系 80 155 | - 6.5.1 绑定关系 80 156 | - 6.5.2 解除绑定 81 157 | - 6.5.3 查询用户组下的用户 81 158 | - 6.5.4 查询用户所属的用户组 82 159 | - 6.6 本章小结 83 160 | ### [第7章 流程存储](Chapter07/) 161 | - 7.1 流程文件部署 85 162 | - 7.1.1 Deployment对象 85 163 | - 7.1.2 DeploymentBuilder对象 85 164 | - 7.1.3 添加输入流资源 86 165 | - 7.1.4 添加classpath资源 87 166 | - 7.1.5 添加字符串资源 88 167 | - 7.1.6 添加压缩包资源 88 168 | - 7.1.7 添加BPMN模型资源 89 169 | - 7.1.8 修改部署信息 90 170 | - 7.1.9 过滤重复部署 90 171 | - 7.1.10 取消部署时的验证 92 172 | - 7.2 流程定义的管理 93 173 | - 7.2.1 ProcessDefinition对象 93 174 | - 7.2.2 流程部署 93 175 | - 7.2.3 流程图部署 95 176 | - 7.2.4 流程图自动生成 95 177 | - 7.2.5 中止与激活流程定义 96 178 | - 7.2.6 流程定义缓存配置 97 179 | - 7.2.7 自定义缓存 98 180 | - 7.3 流程定义权限 100 181 | - 7.3.1 设置流程定义的用户权限 100 182 | - 7.3.2 设置流程定义的用户组权限 101 183 | - 7.3.3 IdentityLink对象 102 184 | - 7.3.4 查询权限数据 102 185 | - 7.4 RepositoryService数据查询与删除 104 186 | - 7.4.1 查询部署资源 104 187 | - 7.4.2 查询流程文件 105 188 | - 7.4.3 查询流程图 106 189 | - 7.4.4 查询部署资源名称 107 190 | - 7.4.5 删除部署资源 107 191 | - 7.4.6 DeploymentQuery对象 108 192 | - 7.4.7 ProcessDefinitionQuery对象 109 193 | - 7.5 本章小结 109 194 | ### 第8章 流程任务管理 110 195 | - 8.1 任务的创建与删除 111 196 | - 8.1.1 Task接口 111 197 | - 8.1.2 创建与保存Task实例 112 198 | - 8.1.3 删除任务 112 199 | - 8.2 任务权限 113 200 | - 8.2.1 设置候选用户组 114 201 | - 8.2.2 设置候选用户 115 202 | - 8.2.3 权限数据查询 116 203 | - 8.2.4 设置任务持有人 118 204 | - 8.2.5 设置任务代理人 119 205 | - 8.2.6 添加任务权限数据 119 206 | - 8.2.7 删除用户组权限 121 207 | - 8.2.8 删除用户权限 122 208 | - 8.3 任务参数 123 209 | - 8.3.1 基本类型参数设置 124 210 | - 8.3.2 序列化参数 125 211 | - 8.3.3 获取参数 126 212 | - 8.3.4 参数作用域 127 213 | - 8.3.5 设置多个参数 128 214 | - 8.3.6 数据对象 129 215 | - 8.4 任务附件管理 130 216 | - 8.4.1 Attachment对象 130 217 | - 8.4.2 创建任务附件 130 218 | - 8.4.3 附件查询 132 219 | - 8.4.4 删除附件 133 220 | - 8.5 任务评论与事件记录 133 221 | - 8.5.1 Comment对象 133 222 | - 8.5.2 新增任务评论 134 223 | - 8.5.3 事件的记录 135 224 | - 8.5.4 数据查询 136 225 | - 8.6 任务声明与完成 137 226 | - 8.6.1 任务声明 137 227 | - 8.6.2 任务完成 138 228 | - 8.7 本章小结 139 229 | ### 第9章 流程控制 140 230 | - 9.1 流程实例与执行流 141 231 | - 9.1.1 流程实例与执行流概念 141 232 | - 9.1.2 流程实例和执行流对象(ProcessInstance与Execution) 141 233 | - 9.2 启动流程 142 234 | - 9.2.1 startProcessInstanceById方法 142 235 | - 9.2.2 startProcessInstanceByKey方法 144 236 | - 9.2.3 startProcessInstanceByMessage 145 237 | - 9.3 流程参数 146 238 | - 9.3.1 设置与查询流程参数 147 239 | - 9.3.2 流程参数的作用域 147 240 | - 9.3.3 其他设置参数的方法 149 241 | - 9.4 流程操作 149 242 | - 9.4.1 流程触发 149 243 | - 9.4.2 触发信号事件 150 244 | - 9.4.3 触发消息事件 152 245 | - 9.4.4 中断与激活流程 153 246 | - 9.4.5 删除流程 154 247 | - 9.5 流程数据查询 155 248 | - 9.5.1 执行流查询 155 249 | - 9.5.2 流程实例查询 157 250 | - 9.6 本章小结 158 251 | ### 第10章 历史数据管理和流程引擎管理 159 252 | - 10.1 历史数据管理 160 253 | - 10.1.1 历史流程实例查询 160 254 | - 10.1.2 历史任务查询 161 255 | - 10.1.3 历史行为查询 163 256 | - 10.1.4 历史流程明细查询 165 257 | - 10.1.5 删除历史流程实例和历史任务 166 258 | - 10.2 工作的产生 167 259 | - 10.2.1 异步任务产生的工作 168 260 | - 10.2.2 定时中间事件产生的工作 169 261 | - 10.2.3 定时边界事件产生的工作 170 262 | - 10.2.4 定时开始事件产生的工作 171 263 | - 10.2.5 流程抛出事件产生的工作 172 264 | - 10.2.6 暂停工作的产生 174 265 | - 10.2.7 无法执行的工作 175 266 | - 10.3 工作管理 176 267 | - 10.3.1 工作查询对象 176 268 | - 10.3.2 获取工作异常信息 176 269 | - 10.3.3 转移与删除工作 177 270 | - 10.4 数据库管理 178 271 | - 10.4.1 查询引擎属性 178 272 | - 10.4.2 数据表信息查询 179 273 | - 10.4.3 数据库操作 180 274 | - 10.4.4 数据表查询 180 275 | - 10.5 本章小结 181 276 | ### 第11章 流程事件 182 277 | - 11.1 事件分类 183 278 | - 11.1.1 按照事件的位置分类 183 279 | - 11.1.2 按照事件的特性分类 183 280 | - 11.2 事件定义 183 281 | - 11.2.1 定时器事件定义 184 282 | - 11.2.2 cron表达式 184 283 | - 11.2.3 错误事件定义 186 284 | - 11.2.4 信号事件定义 186 285 | - 11.2.5 消息事件定义 187 286 | - 11.2.6 取消事件定义 187 287 | - 11.2.7 补偿事件定义 188 288 | - 11.2.8 其他事件定义 188 289 | - 11.3 开始事件 188 290 | - 11.3.1 无指定开始事件 188 291 | - 11.3.2 定时器开始事件 189 292 | - 11.3.3 消息开始事件 190 293 | - 11.3.4 错误开始事件 191 294 | - 11.4 结束事件 193 295 | - 11.4.1 无指定结束事件 193 296 | - 11.4.2 错误结束事件 194 297 | - 11.4.3 取消结束事件和取消边界事件 196 298 | - 11.4.4 终止结束事件 199 299 | - 11. 5 边界事件 200 300 | - 11.5.1 定时器边界事件 201 301 | - 11.5.2 错误边界事件 203 302 | - 11.5.3 信号边界事件 204 303 | - 11.5.4 补偿边界事件 206 304 | - 11.6 中间事件 209 305 | - 11.6.1 中间事件分类 209 306 | - 11.6.2 定时器中间事件 210 307 | - 11.6.3 信号中间Catching事件 211 308 | - 11.6.4 信号中间Throwing事件 213 309 | - 11.6.5 消息中间事件 215 310 | - 11.6.6 无指定中间事件 215 311 | - 11.7 补偿中间事件 215 312 | - 11.7.1 补偿执行次数 215 313 | - 11.7.2 补偿的执行顺序 217 314 | - 11.7.3 补偿的参数设置 220 315 | - 11.8 本章小结 221 316 | ### 第12章 流程任务 222 317 | - 12.1 BPMN 2.0任务 223 318 | - 12.1.1 任务的继承 223 319 | - 12.1.2 XML约束 223 320 | - 12.1.3 任务的类型 225 321 | - 12.2 用户任务 226 322 | - 12.2.1 分配任务候选人 226 323 | - 12.2.2 分配任务代理人 228 324 | - 12.2.3 权限分配扩展 228 325 | - 12.2.4 使用任务监听器进行权限分配 229 326 | - 12.2.5 使用JUEL分配权限 230 327 | - 12.3 脚本任务 232 328 | - 12.3.1 脚本任务 232 329 | - 12.3.2 JavaScript脚本 233 330 | - 12.3.3 Groovy脚本 234 331 | - 12.3.4 设置返回值 235 332 | - 12.3.5 JUEL脚本 236 333 | - 12.4 服务任务 237 334 | - 12.4.1 Java服务任务 238 335 | - 12.4.2 实现JavaDelegate 238 336 | - 12.4.3 使用普通Java Bean 240 337 | - 12.4.4 在Activiti中调用Web Service 241 338 | - 12.4.5 import元素 242 339 | - 12.4.6 itemDefinition和message元素 242 340 | - 12.4.7 interface与operation元素 243 341 | - 12.4.8 设置Web Service参数与返回值 243 342 | - 12.4.9 发布Web Service 243 343 | - 12.4.10 使用Web Service Task 245 344 | - 12.4.11 JavaDelegate属性注入 248 345 | - 12.4.12 在JavaDelegate中调用Web Service 251 346 | - 12.4.13 Shell任务 253 347 | - 12.5 其他任务 255 348 | - 12.5.1 手动任务和接收任务 255 349 | - 12.5.2 邮件任务 257 350 | - 12.5.3 Mule任务和业务规则任务 258 351 | - 12.6 任务监听器 259 352 | - 12.6.1 使用class指定监听器 259 353 | - 12.6.2 使用expression指定监听器 260 354 | - 12.6.3 使用delegateExpression指定监听器 261 355 | - 12.6.4 监听器的触发 262 356 | - 12.6.5 属性注入 263 357 | - 12.7 流程监听器 263 358 | - 12.7.1 配置流程监听器 263 359 | - 12.7.2 触发流程监听器的事件 264 360 | - 12.8 本章小结 267 361 | ### 第13章 其他流程元素 268 362 | - 13.1 子流程 269 363 | - 13.1.1 嵌入式子流程 269 364 | - 13.1.2 调用式子流程 271 365 | - 13.1.3 调用式子流程的参数传递 273 366 | - 13.1.4 事件子流程 275 367 | - 13.1.5 事务子流程 277 368 | - 13.1.6 特别子流程 280 369 | - 13.2 顺序流 282 370 | - 13.2.1 条件顺序流 282 371 | - 13.2.2 默认顺序流 284 372 | - 13.3 流程网关 286 373 | - 13.3.1 单向网关 286 374 | - 13.3.2 并行网关 288 375 | - 13.3.3 兼容网关 291 376 | - 13.3.4 事件网关 293 377 | - 13.4 流程活动特性 295 378 | - 13.4.1 多实例活动 295 379 | - 13.4.2 设置循环数据 297 380 | - 13.4.3 获取循环元素 298 381 | - 13.4.4 循环的内置参数 300 382 | - 13.4.5 循环结束条件 302 383 | - 13.4.6 补偿处理者 304 384 | - 13.5 本章小结 304 385 | ### 第14章 Activiti与规则引擎 305 386 | - 14.1 概述 306 387 | - 14.1.1 规则引擎Drools 306 388 | - 14.1.2 Drools下载与安装 306 389 | - 14.2 开发第一个Drools应用 307 390 | - 14.2.1 建立Drools环境 307 391 | - 14.2.2 编写规则 308 392 | - 14.2.3 加载与运行 308 393 | - 14.3 Drools规则语法概述 309 394 | - 14.3.1 规则文件结构 309 395 | - 14.3.2 关键字 310 396 | - 14.3.3 规则编译 310 397 | - 14.4 类型声明 311 398 | - 14.4.1 声明新类型 312 399 | - 14.4.2 使用ASM操作字节码 313 400 | - 14.4.3 类型声明的使用 314 401 | - 14.4.4 类型的继承 316 402 | - 14.4.5 声明元数据 317 403 | - 14.5 函数和查询 317 404 | - 14.5.1 函数定义和使用 318 405 | - 14.5.2 查询的定义和使用 320 406 | - 14.6 规则语法 321 407 | - 14.6.1 全局变量 322 408 | - 14.6.2 规则属性 323 409 | - 14.6.3 条件语法 327 410 | - 14.6.4 行为语法 330 411 | - 14.7 Activiti调用规则 331 412 | - 14.7.1 业务规则任务 332 413 | - 14.7.2 制定销售单优惠规则 333 414 | - 14.7.3 实现销售流程 336 415 | - 14.8 本章小结 339 416 | ### 第15章 基于DMN的Activiti规则引擎 340 417 | - 15.1 DMN规范概述 341 418 | - 15.1.1 DMN的出现背景 341 419 | - 15.1.2 Activiti与Drools 341 420 | - 15.1.3 DMN的XML样例 341 421 | - 15.2 DMN的XML规范 342 422 | - 15.2.1 决策 342 423 | - 15.2.2 决策表 343 424 | - 15.2.3 输入参数 343 425 | - 15.2.4 输出结果 344 426 | - 15.2.5 规则 344 427 | - 15.3 运行第一个应用 345 428 | - 15.3.1 建立项目 345 429 | - 15.3.2 规则引擎配置文件 346 430 | - 15.3.3 编写DMN文件 346 431 | - 15.3.4 加载与运行DMN文件 347 432 | - 15.4 规则引擎API简述 348 433 | - 15.4.1 创建规则引擎 348 434 | - 15.4.2 配置规则引擎 349 435 | - 15.4.3 数据查询 350 436 | - 15.4.4 执行DMN文件 350 437 | - 15.5 规则匹配 351 438 | - 15.5.1 MVEL表达式简介 351 439 | - 15.5.2 执行第一个表达式 351 440 | - 15.5.3 使用对象执行表达式 352 441 | - 15.5.4 规则引擎规则匹配逻辑 353 442 | - 15.5.5 自定义表达式函数 354 443 | - 15.5.6 Activiti中的自定义表达式函数 355 444 | - 15.5.7 销售打折案例 357 445 | - 15.6 本章小结 360 446 | ### 第16章 整合第三方框架 361 447 | - 16.1 Spring Framework 362 448 | - 16.1.1 Spring的IoC 362 449 | - 16.1.2 Spring的AOP 362 450 | - 16.1.3 使用IoC 363 451 | - 16.1.4 使用AOP 364 452 | - 16.2 Activiti整合Spring 365 453 | - 16.2.1 SpringProcessEngineConfiguration 365 454 | - 16.2.2 资源的部署模式 367 455 | - 16.2.3 ProcessEngineFactoryBean 367 456 | - 16.2.4 在bean中注入Activiti服务 368 457 | - 16.2.5 在Activiti中使用Spring的bean 369 458 | - 16.3 Activiti整合Web项目 371 459 | - 16.3.1 安装Tomcat插件 371 460 | - 16.3.2 加入Spring 373 461 | - 16.3.3 整合Hibernate 375 462 | - 16.3.4 配置声明式事务 377 463 | - 16.3.5 添加Struts配置 378 464 | - 16.3.6 实现一个最简单的逻辑 378 465 | - 16.3.7 测试事务 380 466 | - 16.3.8 添加Activiti 380 467 | - 16.4 Activiti与Spring Boot 381 468 | - 16.4.1 Spring Boot项目简介 381 469 | - 16.4.2 下载与安装Maven 382 470 | - 16.4.3 开发第一个Web应用 383 471 | - 16.4.4 Activiti与Spring Boot的整合 386 472 | - 16.5 Activiti与JPA 388 473 | - 16.5.1 建立与运行JPA项目 388 474 | - 16.5.2 在Activiti中使用JPA 390 475 | - 16.5.3 Activiti、Spring与JPA的整合 391 476 | - 16.5.4 基于JPA的例子 393 477 | - 16.6 本章小结 395 478 | ### 第17章 Activiti开放的Web Service 396 479 | - 17.1 Web Service简介 397 480 | - 17.1.1 Web Service 397 481 | - 17.1.2 SOAP协议 397 482 | - 17.1.3 REST架构 397 483 | - 17.1.4 REST的设计准则 398 484 | - 17.1.5 REST的主要特性 398 485 | - 17.1.6 SOAP RPC与REST的区别 399 486 | - 17.2 使用Sping MVC发布REST 399 487 | - 17.2.1 在Web项目中加入Spring MVC 400 488 | - 17.2.2 发布REST的Web Service 401 489 | - 17.2.3 使用Restlet编写客户端 402 490 | - 17.2.4 使用CXF编写客户端 402 491 | - 17.2.5 使用HttpClient编写客户端 403 492 | - 17.2.6 准备测试数据 403 493 | - 17.2.7 部署Activiti的Web Service 403 494 | - 17.2.8 接口访问权限 404 495 | - 17.2.9 访问Activiti接口 404 496 | - 17.3 流程存储服务 405 497 | - 17.3.1 上传部署文件 405 498 | - 17.3.2 部署数据查询 406 499 | - 17.3.3 部署资源查询 406 500 | - 17.3.4 查询单个部署资源 407 501 | - 17.3.5 删除部署 408 502 | - 17.4 本章小结 409 503 | ### 第18章 Activiti功能进阶 410 504 | - 18.1 流程控制逻辑 411 505 | - 18.1.1 概述 411 506 | - 18.1.2 设计流程对象 411 507 | - 18.1.3 创建流程节点行为类 413 508 | - 18.1.4 编写业务处理类 414 509 | - 18.1.5 将流程XML转换为Java对象 414 510 | - 18.1.6 编写客户端代码 416 511 | - 18.2 Activiti的表单 416 512 | - 18.2.1 概述 416 513 | - 18.2.2 表单属性 417 514 | - 18.2.3 外部表单 418 515 | - 18.2.4 关于动态工作流和动态表单 419 516 | - 18.3 流程图XML 419 517 | - 18.3.1 节点元素 419 518 | - 18.3.2 衔接元素 420 519 | - 18.3.3 流程图与流程文件的转换 420 520 | - 18.4 流程操作 421 521 | - 18.4.1 流程回退 421 522 | - 18.4.2 会签 422 523 | - 18.5 本章小结 424 524 | ### 第19章 办公自动化系统 425 525 | - 19.1 使用技术 426 526 | - 19.1.1 表现层技术 426 527 | - 19.1.2 MVC框架 426 528 | - 19.1.3 Spring和Hibernate 426 529 | - 19.2 功能简述 427 530 | - 19.2.1 系统的角色管理 427 531 | - 19.2.2 薪资计算流程 427 532 | - 19.2.3 请假流程 427 533 | - 19.2.4 薪资调整流程 427 534 | - 19.2.5 报销流程 428 535 | - 19.3 框架整合 428 536 | - 19.3.1 创建Web项目 428 537 | - 19.3.2 整合Spring 429 538 | - 19.3.3 整合Hibernate 430 539 | - 19.3.4 整合Struts2 432 540 | - 19.3.5 整合Activiti 433 541 | - 19.4 数据库设计 434 542 | - 19.4.1 薪资表 434 543 | - 19.4.2 请假记录表 434 544 | - 19.4.3 薪资调整记录表 435 545 | - 19.4.4 报销记录表 436 546 | - 19.5 初始化数据 437 547 | - 19.5.1 初始化角色数据 437 548 | - 19.5.2 薪资计算流程 438 549 | - 19.5.3 请假流程 439 550 | - 19.5.4 报销流程 439 551 | - 19.5.5 薪资调整流程 440 552 | - 19.6 角色管理 441 553 | - 19.6.1 用户组管理 442 554 | - 19.6.2 用户列表 443 555 | - 19.6.3 新建用户 445 556 | - 19.6.4 用户登录 446 557 | - 19.7 流程启动 447 558 | - 19.7.1 启动请假流程 447 559 | - 19.7.2 启动报销流程 450 560 | - 19.7.3 启动薪资调整流程 452 561 | - 19.8 申请列表 453 562 | - 19.8.1 申请列表的实现 453 563 | - 19.8.2 请假申请列表 454 564 | - 19.8.3 报销申请列表 455 565 | - 19.8.4 薪资调整列表 455 566 | - 19.8.5 查看流程图 456 567 | - 19.9 流程任务 457 568 | - 19.9.1 待办任务列表 457 569 | - 19.9.2 领取任务与受理任务列表 459 570 | - 19.9.3 查询任务信息 460 571 | - 19.9.4 任务审批 462 572 | - 19.9.5 运行OA的流程 463 573 | - 19.10 本章小结 463 574 | 575 | 576 | --------------------------------------------------------------------------------