一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術(shù)及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術(shù)|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務器之家 - 編程語言 - Java教程 - springboot2.5.2與 flowable6.6.0整合流程引擎應用分析

springboot2.5.2與 flowable6.6.0整合流程引擎應用分析

2021-10-25 13:04m17193095294 Java教程

這篇文章主要介紹了springboot2.5.2與 flowable6.6.0整合流程引擎應用分析,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下

1.pom

?
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
41
42
43
44
45
46
47
48
49
<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.2</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
 
 
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <flowable.version>6.6.0</flowable.version>
    </properties>
 
         <!--flowable工作流依賴-->
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-spring-boot-starter</artifactId>
            <version>${flowable.version}</version>
        </dependency>
         <!-- https://mvnrepository.com/artifact/org.flowable/flowable-json-converter -->
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-json-converter</artifactId>
            <version>${flowable.version}</version>
        </dependency>
        <!-- app 依賴 包含 rest,logic,conf -->
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-ui-modeler-rest</artifactId>
            <version>${flowable.version}</version>
        </dependency>
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-ui-modeler-logic</artifactId>
            <version>${flowable.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-slf4j-impl</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-ui-modeler-conf</artifactId>
            <version>${flowable.version}</version>
        </dependency>

2.FlowableConfig配置類

?
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package org.fh.config;
 
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
 
/**
 * 說明:Flowable配置
 * 作者:FH Admin
 * from:fhadmin.cn
 */
@Controller
@Configuration
public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
    
    @Override
    public void configure(SpringProcessEngineConfiguration engineConfiguration) {
        engineConfiguration.setActivityFontName("宋體");
        engineConfiguration.setLabelFontName("宋體");
        engineConfiguration.setAnnotationFontName("宋體");
    }
    
}
3.重寫 SecurityUtils 重構(gòu)流程編輯器獲取用戶信息
 
package org.flowable.ui.common.security;
 
import org.fh.util.Jurisdiction;
import org.flowable.common.engine.api.FlowableIllegalStateException;
import org.flowable.idm.api.User;
import org.flowable.ui.common.model.RemoteUser;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * 說明:重構(gòu)流程編輯器獲取用戶信息
 * 作者:FH Admin
 * from:fhadmin.cn
 */
public class SecurityUtils {
 
    private static User assumeUser;
    
    private static SecurityScopeProvider securityScopeProvider = new FlowableSecurityScopeProvider();
 
    private SecurityUtils() {
    }
 
    /**
     * Get the login of the current user.
     */
    public static String getCurrentUserId() {
        User user = getCurrentUserObject();
        if (user != null) {
            return user.getId();
        }
        return null;
    }
 
    /**
     * @return the {@link User} object associated with the current logged in user.
     */
    public static User getCurrentUserObject() {
        if (assumeUser != null) {
            return assumeUser;
        }
 
        RemoteUser user = new RemoteUser();
        user.setId(Jurisdiction.getUsername());
        user.setDisplayName(Jurisdiction.getName());
        user.setFirstName(Jurisdiction.getName());
        user.setLastName(Jurisdiction.getName());
        user.setEmail("[email protected]");
        user.setPassword("123456");
        List<String> pris = new ArrayList<>();
        pris.add(DefaultPrivileges.ACCESS_MODELER);
        pris.add(DefaultPrivileges.ACCESS_IDM);
        pris.add(DefaultPrivileges.ACCESS_ADMIN);
        pris.add(DefaultPrivileges.ACCESS_TASK);
        pris.add(DefaultPrivileges.ACCESS_REST_API);
        user.setPrivileges(pris);
        return user;
    }
    
    public static void setSecurityScopeProvider(SecurityScopeProvider securityScopeProvider) {
        SecurityUtils.securityScopeProvider = securityScopeProvider;
    }
 
    public static SecurityScope getCurrentSecurityScope() {
        SecurityContext securityContext = SecurityContextHolder.getContext();
        if (securityContext != null && securityContext.getAuthentication() != null) {
            return getSecurityScope(securityContext.getAuthentication());
        }
        return null;
    }
 
    public static SecurityScope getSecurityScope(Authentication authentication) {
        return securityScopeProvider.getSecurityScope(authentication);
    }
 
    public static SecurityScope getAuthenticatedSecurityScope() {
        SecurityScope currentSecurityScope = getCurrentSecurityScope();
        if (currentSecurityScope != null) {
            return currentSecurityScope;
        }
        throw new FlowableIllegalStateException("User is not authenticated");
    }
 
    public static void assumeUser(User user) {
        assumeUser = user;
    }
 
    public static void clearAssumeUser() {
        assumeUser = null;
    }
}

工作流模塊----------------www.fhadmin.cn---------------

1.模型管理:web在線流程設(shè)計器、導入導出xml、復制流程、部署流程

2.流程管理:導入導出流程資源文件、查看流程圖、根據(jù)流程實例反射出流程模型、激活掛起

3.運行中流程:查看流程信息、當前任務節(jié)點、當前流程圖、作廢暫停流程、指派待辦人、自由跳轉(zhuǎn)

4.歷史的流程:查看流程信息、流程用時、流程狀態(tài)、查看任務發(fā)起人信息

5.待辦任務:查看本人個人任務以及本角色下的任務、辦理、駁回、作廢、指派一下代理人

6.已辦任務:查看自己辦理過的任務以及流程信息、流程圖、流程狀態(tài)(作廢 駁回 正常完成)

辦理任務時候可以選擇用戶進行抄送,就是給被抄送人發(fā)送站內(nèi)信通知當前審批意見以及備注信息

注:當辦理完當前任務時,下一任務待辦人會即時通訊收到新任務消息提醒,當作廢和完結(jié)任務時,任務發(fā)起人會收到站內(nèi)信消息通知

到此這篇關(guān)于springboot2.5.2與 flowable6.6.0整合流程引擎應用分析的文章就介紹到這了,更多相關(guān)springboot整合 flowable內(nèi)容請搜索服務器之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持服務器之家!

原文鏈接:https://www.cnblogs.com/teacher11/archive/2021/07/27/15064909.html

延伸 · 閱讀

精彩推薦
  • Java教程Java BufferWriter寫文件寫不進去或缺失數(shù)據(jù)的解決

    Java BufferWriter寫文件寫不進去或缺失數(shù)據(jù)的解決

    這篇文章主要介紹了Java BufferWriter寫文件寫不進去或缺失數(shù)據(jù)的解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望...

    spcoder14552021-10-18
  • Java教程小米推送Java代碼

    小米推送Java代碼

    今天小編就為大家分享一篇關(guān)于小米推送Java代碼,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧...

    富貴穩(wěn)中求8032021-07-12
  • Java教程Java使用SAX解析xml的示例

    Java使用SAX解析xml的示例

    這篇文章主要介紹了Java使用SAX解析xml的示例,幫助大家更好的理解和學習使用Java,感興趣的朋友可以了解下...

    大行者10067412021-08-30
  • Java教程xml與Java對象的轉(zhuǎn)換詳解

    xml與Java對象的轉(zhuǎn)換詳解

    這篇文章主要介紹了xml與Java對象的轉(zhuǎn)換詳解的相關(guān)資料,需要的朋友可以參考下...

    Java教程網(wǎng)2942020-09-17
  • Java教程Java實現(xiàn)搶紅包功能

    Java實現(xiàn)搶紅包功能

    這篇文章主要為大家詳細介紹了Java實現(xiàn)搶紅包功能,采用多線程模擬多人同時搶紅包,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙...

    littleschemer13532021-05-16
  • Java教程20個非常實用的Java程序代碼片段

    20個非常實用的Java程序代碼片段

    這篇文章主要為大家分享了20個非常實用的Java程序片段,對java開發(fā)項目有所幫助,感興趣的小伙伴們可以參考一下 ...

    lijiao5352020-04-06
  • Java教程Java8中Stream使用的一個注意事項

    Java8中Stream使用的一個注意事項

    最近在工作中發(fā)現(xiàn)了對于集合操作轉(zhuǎn)換的神器,java8新特性 stream,但在使用中遇到了一個非常重要的注意點,所以這篇文章主要給大家介紹了關(guān)于Java8中S...

    阿杜7472021-02-04
  • Java教程升級IDEA后Lombok不能使用的解決方法

    升級IDEA后Lombok不能使用的解決方法

    最近看到提示IDEA提示升級,尋思已經(jīng)有好久沒有升過級了。升級完畢重啟之后,突然發(fā)現(xiàn)好多錯誤,本文就來介紹一下如何解決,感興趣的可以了解一下...

    程序猿DD9332021-10-08
主站蜘蛛池模板: 欧美18-19sex性处| 洗濯屋し在线观看 | 99草精品视频 | 国产精品污双胞胎在线观看 | 日韩毛片在线影视 | 人人干国产| 亚洲免费精品视频 | 成人永久免费福利视频网站 | 成人性生交大片免费看软件 | 欧美一区不卡二区不卡三区 | 青春草在线观看视频 | 国产成人精品本亚洲 | 草草视频在线观看最新 | 国产成人在线视频 | 亚洲四虎影院 | 美女撒尿无遮挡免费中国 | 日本免费观看95视频网站 | 99视频有精品 | 丁香婷婷在线视频 | 天天综合天天影视色香欲俱全 | 日本妇人成熟免费观看18 | 色综合中文字幕天天在线 | 艹出白浆 | 法国老妇性xx在线播放 | 男女天堂 | 欧美亚洲高清日韩成人 | 欧美va天堂va视频va在线 | zol中关村在线 | 精品久久亚洲 | 欧美xxxxx九色视频免费观看 | 欧美精品一区二区三区久久 | 精品久久一 | 国产rpg迷雾之风冷狐破解 | 手机看片福利盒子久久 | 我的妹妹最近有点怪免费播放 | 青青青手机在线视频 | 国产高清国内精品福利色噜噜 | 日韩精品1| 国产成人免费a在线资源 | 我半夜摸妺妺的奶C了她 | 婷婷久久热99在线精品 |