001/*
002 *    Copyright 2024-2025, Warm-Flow (290631660@qq.com).
003 *
004 *    Licensed under the Apache License, Version 2.0 (the "License");
005 *    you may not use this file except in compliance with the License.
006 *    You may obtain a copy of the License at
007 *
008 *       https://www.apache.org/licenses/LICENSE-2.0
009 *
010 *    Unless required by applicable law or agreed to in writing, software
011 *    distributed under the License is distributed on an "AS IS" BASIS,
012 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *    See the License for the specific language governing permissions and
014 *    limitations under the License.
015 */
016package org.dromara.warm.flow.core.dto;
017
018import java.io.Serializable;
019import java.util.List;
020import java.util.Map;
021
022/**
023 * 工作流内置参数
024 *
025 * @author warm
026 * @since 2023/3/31 17:18
027 */
028public class FlowParams implements Serializable {
029    private static final long serialVersionUID = 1L;
030
031    /**
032     * 流程编码
033     */
034    private String flowCode;
035
036    /**
037     * 办理人唯一标识
038     */
039    private String handler;
040
041    /**
042     * 节点编码(如果要指定跳转节点,传入)
043     */
044    private String nodeCode;
045
046    /**
047     * 用户权限标识
048     */
049    private List<String> permissionFlag;
050
051    /**
052     * 跳转类型(PASS审批通过 REJECT退回)
053     */
054    private String skipType;
055
056    /**
057     * 审批意见
058     */
059    private String message;
060
061    /**
062     * 流程变量
063     */
064    private Map<String, Object> variable;
065
066    /**
067     * 流程实例状态
068     */
069    private String flowStatus;
070
071    /**
072     * 历史任务表状态
073     */
074    private String hisStatus;
075
076    /**
077     * 流程激活状态(0挂起 1激活)
078     */
079    private Integer activityStatus;
080
081    /**
082     * 协作方式(1审批 2转办 3委派 4会签 5票签 6加签 7减签)
083     */
084    private Integer cooperateType;
085
086    /**
087     * 扩展字段,预留给业务系统使用
088     */
089    private String ext;
090
091    /**
092     * 扩展字段,预留给业务系统使用
093     */
094    private String hisTaskExt;
095
096    /**
097     * 增加办理人:加签,转办,委托
098     */
099    private List<String> addHandlers;
100
101    /**
102     * 减少办理人:减签,委托
103     */
104    private List<String> reductionHandlers;
105
106    /**
107     * 转办忽略权限校验(true:忽略,false:不忽略)
108     */
109    private boolean ignore;
110
111    public static FlowParams build() {
112        return new FlowParams();
113    }
114
115    public FlowParams flowCode(String flowCode) {
116        this.flowCode = flowCode;
117        return this;
118    }
119
120    public FlowParams handler(String handler) {
121        this.handler = handler;
122        return this;
123    }
124
125    public FlowParams nodeCode(String nodeCode) {
126        this.nodeCode = nodeCode;
127        return this;
128    }
129
130    public FlowParams permissionFlag(List<String> permissionFlag) {
131        this.permissionFlag = permissionFlag;
132        return this;
133    }
134
135    public FlowParams skipType(String skipType) {
136        this.skipType = skipType;
137        return this;
138    }
139
140    public FlowParams message(String message) {
141        this.message = message;
142        return this;
143    }
144
145    public FlowParams variable(Map<String, Object> variable) {
146        this.variable = variable;
147        return this;
148    }
149
150    public FlowParams flowStatus(String flowStatus) {
151        this.flowStatus = flowStatus;
152        return this;
153    }
154
155    public FlowParams hisStatus(String hisStatus) {
156        this.hisStatus = hisStatus;
157        return this;
158    }
159
160    public FlowParams activityStatus(Integer activityStatus) {
161        this.activityStatus = activityStatus;
162        return this;
163    }
164
165    public FlowParams cooperateType(Integer cooperateType) {
166        this.cooperateType = cooperateType;
167        return this;
168    }
169
170    public FlowParams ext(String ext) {
171        this.ext = ext;
172        return this;
173    }
174
175    public FlowParams hisTaskExt(String hisTaskExt) {
176        this.hisTaskExt = hisTaskExt;
177        return this;
178    }
179
180    public Map<String, Object> getVariable() {
181        return variable;
182    }
183
184    public String getNodeCode() {
185        return nodeCode;
186    }
187
188    public String getFlowCode() {
189        return flowCode;
190    }
191
192    public String getHandler() {
193        return handler;
194    }
195
196    public List<String> getPermissionFlag() {
197        return permissionFlag;
198    }
199
200    public String getSkipType() {
201        return skipType;
202    }
203
204    public FlowParams setSkipType(String skipType) {
205        this.skipType = skipType;
206        return this;
207    }
208
209    public String getMessage() {
210        return message;
211    }
212
213    public String getExt() {
214        return ext;
215    }
216
217    public String getHisTaskExt() {
218        return hisTaskExt;
219    }
220
221    public String getFlowStatus() {
222        return flowStatus;
223    }
224
225    public String getHisStatus() {
226        return hisStatus;
227    }
228
229    public Integer getActivityStatus() {
230        return activityStatus;
231    }
232
233    public Integer getCooperateType() {
234        return cooperateType;
235    }
236
237    public List<String> getAddHandlers() {
238        return addHandlers;
239    }
240
241    public FlowParams addHandlers(List<String> addHandlers) {
242        this.addHandlers = addHandlers;
243        return this;
244    }
245
246    public List<String> getReductionHandlers() {
247        return reductionHandlers;
248    }
249
250    public FlowParams reductionHandlers(List<String> reductionHandlers) {
251        this.reductionHandlers = reductionHandlers;
252        return this;
253    }
254
255    public boolean isIgnore() {
256        return ignore;
257    }
258
259    public FlowParams ignore(boolean ignore) {
260        this.ignore = ignore;
261        return this;
262    }
263}