• DataObjectImpl


    Survive by day and develop by night.
    talk for import biz , show your perfect code,full busy,skip hardness,make a better result,wait for change,challenge Survive.
    happy for hardess to solve denpendies.

    目录

    在这里插入图片描述

    概述

    DataObjectImpl的是一个非常常见的需求。

    需求:

    设计思路

    实现思路分析

    1.DataObjectImpl

     private String name;
      private Object value;
      private String description;
      private String localizedName;
      private String localizedDescription;
      private String dataObjectDefinitionKey;
    
      private String type;
    
      public DataObjectImpl(String name, Object value, String description, String type, String localizedName,
          String localizedDescription, String dataObjectDefinitionKey) {
    
        this.name = name;
        this.value = value;
        this.type = type;
        this.description = description;
        this.localizedName = localizedName;
        this.localizedDescription = localizedDescription;
        this.dataObjectDefinitionKey = dataObjectDefinitionKey;
      }
    
      public String getName() {
        return name;
      }
    
      public void setName(String name) {
        this.name = name;
      }
    
      public String getLocalizedName() {
        if (localizedName != null && localizedName.length() > 0) {
          return localizedName;
        } else {
          return name;
        }
      }
    
      public void setLocalizedName(String localizedName) {
        this.localizedName = localizedName;
      }
    
      public String getDescription() {
        if (localizedDescription != null && localizedDescription.length() > 0) {
          return localizedDescription;
        } else {
          return description;
        }
      }
    
      public void setDescription(String description) {
        this.description = description;
      }
    
      public Object getValue() {
        return value;
      }
    
      public void setValue(Object value) {
        this.value = value;
      }
    
      public String getType() {
        return type;
      }
    
      public void setType(String type) {
        this.type = type;
      }
    
    
      public String getDataObjectDefinitionKey() {
        return dataObjectDefinitionKey;
      }
    
    
      public void setDataObjectDefinitionKey(String dataObjectDefinitionKey) {
        this.dataObjectDefinitionKey = dataObjectDefinitionKey;
      }
    }
    
    
    • 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

    2.DeadLetterJobQueryImpl

    public class DeadLetterJobQueryImpl extends AbstractQuery<DeadLetterJobQuery, Job> implements DeadLetterJobQuery, Serializable {
    
      private static final long serialVersionUID = 1L;
      protected String id;
      protected String processInstanceId;
      protected String executionId;
      protected String processDefinitionId;
      protected boolean executable;
      protected boolean onlyTimers;
      protected boolean onlyMessages;
      protected Date duedateHigherThan;
      protected Date duedateLowerThan;
      protected Date duedateHigherThanOrEqual;
      protected Date duedateLowerThanOrEqual;
      protected boolean withException;
      protected String exceptionMessage;
      protected String tenantId;
      protected String tenantIdLike;
      protected boolean withoutTenantId;
    
      public DeadLetterJobQueryImpl() {
      }
    
      public DeadLetterJobQueryImpl(CommandContext commandContext) {
        super(commandContext);
      }
    
      public DeadLetterJobQueryImpl(CommandExecutor commandExecutor) {
        super(commandExecutor);
      }
    
      public DeadLetterJobQueryImpl jobId(String jobId) {
        if (jobId == null) {
          throw new ActivitiIllegalArgumentException("Provided job id is null");
        }
        this.id = jobId;
        return this;
      }
    
      public DeadLetterJobQueryImpl processInstanceId(String processInstanceId) {
        if (processInstanceId == null) {
          throw new ActivitiIllegalArgumentException("Provided process instance id is null");
        }
        this.processInstanceId = processInstanceId;
        return this;
      }
    
      public DeadLetterJobQueryImpl processDefinitionId(String processDefinitionId) {
        if (processDefinitionId == null) {
          throw new ActivitiIllegalArgumentException("Provided process definition id is null");
        }
        this.processDefinitionId = processDefinitionId;
        return this;
      }
    
      public DeadLetterJobQueryImpl executionId(String executionId) {
        if (executionId == null) {
          throw new ActivitiIllegalArgumentException("Provided execution id is null");
        }
        this.executionId = executionId;
        return this;
      }
    
      public DeadLetterJobQueryImpl executable() {
        executable = true;
        return this;
      }
    
      public DeadLetterJobQueryImpl timers() {
        if (onlyMessages) {
          throw new ActivitiIllegalArgumentException("Cannot combine onlyTimers() with onlyMessages() in the same query");
        }
        this.onlyTimers = true;
        return this;
      }
    
      public DeadLetterJobQueryImpl messages() {
        if (onlyTimers) {
          throw new ActivitiIllegalArgumentException("Cannot combine onlyTimers() with onlyMessages() in the same query");
        }
        this.onlyMessages = true;
        return this;
      }
    
      public DeadLetterJobQueryImpl duedateHigherThan(Date date) {
        if (date == null) {
          throw new ActivitiIllegalArgumentException("Provided date is null");
        }
        this.duedateHigherThan = date;
        return this;
      }
    
      public DeadLetterJobQueryImpl duedateLowerThan(Date date) {
        if (date == null) {
          throw new ActivitiIllegalArgumentException("Provided date is null");
        }
        this.duedateLowerThan = date;
        return this;
      }
    
      public DeadLetterJobQueryImpl duedateHigherThen(Date date) {
        return duedateHigherThan(date);
      }
    
      public DeadLetterJobQueryImpl duedateHigherThenOrEquals(Date date) {
        if (date == null) {
          throw new ActivitiIllegalArgumentException("Provided date is null");
        }
        this.duedateHigherThanOrEqual = date;
        return this;
      }
    
      public DeadLetterJobQueryImpl duedateLowerThen(Date date) {
        return duedateLowerThan(date);
      }
    
      public DeadLetterJobQueryImpl duedateLowerThenOrEquals(Date date) {
        if (date == null) {
          throw new ActivitiIllegalArgumentException("Provided date is null");
        }
        this.duedateLowerThanOrEqual = date;
        return this;
      }
    
      public DeadLetterJobQueryImpl withException() {
        this.withException = true;
        return this;
      }
    
      public DeadLetterJobQueryImpl exceptionMessage(String exceptionMessage) {
        if (exceptionMessage == null) {
          throw new ActivitiIllegalArgumentException("Provided exception message is null");
        }
        this.exceptionMessage = exceptionMessage;
        return this;
      }
    
      public DeadLetterJobQueryImpl jobTenantId(String tenantId) {
        if (tenantId == null) {
          throw new ActivitiIllegalArgumentException("job is null");
        }
        this.tenantId = tenantId;
        return this;
      }
    
      public DeadLetterJobQueryImpl jobTenantIdLike(String tenantIdLike) {
        if (tenantIdLike == null) {
          throw new ActivitiIllegalArgumentException("job is null");
        }
        this.tenantIdLike = tenantIdLike;
        return this;
      }
    
    • 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
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152

    3.DeploymentQueryImpl

    public class DeploymentQueryImpl extends AbstractQuery<DeploymentQuery, Deployment> implements DeploymentQuery, Serializable {
    
      private static final long serialVersionUID = 1L;
      protected String deploymentId;
      protected String name;
      protected String nameLike;
      protected String category;
      protected String categoryLike;
      protected String categoryNotEquals;
      protected String key;
      protected String keyLike;
      protected String tenantId;
      protected String tenantIdLike;
      protected boolean withoutTenantId;
      protected String processDefinitionKey;
      protected String processDefinitionKeyLike;
      protected boolean latest;
      protected boolean latestVersion;
    
      public DeploymentQueryImpl() {
      }
    
      public DeploymentQueryImpl(CommandContext commandContext) {
        super(commandContext);
      }
    
      public DeploymentQueryImpl(CommandExecutor commandExecutor) {
        super(commandExecutor);
      }
    
      public DeploymentQueryImpl deploymentId(String deploymentId) {
        if (deploymentId == null) {
          throw new ActivitiIllegalArgumentException("Deployment id is null");
        }
        this.deploymentId = deploymentId;
        return this;
      }
    
      public DeploymentQueryImpl deploymentName(String deploymentName) {
        if (deploymentName == null) {
          throw new ActivitiIllegalArgumentException("deploymentName is null");
        }
        this.name = deploymentName;
        return this;
      }
    
      public DeploymentQueryImpl deploymentNameLike(String nameLike) {
        if (nameLike == null) {
          throw new ActivitiIllegalArgumentException("deploymentNameLike is null");
        }
        this.nameLike = nameLike;
        return this;
      }
    
      public DeploymentQueryImpl deploymentCategory(String deploymentCategory) {
        if (deploymentCategory == null) {
          throw new ActivitiIllegalArgumentException("deploymentCategory is null");
        }
        this.category = deploymentCategory;
        return this;
      }
    
      public DeploymentQueryImpl deploymentCategoryLike(String categoryLike) {
        if (categoryLike == null) {
          throw new ActivitiIllegalArgumentException("deploymentCategoryLike is null");
        }
        this.categoryLike = categoryLike;
        return this;
      }
    
      public DeploymentQueryImpl deploymentCategoryNotEquals(String deploymentCategoryNotEquals) {
        if (deploymentCategoryNotEquals == null) {
          throw new ActivitiIllegalArgumentException("deploymentCategoryExclude is null");
        }
        this.categoryNotEquals = deploymentCategoryNotEquals;
        return this;
      }
    
      public DeploymentQueryImpl deploymentKey(String deploymentKey) {
        if (deploymentKey == null) {
          throw new ActivitiIllegalArgumentException("deploymentKey is null");
        }
        this.key = deploymentKey;
        return this;
      }
    
      public DeploymentQueryImpl deploymentKeyLike(String deploymentKeyLike) {
        if (deploymentKeyLike == null) {
          throw new ActivitiIllegalArgumentException("deploymentKeyLike is null");
        }
        this.keyLike = deploymentKeyLike;
        return this;
      }
    
      public DeploymentQueryImpl deploymentTenantId(String tenantId) {
        if (tenantId == null) {
          throw new ActivitiIllegalArgumentException("deploymentTenantId is null");
        }
        this.tenantId = tenantId;
        return this;
      }
    
      public DeploymentQueryImpl deploymentTenantIdLike(String tenantIdLike) {
        if (tenantIdLike == null) {
          throw new ActivitiIllegalArgumentException("deploymentTenantIdLike is null");
        }
        this.tenantIdLike = tenantIdLike;
        return this;
      }
    
      public DeploymentQueryImpl deploymentWithoutTenantId() {
        this.withoutTenantId = true;
        return this;
      }
    
      public DeploymentQueryImpl processDefinitionKey(String key) {
        if (key == null) {
          throw new ActivitiIllegalArgumentException("key is null");
        }
        this.processDefinitionKey = key;
        return this;
      }
    
      public DeploymentQueryImpl processDefinitionKeyLike(String keyLike) {
        if (keyLike == null) {
          throw new ActivitiIllegalArgumentException("keyLike is null");
        }
        this.processDefinitionKeyLike = keyLike;
        return this;
      }
    
      public DeploymentQueryImpl latest() {
        if (key == null) {
          throw new ActivitiIllegalArgumentException("latest can only be used together with a deployment key");
        }
    
        this.latest = true;
        return this;
      }
    
      @Override
      public DeploymentQuery latestVersion() {
        this.latestVersion = true;
    
        return this;
      }
    
    
    • 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
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147

    在这里插入图片描述

    4.Direction

    public class Direction {
    
      private static final Map<String, Direction> directions = new HashMap<String, Direction>();
    
      public static final Direction ASCENDING = new Direction("asc");
      public static final Direction DESCENDING = new Direction("desc");
    
      private String name;
    
      public Direction(String name) {
        this.name = name;
        directions.put(name, this);
      }
    
      public String getName() {
        return name;
      }
    
      public static Direction findByName(String directionName) {
        return directions.get(directionName);
      }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22

    在这里插入图片描述

    5.DynamicBpmnServiceImpl

    public class DynamicBpmnServiceImpl extends ServiceImpl implements DynamicBpmnService, DynamicBpmnConstants {
    
      public DynamicBpmnServiceImpl(ProcessEngineConfigurationImpl processEngineConfiguration) {
        super(processEngineConfiguration);
      }
    
      public ObjectNode getProcessDefinitionInfo(String processDefinitionId) {
        return commandExecutor.execute(new GetProcessDefinitionInfoCmd(processDefinitionId));
      }
    
      public void saveProcessDefinitionInfo(String processDefinitionId, ObjectNode infoNode) {
        commandExecutor.execute(new SaveProcessDefinitionInfoCmd(processDefinitionId, infoNode));
      }
    
      public ObjectNode changeServiceTaskClassName(String id, String className) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeServiceTaskClassName(id, className, infoNode);
        return infoNode;
      }
    
      public void changeServiceTaskClassName(String id, String className, ObjectNode infoNode) {
        setElementProperty(id, SERVICE_TASK_CLASS_NAME, className, infoNode);
      }
    
      public ObjectNode changeServiceTaskExpression(String id, String expression) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeServiceTaskExpression(id, expression, infoNode);
        return infoNode;
      }
    
      public void changeServiceTaskExpression(String id, String expression, ObjectNode infoNode) {
        setElementProperty(id, SERVICE_TASK_EXPRESSION, expression, infoNode);
      }
    
      public ObjectNode changeServiceTaskDelegateExpression(String id, String expression) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeServiceTaskDelegateExpression(id, expression, infoNode);
        return infoNode;
      }
    
      public void changeServiceTaskDelegateExpression(String id, String expression, ObjectNode infoNode) {
        setElementProperty(id, SERVICE_TASK_DELEGATE_EXPRESSION, expression, infoNode);
      }
    
      public ObjectNode changeScriptTaskScript(String id, String script) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeScriptTaskScript(id, script, infoNode);
        return infoNode;
      }
    
      public void changeScriptTaskScript(String id, String script, ObjectNode infoNode) {
        setElementProperty(id, SCRIPT_TASK_SCRIPT, script, infoNode);
      }
    
      public ObjectNode changeUserTaskName(String id, String name) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeUserTaskName(id, name, infoNode);
        return infoNode;
      }
    
      public void changeUserTaskName(String id, String name, ObjectNode infoNode) {
        setElementProperty(id, USER_TASK_NAME, name, infoNode);
      }
    
      public ObjectNode changeUserTaskDescription(String id, String description) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeUserTaskDescription(id, description, infoNode);
        return infoNode;
      }
    
      public void changeUserTaskDescription(String id, String description, ObjectNode infoNode) {
        setElementProperty(id, USER_TASK_DESCRIPTION, description, infoNode);
      }
    
      public ObjectNode changeUserTaskDueDate(String id, String dueDate) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeUserTaskDueDate(id, dueDate, infoNode);
        return infoNode;
      }
    
      public void changeUserTaskDueDate(String id, String dueDate, ObjectNode infoNode) {
        setElementProperty(id, USER_TASK_DUEDATE, dueDate, infoNode);
      }
    
      public ObjectNode changeUserTaskPriority(String id, String priority) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeUserTaskPriority(id, priority, infoNode);
        return infoNode;
      }
    
      public void changeUserTaskPriority(String id, String priority, ObjectNode infoNode) {
        setElementProperty(id, USER_TASK_PRIORITY, priority, infoNode);
      }
    
      public ObjectNode changeUserTaskCategory(String id, String category) {
        ObjectNode infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
        changeUserTaskCategory(id, category, infoNode);
        return infoNode;
      }
    
      public void changeUserTaskCategory(String id, String category, ObjectNode infoNode) {
        setElementProperty(id, USER_TASK_CATEGORY, category, infoNode);
      }
    
      public ObjectNode changeUserTaskFormKey(String id, String formKey) {
    
    
    • 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

    在这里插入图片描述

    在这里插入图片描述

    参考资料和推荐阅读

    [1].www.activity.org

    欢迎阅读,各位老铁,如果对你有帮助,点个赞加个关注呗!~

  • 相关阅读:
    XML文件和DOM简单操作
    HTML期末大作业:基于HTML+CSS+JavaScript新能源汽车资讯门户网站
    探秘 | 简说IP地址以及路由器的功能究竟是什么?
    【强化算法专题一】双指针算法
    HugeGraph1.0.0部署,吐槽一下Hubble的数据导入 Bug
    【LeetCode高频100题-2】冲冲冲
    【C++语法难点】 深拷贝和浅拷贝是什么,拷贝构造,拷贝赋值
    直播美颜技术的技术背后:美颜SDK的原理与实践
    基于Qt QProcess获取linux启动的程序、QScreen 截屏、GIF动画实现
    Java开发学习(六)----DI依赖注入之setter及构造器注入解析
  • 原文地址:https://blog.csdn.net/xiamaocheng/article/details/127956590