• 大小: 291KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-07
  • 语言: 其他
  • 标签: activiti  springboot  

资源简介

springboot2和activity7的集成。包括代码和pom文件。有问题留言

资源截图

代码片段和文件信息

package org.activiti.examples;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Random;

import org.activiti.api.model.shared.model.VariableInstance;
import org.activiti.api.process.model.ProcessDefinition;
import org.activiti.api.process.model.ProcessInstance;
import org.activiti.api.process.model.builders.ProcessPayloadBuilder;
import org.activiti.api.process.runtime.ProcessRuntime;
import org.activiti.api.process.runtime.connector.Connector;
import org.activiti.api.runtime.shared.query.Page;
import org.activiti.api.runtime.shared.query.Pageable;
import org.activiti.api.task.model.Task;
import org.activiti.api.task.model.builders.TaskPayloadBuilder;
import org.activiti.api.task.runtime.TaskRuntime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@SpringBootApplication
@EnableScheduling
public class DemoApplication implements CommandLineRunner {

    private Logger logger = LoggerFactory.getLogger(DemoApplication.class);

    private final ProcessRuntime processRuntime;

    private final TaskRuntime taskRuntime;

    private final SecurityUtil securityUtil;

    public DemoApplication(ProcessRuntime processRuntime
                           TaskRuntime taskRuntime
                           SecurityUtil securityUtil) {
        this.processRuntime = processRuntime;
        this.taskRuntime = taskRuntime;
        this.securityUtil = securityUtil;
    }

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class args);

    }

    @Override
    public void run(String... args) {
        securityUtil.logInAs(“system“);

        Page processDefinitionPage = processRuntime.processDefinitions(Pageable.of(0 10));
        logger.info(“> Available Process definitions: “ + processDefinitionPage.getTotalItems());
        for (ProcessDefinition pd : processDefinitionPage.getContent()) {
            logger.info(“\t > Process definition: “ + pd);
        }

    }

    @Scheduled(initialDelay = 1000 fixedDelay = 5000)
    public void processText() {

        securityUtil.logInAs(“system“);

        String content = pickRandomString();

        SimpleDateFormat formatter = new SimpleDateFormat(“dd-MM-yy HH:mm:ss“);

        logger.info(“> Starting process to process content: “ + content + “ at “ + formatter.format(new Date()));

        ProcessInstance processInstance = processRuntime.start(ProcessPayloadBuilder
                .start()
                .withProcessDefinitionKey(“categorizeHumanProcess“)
                .withProcessInstanceName(“Processing Content: “ + content)
                .withV

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\
     文件         158  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\.gitignore
     文件         676  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\.travis.yml
     文件        3214  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\CODE_OF_CONDUCT.md
     文件        1044  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\CONTRIBUTING.md
     文件       11357  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\LICENSE
     文件         601  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\README.md
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\
     文件         268  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\.gitignore
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\.mvn\
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\.mvn\wrapper\
     文件       47610  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\.mvn\wrapper\maven-wrapper.jar
     文件         110  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\.mvn\wrapper\maven-wrapper.properties
     文件        6468  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\mvnw
     文件        4994  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\mvnw.cmd
     文件        2549  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\pom.xml
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\java\
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\java\org\
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\java\org\activiti\
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\java\org\activiti\examples\
     文件        6013  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\java\org\activiti\examples\DemoApplication.java
     文件        2231  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\java\org\activiti\examples\DemoApplicationConfiguration.java
     文件        2202  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\java\org\activiti\examples\SecurityUtil.java
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\resources\
     文件           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\resources\application.properties
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\resources\processes\
     文件        6044  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\main\resources\processes\categorize-human-content.bpmn20.xml
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\test\
     目录           0  2018-10-25 17:32  activiti-examples-7.0.0.Beta2\activiti-api-basic-full-example\src\test\java\
............此处省略116个文件信息

评论

共有 条评论