1.activiti部署

weixin_33850890發表於2018-08-14

1.資料來源配置

    <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://192.168.3.6:3306/activiti?useUnicode=true&amp;characterEncoding=utf8"></property>
        <property name="jdbcUsername" value="root"></property>
        <property name="jdbcPassword" value="123456"></property>
        <!-- 沒有表建立表 -->
        <property name="databaseSchemaUpdate" value="true"></property>

2.資料庫初始化

    /**
     * 使用配置檔案建立工作流需要的23張表
     */
    @Test
    public void createTable_2() {
//      ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
//      //工作流的核心物件,ProcessEnginee物件
//      ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

        ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml")    //
                .buildProcessEngine();
        System.out.println("processEngine:" + processEngine);
    }
  1. 支援的資料庫有:h2, mysql, oracle, postgres, mssql, db2等。
    23張表
Activiti的後臺是有資料庫的支援,所有的表都以ACT_開頭。 第二部分是表示表的用途的兩個字母標識。 用途也和服務的API對應。
ACT_RE_*: 'RE'表示repository。 這個字首的表包含了流程定義和流程靜態資源 (圖片,規則,等等)。
ACT_RU_*: 'RU'表示runtime。 這些執行時的表,包含流程例項,任務,變數,非同步任務,等執行中的資料。 Activiti只在流程例項執行過程中儲存這些資料, 在流程結束時就會刪除這些記錄。 這樣執行時表可以一直很小速度很快。
ACT_ID_*: 'ID'表示identity。 這些表包含身份資訊,比如使用者,組等等。
ACT_HI_*: 'HI'表示history。 這些表包含歷史資料,比如歷史流程例項, 變數,任務等等。
ACT_GE_*: 通用資料, 用於不同場景下,如存放資原始檔。

2 資料庫表

2.1:資源庫流程規則表
1)  act_re_deployment   部署資訊表
2)  act_re_model        流程設計模型部署表
3)  act_re_procdef          流程定義資料表
2.2:執行時資料庫表
1)  act_ru_execution        執行時流程執行例項表
2)  act_ru_identitylink     執行時流程人員表,主要儲存任務節點與參與者的相關資訊
3)  act_ru_task         執行時任務節點表
4)  act_ru_variable     執行時流程變數資料表
2.3:歷史資料庫表
1)  act_hi_actinst      歷史節點表
2)  act_hi_attachment       歷史附件表
3)  act_hi_comment      歷史意見表
4)  act_hi_identitylink     歷史流程人員表
5)  act_hi_detail           歷史詳情表,提供歷史變數的查詢
6)  act_hi_procinst     歷史流程例項表
7)  act_hi_taskinst     歷史任務例項表
8)  act_hi_varinst          歷史變數表
2.4:組織機構表
1)  act_id_group        使用者組資訊表
2)  act_id_info         使用者擴充套件資訊表
3)  act_id_membership   使用者與使用者組對應資訊表
4)  act_id_user         使用者資訊表
這四張表很常見,基本的組織機構管理,關於使用者認證方面建議還是自己開發一套,元件自帶的功能太簡單,使用中有很多需求難以滿足 
2.5:通用資料表
1)  act_ge_bytearray        二進位制資料表
2)  act_ge_property         屬性資料表儲存整個流程引擎級別的資料,初始化表結構時,會預設插入三條記錄,

3 安裝bpmn外掛

相關文章