activiti-spring-app-process 源码分析

activiti-spring-app-process

  • 目录
    • 概述
      • 需求:
    • 设计思路
    • 实现思路分析
      • 1.ApplicationProcessAutoConfiguration
      • 2.网页下载器
      • 3.spi
      • 4.spi
    • 性能参数测试:
  • 参考资料和推荐阅读

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.

目录

在这里插入图片描述

概述

需求:

设计思路

实现思路分析

1.ApplicationProcessAutoConfiguration

@Configuration
public class ApplicationProcessAutoConfiguration {

    @Bean
    public ApplicationEntryDiscovery processEntryDiscovery() {
        return new ProcessEntryDiscovery();
    }

    @Bean
    public ApplicationEntryDeployer processEntryDeployer(RepositoryService repositoryService) {
        return new ProcessEntryDeployer(repositoryService);
    }
}

2.网页下载器

public class ProcessEntryDeployer implements ApplicationEntryDeployer {

    private RepositoryService repositoryService;

    public ProcessEntryDeployer(RepositoryService repositoryService) {
        this.repositoryService = repositoryService;
    }

    @Override
    public void deployEntries(ApplicationContent application) {
        List<FileContent> processContents = application.getFileContents(ProcessEntryDiscovery.PROCESSES);
        DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name("ApplicationAutoDeployment");
        for (FileContent processContent : processContents) {
            deploymentBuilder.addBytes(processContent.getName(), processContent.getContent());
        }
        deploymentBuilder.deploy();
    }
}

3.spi

public class ProcessEntryDiscovery implements ApplicationEntryDiscovery {

    public static final String PROCESSES = "processes";

    @Override
    public Predicate<ZipEntry> filter(ZipEntry entry) {
        return zipEntry -> !zipEntry.isDirectory() && zipEntry.getName().contains(PROCESSES);
    }

    @Override
    public String getEntryType() {
        return PROCESSES;
    }

}

4.spi

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
    org.activiti.application.conf.ApplicationProcessAutoConfiguration

性能参数测试:

参考资料和推荐阅读

暂无

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

你可能感兴趣的:(【工作流】,spring,java,后端)