当前位置: 首页 > news >正文

免费ppt模板网站哪个好用表白二维码图片

免费ppt模板网站哪个好用,表白二维码图片,最好的wordpress教程,邯郸市教育考试院网站简介 Flowable是什么#xff0c;下面是官方文档介绍#xff1a; Flowable是一个使用Java编写的轻量级业务流程引擎。Flowable流程引擎可用于部署BPMN 2.0流程定义#xff08;用于定义流程的行业XML标准#xff09;#xff0c; 创建这些流程定义的流程实例#xff0c;进行…简介 Flowable是什么下面是官方文档介绍 Flowable是一个使用Java编写的轻量级业务流程引擎。Flowable流程引擎可用于部署BPMN 2.0流程定义用于定义流程的行业XML标准 创建这些流程定义的流程实例进行查询访问运行中或历史的流程实例与相关数据等等。这个章节将用一个可以在你自己的开发环境中使用的例子逐步介绍各种概念与API。 说人话无论是学生还是职场员工都用过OA系统其中的请假流程大家应该都用过一般是发起请假-辅导员审批-院长审批类似这样的流程。如果自己去实现这种功能的话我个人的想法是使用状态机模式每个过程如何流转都需要自己去实现比较麻烦。 而Flowable框架帮我解决了这个麻烦只需要我们遵循BPMN 2.0可以理解为一种流程规范就可以帮我们自动完成。而且它提供了图形化页面只需要使用拖拽的方式就可以完成流程的定义我们只用关注业务逻辑即可。 快速开始 我们先用JavaSE简单体验一下下面会带大家集成SpringBoot和使用图形化界面。 本节例子为发起请求-经理审批审批通过则结束不通过则发送失败邮件。 目录结构 创建Maven工程 添加Flowable依赖和MySQL依赖 dependencygroupIdorg.flowable/groupIdartifactIdflowable-engine/artifactIdversion6.3.0/version/dependencydependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactId/dependency编写BPMN文件 注.bpmn20.xml 是固定后缀名 ?xml version1.0 encodingUTF-8? definitions xmlnshttp://www.omg.org/spec/BPMN/20100524/MODELxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:xsdhttp://www.w3.org/2001/XMLSchemaxmlns:bpmndihttp://www.omg.org/spec/BPMN/20100524/DIxmlns:omgdchttp://www.omg.org/spec/DD/20100524/DCxmlns:omgdihttp://www.omg.org/spec/DD/20100524/DIxmlns:flowablehttp://flowable.org/bpmntypeLanguagehttp://www.w3.org/2001/XMLSchemaexpressionLanguagehttp://www.w3.org/1999/XPathtargetNamespacehttp://www.flowable.org/processdefprocess idholidayRequest nameHoliday Request isExecutabletruestartEvent idstartEvent/sequenceFlow sourceRefstartEvent targetRefapproveTask/userTask idapproveTask nameApprove or reject request flowable:assigneeboss/sequenceFlow sourceRefapproveTask targetRefdecision/exclusiveGateway iddecision/sequenceFlow sourceRefdecision targetRefexternalSystemCallconditionExpression xsi:typetFormalExpression![CDATA[${approved}]]/conditionExpression/sequenceFlowsequenceFlow sourceRefdecision targetRefsendRejectionMailconditionExpression xsi:typetFormalExpression![CDATA[${!approved}]]/conditionExpression/sequenceFlowserviceTask idexternalSystemCall nameEnter holidays in external systemflowable:classorg.flowable.CallExternalSystemDelegate/sequenceFlow sourceRefexternalSystemCall targetRefholidayApprovedTask/userTask idholidayApprovedTask nameHoliday approved/sequenceFlow sourceRefholidayApprovedTask targetRefapproveEnd/serviceTask idsendRejectionMail nameSend out rejection emailflowable:classcom.ego.SendRejectionMail/sequenceFlow sourceRefsendRejectionMail targetRefrejectEnd/endEvent idapproveEnd/endEvent idrejectEnd//process/definitions编写测试类 package com.ego;import org.flowable.engine.*; import org.flowable.engine.history.HistoricActivityInstance; import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration; import org.flowable.task.api.Task;import java.util.HashMap; import java.util.List; import java.util.Map;public class Main {static ProcessEngine processEngine null;static String taskKey holidayRequest;static String boss boss;public static void main(String[] args) {init();deploy(holiday-request.bpmn20.xml);MapString, Object startVariables new HashMap();startVariables.put(employee, ego);startVariables.put(nrOfHolidays, 3);startVariables.put(description, 事假);startProcess(taskKey, startVariables);queryTask(taskKey, boss);MapString, Object completeVariables new HashMap();completeVariables.put(approved, false);completeTask(taskKey, boss, completeVariables);history(holidayRequest:5:10003);}/*** 初始化*/public static void init(){//获取配置类ProcessEngineConfiguration configuration new StandaloneProcessEngineConfiguration();//配置数据库连接configuration.setJdbcDriver(com.mysql.cj.jdbc.Driver).setJdbcUsername(root).setJdbcPassword(root).setJdbcUrl(jdbc:mysql://localhost:3306/flowable-demo?serverTimezoneUTCnullCatalogMeansCurrenttrue)//表结构不存在就自动创建.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);//获取引擎类ProcessEngineprocessEngine configuration.buildProcessEngine();}/*** 部署* param path 配置文件*/public static void deploy(String path){RepositoryService repositoryService processEngine.getRepositoryService();repositoryService.createDeployment().addClasspathResource(path).name(请求流程).deploy();}/*** 启动流程实例* param key 流程id* param variables 参数集合*/public static void startProcess(String key, MapString, Object variables){RuntimeService runtimeService processEngine.getRuntimeService();runtimeService.startProcessInstanceByKey(key, variables);}/*** 查询任务* param key 流程id* param assignee 处理人*/public static void queryTask(String key, String assignee){TaskService taskService processEngine.getTaskService();//查询任务列表ListTask list taskService.createTaskQuery().processDefinitionKey(key).taskAssignee(assignee).list();for (Task task : list) {System.out.println(task.getName());}}/*** 处理任务* param key 流程id* param assignee 处理人* param variables 参数集合*/public static void completeTask(String key, String assignee, MapString, Object variables){TaskService taskService processEngine.getTaskService();ListTask taskList taskService.createTaskQuery().processDefinitionKey(key).taskAssignee(assignee).list();Task task taskList.get(0);taskService.complete(task.getId(), variables);}/*** 查询历史记录* param definitionId*/public static void history(String definitionId){HistoryService historyService processEngine.getHistoryService();ListHistoricActivityInstance list historyService.createHistoricActivityInstanceQuery().processDefinitionId(definitionId).finished().orderByHistoricActivityInstanceEndTime().asc().list();for (HistoricActivityInstance history : list) {System.out.println(history.getActivityName() : history.getActivityId() : history.getDurationInMillis() 毫秒);}}} package com.ego;import org.flowable.engine.delegate.DelegateExecution; import org.flowable.engine.delegate.JavaDelegate;public class SendRejectionMail implements JavaDelegate {Overridepublic void execute(DelegateExecution delegateExecution) {System.out.println(不好意思请假申请未通过...);} } 使用Flowable-ui图形化界面 下载Flowable和Tomcat Flowable网址http://www.flowable.org/downloads.html Tomcat网址http://tomcat.apache.org/ 部署 将Flowable的war包放到Tomcat的webapps目录下然后启动Tomcat 访问http://localhost:8080/flowable-ui默认用户名和密码为 admin / test 绘制 我们此节和下一节用的例子比之前多一个环节由组长和经理两个人审核。 使用建模器绘制绘制后点击导出生成xml文件。 整合SpringBoot 目录结构 创建Maven工程 添加依赖 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion2.7.14/versionrelativePath/ !-- lookup parent from repository --/parentgroupIdcom.ego/groupIdartifactIdflowable/artifactIdversion0.0.1-SNAPSHOT/versionnameflowable/namedescriptionflowable/descriptionpropertiesjava.version1.8/java.version/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependencydependencygroupIdorg.flowable/groupIdartifactIdflowable-spring-boot-starter/artifactIdversion6.7.2/version/dependencydependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdversion8.0.21/version/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactIdversionRELEASE/versionscopecompile/scope/dependency/dependenciesbuildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin/plugins/build/project 编写配置文件 server:port: 8081 spring:datasource:url: jdbc:mysql://localhost:3306/flowable-demo?serverTimezoneAsia/ShanghaiuseSSLfalsenullCatalogMeansCurrenttrueusername: rootpassword: rootdriver-class-name: com.mysql.cj.jdbc.Driverflowable:database-schema-update: true BPMN文件 我们直接将图形化导出的xml文件放到resources目录下即可。 ?xml version1.0 encodingUTF-8? definitions xmlnshttp://www.omg.org/spec/BPMN/20100524/MODEL xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlns:xsdhttp://www.w3.org/2001/XMLSchema xmlns:flowablehttp://flowable.org/bpmn xmlns:bpmndihttp://www.omg.org/spec/BPMN/20100524/DI xmlns:omgdchttp://www.omg.org/spec/DD/20100524/DC xmlns:omgdihttp://www.omg.org/spec/DD/20100524/DI typeLanguagehttp://www.w3.org/2001/XMLSchema expressionLanguagehttp://www.w3.org/1999/XPath targetNamespacehttp://www.flowable.org/processdef exporterFlowable Open Source Modeler exporterVersion6.7.2process idaskForLeave name请假流程 isExecutabletruestartEvent idstartEvent1 flowable:formFieldValidationtrue/userTask idsid-494B6EC2-AC32-4A6F-8A4F-8016190388FA name组长审批 flowable:assignee#{mentor} /userTask idsid-3D540C65-A644-4DF0-B8F5-332B4BD0C338 name请假申请 flowable:assignee#{employee} /sequenceFlow idsid-6B958ED5-8CE1-451A-AF66-F4B22FBA621C sourceRefstartEvent1 targetRefsid-3D540C65-A644-4DF0-B8F5-332B4BD0C338/sequenceFlow idsid-AC31EA26-5738-499E-8634-3B0F88BAEDAC sourceRefsid-3D540C65-A644-4DF0-B8F5-332B4BD0C338 targetRefsid-494B6EC2-AC32-4A6F-8A4F-8016190388FA/exclusiveGateway idsid-1C1F7CC6-1FA3-4F95-83BB-E75B3FDD330B/sequenceFlow idsid-AD16B066-863B-4ED5-8A89-6D4AFC57EAF1 sourceRefsid-494B6EC2-AC32-4A6F-8A4F-8016190388FA targetRefsid-1C1F7CC6-1FA3-4F95-83BB-E75B3FDD330B/userTask idsid-89C5782A-6193-48B8-8891-5C36C46F73A4 name经理审批 flowable:assignee#{manager} /serviceTask idsid-B3B3A401-C199-4F5E-8D96-2D0C21CE2BFB name发送失败邮箱 flowable:classcom.ego.flowable.task.FailTask/exclusiveGateway idsid-CB500461-17D2-4CEF-95E1-BF53CBC1116A/endEvent idsid-295CD660-15BC-45FE-8618-4CDCFE832FD7/endEvent idsid-22B062BD-ED1C-49DE-B97A-ADC092FB9F3B/sequenceFlow idsid-BC00842A-2187-47A3-8348-49629CA3C90C sourceRefsid-B3B3A401-C199-4F5E-8D96-2D0C21CE2BFB targetRefsid-22B062BD-ED1C-49DE-B97A-ADC092FB9F3B/sequenceFlow idsid-D29EA250-62A9-4976-B98F-6214DBD4D5A4 sourceRefsid-89C5782A-6193-48B8-8891-5C36C46F73A4 targetRefsid-CB500461-17D2-4CEF-95E1-BF53CBC1116A/sequenceFlow idsid-A5E01BEF-690A-4126-AD87-5DD05BBD57F7 sourceRefsid-CB500461-17D2-4CEF-95E1-BF53CBC1116A targetRefsid-295CD660-15BC-45FE-8618-4CDCFE832FD7conditionExpression xsi:typetFormalExpression![CDATA[ ${approved} ]]/conditionExpression/sequenceFlowsequenceFlow idsid-A93D00FB-8777-47FB-8E4E-FB51E487956B sourceRefsid-1C1F7CC6-1FA3-4F95-83BB-E75B3FDD330B targetRefsid-89C5782A-6193-48B8-8891-5C36C46F73A4conditionExpression xsi:typetFormalExpression![CDATA[ ${approved} ]]/conditionExpression/sequenceFlowsequenceFlow idsid-41511EEA-AB96-474B-9A1D-A534F5A459DC sourceRefsid-CB500461-17D2-4CEF-95E1-BF53CBC1116A targetRefsid-B3B3A401-C199-4F5E-8D96-2D0C21CE2BFBconditionExpression xsi:typetFormalExpression![CDATA[ ${!approved} ]]/conditionExpression/sequenceFlowsequenceFlow idsid-2836484B-86A0-473D-84D2-6BF40FDD652A sourceRefsid-1C1F7CC6-1FA3-4F95-83BB-E75B3FDD330B targetRefsid-B3B3A401-C199-4F5E-8D96-2D0C21CE2BFBconditionExpression xsi:typetFormalExpression![CDATA[ ${!approved} ]]/conditionExpression/sequenceFlow/processbpmndi:BPMNDiagram idBPMNDiagram_askForLeavebpmndi:BPMNPlane bpmnElementaskForLeave idBPMNPlane_askForLeavebpmndi:BPMNShape bpmnElementstartEvent1 idBPMNShape_startEvent1omgdc:Bounds height30.0 width30.000000000000007 x59.99999821186071 y149.99999061226887//bpmndi:BPMNShapebpmndi:BPMNShape bpmnElementsid-494B6EC2-AC32-4A6F-8A4F-8016190388FA idBPMNShape_sid-494B6EC2-AC32-4A6F-8A4F-8016190388FAomgdc:Bounds height79.99999999999999 width100.00000000000006 x419.999987483025 y124.99998688697896//bpmndi:BPMNShapebpmndi:BPMNShape bpmnElementsid-3D540C65-A644-4DF0-B8F5-332B4BD0C338 idBPMNShape_sid-3D540C65-A644-4DF0-B8F5-332B4BD0C338omgdc:Bounds height80.0 width100.0 x215.99999207258247 y124.99999508261695//bpmndi:BPMNShapebpmndi:BPMNShape bpmnElementsid-1C1F7CC6-1FA3-4F95-83BB-E75B3FDD330B idBPMNShape_sid-1C1F7CC6-1FA3-4F95-83BB-E75B3FDD330Bomgdc:Bounds height40.0 width40.0 x564.999987483025 y144.99998688697895//bpmndi:BPMNShapebpmndi:BPMNShape bpmnElementsid-89C5782A-6193-48B8-8891-5C36C46F73A4 idBPMNShape_sid-89C5782A-6193-48B8-8891-5C36C46F73A4omgdc:Bounds height80.0 width100.0 x649.999987483025 y124.99998688697895//bpmndi:BPMNShapebpmndi:BPMNShape bpmnElementsid-B3B3A401-C199-4F5E-8D96-2D0C21CE2BFB idBPMNShape_sid-B3B3A401-C199-4F5E-8D96-2D0C21CE2BFBomgdc:Bounds height80.0 width100.0 x534.9999715387834 y269.9999678134942//bpmndi:BPMNShapebpmndi:BPMNShape bpmnElementsid-CB500461-17D2-4CEF-95E1-BF53CBC1116A idBPMNShape_sid-CB500461-17D2-4CEF-95E1-BF53CBC1116Aomgdc:Bounds height40.0 width40.0 x794.999987483025 y144.99998688697895//bpmndi:BPMNShapebpmndi:BPMNShape bpmnElementsid-295CD660-15BC-45FE-8618-4CDCFE832FD7 idBPMNShape_sid-295CD660-15BC-45FE-8618-4CDCFE832FD7omgdc:Bounds height28.0 width28.0 x879.999987483025 y150.99998688697895//bpmndi:BPMNShapebpmndi:BPMNShape bpmnElementsid-22B062BD-ED1C-49DE-B97A-ADC092FB9F3B idBPMNShape_sid-22B062BD-ED1C-49DE-B97A-ADC092FB9F3Bomgdc:Bounds height28.0 width28.0 x434.99998703599016 y295.999958992008//bpmndi:BPMNShapebpmndi:BPMNEdge bpmnElementsid-AC31EA26-5738-499E-8634-3B0F88BAEDAC idBPMNEdge_sid-AC31EA26-5738-499E-8634-3B0F88BAEDAC flowable:sourceDockerX50.0 flowable:sourceDockerY40.0 flowable:targetDockerX50.00000000000003 flowable:targetDockerY39.99999999999999omgdi:waypoint x315.9499920725825 y164.9999930738821/omgdi:waypoint x419.9999870473585 y164.99998889370505//bpmndi:BPMNEdgebpmndi:BPMNEdge bpmnElementsid-6B958ED5-8CE1-451A-AF66-F4B22FBA621C idBPMNEdge_sid-6B958ED5-8CE1-451A-AF66-F4B22FBA621C flowable:sourceDockerX15.0 flowable:sourceDockerY15.0 flowable:targetDockerX50.0 flowable:targetDockerY40.0omgdi:waypoint x89.94999771072398 y164.9999909621731/omgdi:waypoint x215.99999203304566 y164.99999391236872//bpmndi:BPMNEdgebpmndi:BPMNEdge bpmnElementsid-2836484B-86A0-473D-84D2-6BF40FDD652A idBPMNEdge_sid-2836484B-86A0-473D-84D2-6BF40FDD652A flowable:sourceDockerX20.5 flowable:sourceDockerY20.5 flowable:targetDockerX50.0 flowable:targetDockerY40.0omgdi:waypoint x585.4340131410052 y184.50916665252876/omgdi:waypoint x585.138211259262 y269.9999678134942//bpmndi:BPMNEdgebpmndi:BPMNEdge bpmnElementsid-AD16B066-863B-4ED5-8A89-6D4AFC57EAF1 idBPMNEdge_sid-AD16B066-863B-4ED5-8A89-6D4AFC57EAF1 flowable:sourceDockerX50.000000000000036 flowable:sourceDockerY40.0 flowable:targetDockerX20.5 flowable:targetDockerY20.5omgdi:waypoint x519.9499874830227 y165.2162206532127/omgdi:waypoint x565.4130309612859 y165.41303036523982//bpmndi:BPMNEdgebpmndi:BPMNEdge bpmnElementsid-D29EA250-62A9-4976-B98F-6214DBD4D5A4 idBPMNEdge_sid-D29EA250-62A9-4976-B98F-6214DBD4D5A4 flowable:sourceDockerX50.0 flowable:sourceDockerY40.0 flowable:targetDockerX20.5 flowable:targetDockerY20.5omgdi:waypoint x749.949987483023 y165.21622065321273/omgdi:waypoint x795.4130309612859 y165.41303036523982//bpmndi:BPMNEdgebpmndi:BPMNEdge bpmnElementsid-BC00842A-2187-47A3-8348-49629CA3C90C idBPMNEdge_sid-BC00842A-2187-47A3-8348-49629CA3C90C flowable:sourceDockerX50.0 flowable:sourceDockerY40.0 flowable:targetDockerX14.0 flowable:targetDockerY14.0omgdi:waypoint x534.9999715387834 y309.9999645703004/omgdi:waypoint x462.9499152959249 y309.9999598968591//bpmndi:BPMNEdgebpmndi:BPMNEdge bpmnElementsid-A5E01BEF-690A-4126-AD87-5DD05BBD57F7 idBPMNEdge_sid-A5E01BEF-690A-4126-AD87-5DD05BBD57F7 flowable:sourceDockerX20.5 flowable:sourceDockerY20.5 flowable:targetDockerX14.0 flowable:targetDockerY14.0omgdi:waypoint x834.5591744228417 y165.37819201518406/omgdi:waypoint x880.0002630355089 y165.08883877124302//bpmndi:BPMNEdgebpmndi:BPMNEdge bpmnElementsid-41511EEA-AB96-474B-9A1D-A534F5A459DC idBPMNEdge_sid-41511EEA-AB96-474B-9A1D-A534F5A459DC flowable:sourceDockerX20.000012516974948 flowable:sourceDockerY35.00001326203267 flowable:targetDockerX99.0 flowable:targetDockerY40.0omgdi:waypoint x812.0900320941328 y182.06913118148157/omgdi:waypoint x634.9499715387833 y309.28173606088245//bpmndi:BPMNEdgebpmndi:BPMNEdge bpmnElementsid-A93D00FB-8777-47FB-8E4E-FB51E487956B idBPMNEdge_sid-A93D00FB-8777-47FB-8E4E-FB51E487956B flowable:sourceDockerX20.5 flowable:sourceDockerY20.5 flowable:targetDockerX50.0 flowable:targetDockerY40.0omgdi:waypoint x604.5247245557606 y165.4166535536456/omgdi:waypoint x649.999987483025 y165.2181091577213//bpmndi:BPMNEdge/bpmndi:BPMNPlane/bpmndi:BPMNDiagram /definitions 编写Controller 为简化步骤本案例将业务逻辑放在Controller里实际开发请放到Service中。 package com.ego.flowable.controller;import org.flowable.bpmn.model.BpmnModel; import org.flowable.engine.*; import org.flowable.engine.runtime.Execution; import org.flowable.engine.runtime.ProcessInstance; import org.flowable.image.ProcessDiagramGenerator; import org.flowable.task.api.Task; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController;import javax.servlet.http.HttpServletResponse; import java.io.InputStream; import java.io.OutputStream; import java.util.*;RestController public class AskForLeaveController {private static final Logger LOGGER LoggerFactory.getLogger(AskForLeaveController.class);AutowiredRuntimeService runtimeService;AutowiredTaskService taskService;AutowiredRepositoryService repositoryService;AutowiredProcessEngine processEngine;private static final String EMPLOYEE 1001;private static final String MENTOR 101;private static final String MANAGER 10;/*** 查看流程图* param resp* param processId 流程id* throws Exception*/GetMapping(/pic)public void showPic(HttpServletResponse resp, String processId) throws Exception {ProcessInstance pi runtimeService.createProcessInstanceQuery().processInstanceId(processId).singleResult();if (pi null) {return;}ListExecution executions runtimeService.createExecutionQuery().processInstanceId(processId).list();ListString activityIds new ArrayList();ListString flows new ArrayList();for (Execution exe : executions) {ListString ids runtimeService.getActiveActivityIds(exe.getId());activityIds.addAll(ids);}/*** 生成流程图*/BpmnModel bpmnModel repositoryService.getBpmnModel(pi.getProcessDefinitionId());ProcessEngineConfiguration engconf processEngine.getProcessEngineConfiguration();ProcessDiagramGenerator diagramGenerator engconf.getProcessDiagramGenerator();InputStream in diagramGenerator.generateDiagram(bpmnModel, png, activityIds, flows, engconf.getActivityFontName(), engconf.getLabelFontName(), engconf.getAnnotationFontName(), engconf.getClassLoader(), 1.0, false);OutputStream out null;byte[] buf new byte[1024];int legth 0;try {out resp.getOutputStream();while ((legth in.read(buf)) ! -1) {out.write(buf, 0, legth);}} finally {if (in ! null) {in.close();}if (out ! null) {out.close();}}}/*** 开启流程*/PostMapping(/start)public void start(){MapString, Object map new HashMap();map.put(employee, EMPLOYEE);map.put(name, ego);map.put(reason, 出去玩);map.put(days, 10);ProcessInstance instance runtimeService.startProcessInstanceByKey(askForLeave, map);LOGGER.info(开启请假流程 processId:{}, instance.getId());}/*** 员工提交给组长*/PostMapping(/submitToMentor)public void submitToMentor(){ListTask list taskService.createTaskQuery().taskAssignee(EMPLOYEE).orderByTaskId().desc().list();for (Task task : list) {MapString, Object variables taskService.getVariables(task.getId());LOGGER.info(员工任务任务id:{}, 请假人{}, 请假原因{}, 请假天数{}, task.getId(), variables.get(name), variables.get(reason), variables.get(days));MapString, Object map new HashMap();map.put(mentor, MENTOR);taskService.complete(task.getId(), map);}}/*** 组长提交给经理* param approved 是否通过*/PostMapping(/submitToManager)public void submitToManager(Boolean approved){System.out.println(approved);ListTask list taskService.createTaskQuery().taskAssignee(MENTOR).orderByTaskId().desc().list();for (Task task : list) {MapString, Object variables taskService.getVariables(task.getId());LOGGER.info(组长任务任务id:{}, 请假人{}, 请假原因{}, 请假天数{}, task.getId(), variables.get(name), variables.get(reason), variables.get(days));MapString, Object map new HashMap();map.put(approved, approved);if(approved){map.put(manager, MANAGER);}taskService.complete(task.getId(), map);}}/*** 经理审核* param approved 是否通过*/PostMapping(/managerApprove)public void managerApprove(Boolean approved){ListTask list taskService.createTaskQuery().taskAssignee(MANAGER).orderByTaskId().desc().list();for (Task task : list) {MapString, Object variables taskService.getVariables(task.getId());LOGGER.info(经理任务任务id:{}, 请假人{}, 请假原因{}, 请假天数{}, task.getId(), variables.get(name), variables.get(reason), variables.get(days));MapString, Object map new HashMap();map.put(approved, approved);taskService.complete(task.getId(), map);}} } package com.ego.flowable.task;import org.flowable.engine.delegate.DelegateExecution; import org.flowable.engine.delegate.JavaDelegate;public class FailTask implements JavaDelegate {Overridepublic void execute(DelegateExecution delegateExecution) {System.out.println(请假失败...);} } 流程图中文显示方框问题 配置一下即可。 package com.ego.flowable.config;import org.flowable.spring.SpringProcessEngineConfiguration; import org.flowable.spring.boot.EngineConfigurationConfigurer; import org.springframework.context.annotation.Configuration;Configuration public class FlowableConfig implements EngineConfigurationConfigurerSpringProcessEngineConfiguration {Overridepublic void configure(SpringProcessEngineConfiguration springProcessEngineConfiguration) {springProcessEngineConfiguration.setActivityFontName(宋体);springProcessEngineConfiguration.setLabelFontName(宋体);springProcessEngineConfiguration.setAnnotationFontName(宋体);} }
http://www.zqtcl.cn/news/518127/

相关文章:

  • 怎么建个私人网站网络营销就业前景和薪水
  • 专业的网站开发团队京东电商平台
  • 做网站手机微信小程序怎么加入我的小程序
  • 做网站困难吗公司如何注册网站
  • 可信网站认证收费吗建设化工网站的目的
  • 查网站死链必用工具微信 wordpress
  • 做网站凡科新手如何开微商城店
  • 网站空间维护个人怎么注册一个品牌
  • 连云港网站设计城乡建设网站 资料员
  • 网络优化工程师有多累seo前线
  • 囊谦县公司网站建设新沂网页定制
  • 公众平台网页版wordpress换主题影响seo吗
  • 网站建设什么是静态网页设置wordpress文章标题高亮的代码
  • 男女做那事是什 网站wordpress怎么上传ppt
  • 电商网站图片处理东莞网络营销策划
  • 做知识产权相关的网站网站怎么做登录界面
  • 网站空间备份东莞企业网站教程
  • 新桥企业网站建设有关网站建设的毕业设计
  • 中山网站建设工作修改wordpress后台地址
  • 西安app网站开发如何制作一个自己的网页
  • 陇西学做网站鄂州网约车
  • 做类似58类型网站免费源码分享
  • 个人做的网站有什么危险网站模板怎样发布
  • 设计建设网站公司网站wordpress k2
  • 公司网站被抄袭网络宣传
  • 企业网站设计收费专业网络推广公司排名
  • 视频网站模板源码深圳网站建设明细报价表
  • nike官方网站定制二级域名网站有哪些
  • 越秀移动网站建设房门户网站如何做优化
  • 什么软件可以做动漫视频网站开发一个小程序大概要多少钱