• ACTIVITI工作流的集成记录


    1、添加jar包

    <activiti.version>5.22.0</activiti.version>
    <!-- Activiti -->
    <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-engine</artifactId>
    <version>${activiti.version}</version>
    </dependency>
    <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-spring</artifactId>
    <version>${activiti.version}</version>
    </dependency>
    <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-explorer</artifactId>
    <version>${activiti.version}</version>
    <exclusions>
    <exclusion>
    <artifactId>vaadin</artifactId>
    <groupId>com.vaadin</groupId>
    </exclusion>
    <exclusion>
    <artifactId>dcharts-widget</artifactId>
    <groupId>org.vaadin.addons</groupId>
    </exclusion>
    <exclusion>
    <artifactId>activiti-simple-workflow</artifactId>
    <groupId>org.activiti</groupId>
    </exclusion>
    </exclusions>
    </dependency>
    <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-modeler</artifactId>
    <version>${activiti.version}</version>
    </dependency>
    <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-diagram-rest</artifactId>
    <version>${activiti.version}</version>
    </dependency>
    <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-rest</artifactId>
    <version>${activiti.version}</version>
    </dependency>


    2、原理

    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    
    RuntimeService runtimeService = processEngine.getRuntimeService();
    RepositoryService repositoryService = processEngine.getRepositoryService();
    TaskService taskService = processEngine.getTaskService();
    ManagementService managementService = processEngine.getManagementService();
    IdentityService identityService = processEngine.getIdentityService();
    HistoryService historyService = processEngine.getHistoryService();
    FormService formService = processEngine.getFormService();

    3、常见使用设计规则

    (1)bpmn规范中:在编辑模型的时候,可给定任务执行人

    (2)领取任务:在模型中没有指定执行人的时候,可以使用TaskService#claim领取任务(当然不领取任务,也是可以完成任务的)

    (3)完成任务:为了业务的完整性,必须有人先领取任务,才能完成任务

    (4)审批是否通过:activiti中有变量这一概念,通过这一概念,可以在流程完毕的时候,判断审批是否通过。      pass(dataType=Integer)://流程是否全部审批通过 1:全部通过 | 0:流程不通过

    (5)流程模型设计:每个任务后面都设置一个互斥网关,一个是通过进入下一步,一个是不通过结束流程(赋值变量),这样在流程完成的时候根据变量判断流程是否审批通过

    4、常用service封装

    详见:https://git.oschina.net/bunic/qy-erp/tree/master/erp-common/src/main/java/com/qysxy/erp/framework/activiti

    5、集成activiti-explore,web流程设计器

    js包:https://git.oschina.net/bunic/qy-erp/tree/master/erp-acceptor/src/main/webapp/third/activiti

    json接口:https://git.oschina.net/bunic/qy-erp/tree/master/erp-acceptor/src/main/java/com/qysxy/erp/common/activiti

    /service/model/{modelId}/save
    /service/model/{modelId}/json
    /service/editor/stencilset



    
    
    
    
  • 相关阅读:
    前端Tips#3
    前端Tips#2
    图算法
    【Javascript】重新绑定默认事件
    【Yeoman】热部署web前端开发环境
    添加远程链接MySQL的权限
    background-clip 背景图片做适当的裁剪
    linux系统下将php和mysql命令加入到环境变量中的方法
    background-size 设置背景图片的大小
    multiple backgrounds 多重背景
  • 原文地址:https://www.cnblogs.com/yuan951/p/7442720.html
Copyright © 2020-2023  润新知