今天看到公司有一个项目,是关于activity工作流的,第一次接触,记录一下,方便巩固和之后的查询。

 

1.配置maven环境

2.运行测试代码

3.代码实现activity工作流

 

1.配置maven环境

  activity是一个比较简单容易上手的工作流,主要操作分为一下步骤

  • 利用activity插件画出需要的逻辑流程图
  • 部署流程
  • 启动流程
  • 迭代处理流程
  • 流程结束

(1)安装所需的画图插件(有在线安装和离线安装,建议是离线安装)

  离线通过安装包来安装

    下载链接:https://pan.baidu.com/s/1jZgTImyDFsQ62ttt5CyQKg,提取码:abw0

    解压后,将 对应的plugins中j所有ar包(我的解压路径是:D:\activityWorkFlow\ActivitiDesigner\plugins)复制到maven工具的安装目录(maven  实现activity工作流的简单例子(以报销为例  附代码))下,然后删除configuration文件下的org.eclipse.update整个文件(不删掉的话,会报错的)

maven  实现activity工作流的简单例子(以报销为例  附代码)

 

 

 

  然后在 maven工具中选择help - install new software

maven  实现activity工作流的简单例子(以报销为例  附代码)

 

 

点击进来后,选择  add - local… 选择画图插件解压后的位置,如下图:

 

maven  实现activity工作流的简单例子(以报销为例  附代码)

 

验证是否安装成功,在maven工具中,点击 file - new - other...中 搜索activiti 如果出现  activiti diagram  和activiti project 两个文件 ,说明已经安装成功了。

maven  实现activity工作流的简单例子(以报销为例  附代码)

 

 

 

    

2.运行测试代码

 

1.在maven工具中,新建一个maven工程

 

 

maven  实现activity工作流的简单例子(以报销为例  附代码)

 

 

2.在pom.xml配置文件中导入需要依赖的jar包,以mysql数据库为例

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>mavenPro</groupId>
  <artifactId>activityWordFlow</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>
  
  <name>activityWordFlow</name>
  <url>http://maven.apache.org</url>
  <properties>  
    </properties>
  
   <dependencies> 
    <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-engine</artifactId>
    <version>6.0.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.activiti/activiti-spring -->
    <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-spring</artifactId>
    <version>6.0.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all -->
    <dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.5.7</version>
    <type>pom</type>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.25</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14 -->
    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-jdk14</artifactId>
    <version>1.7.25</version>
    <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
    <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.17</version>
    </dependency>
  </dependencies> 
  
</project>
pom.xml

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2021-07-08
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2022-03-01
  • 2022-01-07
  • 2021-11-23
相关资源
相似解决方案