WangHan
2024-09-12 d5855a4926926698b740bc6c7ba489de47adb68b
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
package tech.powerjob.worker.common.utils;
 
import tech.powerjob.common.serialize.JsonUtils;
 
import java.util.Map;
 
/**
 * 工作流上下文工具类
 *
 * @author Echo009
 * @since 2021/2/20
 */
public class WorkflowContextUtils {
 
    private WorkflowContextUtils() {
 
    }
 
 
    public static boolean isExceededLengthLimit(Map<String, String> appendedWfContext, int maxLength) {
 
        String jsonString = JsonUtils.toJSONString(appendedWfContext);
        if (jsonString == null) {
            // impossible
            return true;
        }
 
        return maxLength < jsonString.length();
 
    }
 
}