最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Activiti開發(fā)環(huán)境的搭建過(guò)程詳解

 更新時(shí)間:2020年03月09日 09:30:01   投稿:yaominghui  
這篇文章主要介紹了Activiti開發(fā)環(huán)境的搭建過(guò)程詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

本文中使用maven+eclipse搭建activiti-5.14的開發(fā)環(huán)境

一、創(chuàng)建maven工程

創(chuàng)建一個(gè)普通的java工程,pom文件的內(nèi)容如下

<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>com.lyy</groupId>
  <artifactId>activtiviti-study-01</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <dependencies>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-engine</artifactId>
      <version>5.14</version>
    </dependency>

    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.26</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
    </dependency>

    <dependency>
      <groupId>c3p0</groupId>
      <artifactId>c3p0</artifactId>
      <version>0.9.1.2</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>

二、添加activiti的配置文件

在工程的resources目錄下創(chuàng)建activiti的配置文件,名稱為activiti.cfg.xml

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

  <!-- 配置使用默認(rèn)bean名稱的流程引擎配置對(duì)象 -->
  <bean id="processEngineConfiguration"
    class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
    <property name="jdbcDriver" value="com.mysql.jdbc.Driver"></property>
    <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti_01"></property>
    <property name="jdbcUsername" value="root"></property>
    <property name="jdbcPassword" value="root"></property>
    <property name="databaseSchemaUpdate" value="true"></property>
  </bean>

</beans>

三、測(cè)試

新建一個(gè)測(cè)試類,添加如下代碼,

public class Test1 {
  /**
   * 測(cè)試環(huán)境是否可用
   */
  @Test
  public void test1() {
  ProcessEngineConfiguration configuration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
  System.out.println(configuration);
  }

}

運(yùn)行測(cè)試方法test1,如果正常執(zhí)行,并輸出ProcessEngineConfiguration對(duì)象的地址,則表示開發(fā)環(huán)境搭建成功。

四、總結(jié)

用maven搭建activiti的開發(fā)環(huán)境,需要先引入activiti的依賴

<dependency>
  <groupId>org.activiti</groupId>
  <artifactId>activiti-engine</artifactId>
  <version>5.14</version>
</dependency>

因?yàn)橐僮鲾?shù)據(jù)庫(kù),所以需要引入msql的驅(qū)動(dòng)和數(shù)據(jù)庫(kù)連接池

<dependency>
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <version>5.1.26</version>
</dependency>
<dependency>
  <groupId>c3p0</groupId>
  <artifactId>c3p0</artifactId>
  <version>0.9.1.2</version>
  <type>jar</type>
  <scope>compile</scope>
</dependency>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

静乐县| 静乐县| 大田县| 文安县| 聊城市| 杭锦旗| 开化县| 长宁县| 龙岩市| 葫芦岛市| 沧州市| 兴义市| 万州区| 滁州市| 昌都县| 南雄市| 黎城县| 武汉市| 佛山市| 阳谷县| 渝中区| 敦化市| 怀远县| 江山市| 金沙县| 汶上县| 获嘉县| 湘西| 崇仁县| 余干县| 出国| 汤阴县| 临邑县| 大石桥市| 瑞安市| 峨山| 马龙县| 辽宁省| 西和县| 陕西省| 建湖县|