ActivitiListener

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.

目录

在这里插入图片描述

概述

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

需求:

设计思路

实现思路分析

1.ActivitiListener

protected String event;
  protected String implementationType;
  protected String implementation;
  protected List<FieldExtension> fieldExtensions = new ArrayList<FieldExtension>();
  protected String onTransaction;
  protected String customPropertiesResolverImplementationType;
  protected String customPropertiesResolverImplementation;

2.Activity

在这里插入图片描述

public abstract class Activity extends FlowNode {

  protected String defaultFlow;
  protected boolean forCompensation;
  protected MultiInstanceLoopCharacteristics loopCharacteristics;
  protected IOSpecification ioSpecification;
  protected List<DataAssociation> dataInputAssociations = new ArrayList<DataAssociation>();
  protected List<DataAssociation> dataOutputAssociations = new ArrayList<DataAssociation>();
  protected List<BoundaryEvent> boundaryEvents = new ArrayList<BoundaryEvent>();
  protected String failedJobRetryTimeCycleValue;
  protected List<MapExceptionEntry> mapExceptions = new ArrayList<MapExceptionEntry>();

  public String getFailedJobRetryTimeCycleValue() {
    return failedJobRetryTimeCycleValue;
  }

  public void setFailedJobRetryTimeCycleValue(String failedJobRetryTimeCycleValue) {
    this.failedJobRetryTimeCycleValue = failedJobRetryTimeCycleValue;
  }

3.Gateway


public class ExclusiveGateway extends Gateway {

  public ExclusiveGateway clone() {
    ExclusiveGateway clone = new ExclusiveGateway();
    clone.setValues(this);
    return clone;
  }

  public void setValues(ExclusiveGateway otherElement) {
    super.setValues(otherElement);
  }
}

5.FieldExtension

ublic class FieldExtension extends BaseElement {

  protected String fieldName;
  protected String stringValue;
  protected String expression;

  public FieldExtension() {

  }

  public String getFieldName() {
    return fieldName;
  }

  public void setFieldName(String fieldName) {
    this.fieldName = fieldName;
  }

  public String getStringValue() {
    return stringValue;
  }

  public void setStringValue(String stringValue) {
    this.stringValue = stringValue;
  }

  public String getExpression() {
    return expression;
  }

  public void setExpression(String expression) {
    this.expression = expression;
  }

  public FieldExtension clone() {
    FieldExtension clone = new FieldExtension();
    clone.setValues(this);
    return clone;
  }

  public void setValues(FieldExtension otherExtension) {
    setFieldName(otherExtension.getFieldName());
    setStringValue(otherExtension.getStringValue());
    setExpression(otherExtension.getExpression());
  }
}

IOSpecification

在这里插入图片描述

public class IOSpecification extends BaseElement {

  protected List<DataSpec> dataInputs = new ArrayList<DataSpec>();
  protected List<DataSpec> dataOutputs = new ArrayList<DataSpec>();
  protected List<String> dataInputRefs = new ArrayList<String>();
  protected List<String> dataOutputRefs = new ArrayList<String>();

  public List<DataSpec> getDataInputs() {
    return dataInputs;
  }

  public void setDataInputs(List<DataSpec> dataInputs) {
    this.dataInputs = dataInputs;
  }

  public List<DataSpec> getDataOutputs() {
    return dataOutputs;
  }

  public void setDataOutputs(List<DataSpec> dataOutputs) {
    this.dataOutputs = dataOutputs;
  }

  public List<String> getDataInputRefs() {
    return dataInputRefs;
  }

  public void setDataInputRefs(List<String> dataInputRefs) {
    this.dataInputRefs = dataInputRefs;
  }

  public List<String> getDataOutputRefs() {
    return dataOutputRefs;
  }

  public void setDataOutputRefs(List<String> dataOutputRefs) {
    this.dataOutputRefs = dataOutputRefs;
  }

  public IOSpecification clone() {
    IOSpecification clone = new IOSpecification();
    clone.setValues(this);
    return clone;
  }

  public void setValues(IOSpecification otherSpec) {
    dataInputs = new ArrayList<DataSpec>();
    if (otherSpec.getDataInputs() != null && !otherSpec.getDataInputs().isEmpty()) {
      for (DataSpec dataSpec : otherSpec.getDataInputs()) {
        dataInputs.add(dataSpec.clone());
      }
    }

    dataOutputs = new ArrayList<DataSpec>();
    if (otherSpec.getDataOutputs() != null && !otherSpec.getDataOutputs().isEmpty()) {
      for (DataSpec dataSpec : otherSpec.getDataOutputs()) {
        dataOutputs.add(dataSpec.clone());
      }
    }

    dataInputRefs = new ArrayList<String>(otherSpec.getDataInputRefs());
    dataOutputRefs = new ArrayList<String>(otherSpec.getDataOutputRefs());
  }
}

参考资料和推荐阅读

[1].www.activaty.org

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

package com.iuit.ci.listen; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.iuit.ci.common.util.*; import com.iuit.ci.mapper.DicValueDao; import com.iuit.ci.mapper.ProductLineNodeMapper; import com.iuit.ci.mapper.TTaskMapper; import com.iuit.ci.pojo.po.MinioFile; import com.iuit.ci.pojo.po.ProductLineNode; import com.iuit.ci.pojo.po.TTask; import com.iuit.ci.pojo.resp.MinioFileResp; import com.iuit.ci.pojo.resp.tools.ACodeVoResp; import com.iuit.ci.service.MinioFileService; import com.iuit.ci.service.SshService; import com.iuit.exception.BusinessException; import com.iuit.holder.RequestHolder; import com.iuit.pojo.dto.RequestInfo; import com.iuit.result.Result; import com.iuit.result.StatusCode; import com.iuit.util.JsonUtils; import lombok.extern.slf4j.Slf4j; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.delegate.DelegateTask; import org.activiti.engine.delegate.TaskListener; import org.activiti.engine.task.Comment; import org.apache.commons.lang.StringUtils; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @Component @Slf4j public class CustomTaskListener implements TaskListener { private TTaskMapper taskMapper; private ProductLineNodeMapper productLineNodeMapper; private MinioFileService minioFileService; private TaskService taskService; private SshService testbedService; private RuntimeService runtimeService; private DicValueDao dicValueDao; pu
最新发布
03-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

迅捷的软件产品制作专家

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值