微服務概覽 微服務是圍繞業務領域建模可獨立發佈的服務。服務封裝了對應功能並可以通過網路被其他服務訪問。 從外部來看,單個微服務被視為一個黑盒子。它使用最合適的協議在一個或多個網路端點(例如,隊列或REST API)上承載業務功能。消費者,無論他們是其他微服務還是其他類型的程式,都通過這些聯網的端點來 ...
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; /** * 說明:重構流程編輯器獲取用戶信息 * 作者:FH Admin * from:www.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; } }
-----------------------------------------------------------------自定義表單
28. 定義模版:拖拽左側表單元素到右側區域,編輯表單元素,保存表單模版
29. 表單模版:編輯維護表單模版,複製表單模版,修改模版類型,預覽表單模版
30. 我的表單:選擇表單模版,編輯表單規則,是否上傳圖片、附件、開啟富文本、掛靠流程開關等
31. 表單數據:從我的表單進去可增刪改查表單數據,修改表單規則
32. 掛靠記錄:記錄表單數據和流程實例ID關聯記錄,可刪除