Activiti User Guide -- Activit 用户指南 Part02

Chapter 3. Configuration

第三章 配置

 

Table of Contents

Configuration properties

Supported databases

Changing the database

 

Activiti configuration files should be generated with the setup ant script that can be found in the setup folder. The cfg.create target can be easily configured in the setup/build.properties and the setup/build.${db}.properties. Our QA runs only the configurations that can be generated by the setup script. We also do not guarantee compatibility of the actual configuration files in future versions as you will always be able to regenerate it. So customizing the configuration files is not recommended.

Activiti配置文件由安装脚本产生,你可以在setup目录下找到该文件。cfg.create target可以很容易的通过setup/build.propertiessetup/build.${db}.properties文件产生该配置文件。我们的QA也仅是运行由安装脚本产生的配置文件。我们也不保证后续版本中该配置文件的一致性,因此你将会重新生成该配置文件。所以我们不推荐你对该配置文件进行修改。

Configuration properties

配置属性

Here are the configuration properties that you can specify in the activiti.properties. This is only applicable if you're using theProcessEngineBuilder directly or indirectly through ProcessEngines. This is not applicable if you're using the Spring style of building a process engine.

下面列出了你可以在activiti.properties中进行配置的配置属性。这些属性适合于直接使用ProcessEngineBuilder 或者间接通过 ProcessEngines来使用ProcessEngineBuilder 。当你使用Spring来构造流程引擎是则不适用。

 

  • process.engine.name: The process engine name. Only relevant if you're using multiple process engines in one classloading scope.
  • process.engine.name: 流程引擎的名称。只有当你在一个类装载器范围内使用多个流程引擎时使用。
  • database: one of the database names specified in Table 3.1, “Supported databases”
  • database:用来指定数据库的名称,具体可以参考表格3.1列出的可被支持的数据库名称
  • jdbc.driver, jdbc.url, jdbc.username and jdbc.password: JDBC properties pointing to the database Activiti will use.
  • jdbc.driver, jdbc.url, jdbc.username  jdbc.password: Activiti所使用数据库的JDBC属性。
  • db.schema.strategy: { check-version | create-drop } check-version is the default and it will check if the DB version is the same as the library version when the process engine is created. create-drop is handy for testing. It creates the DB schema when the process engine is created and drops the schema when the engine is closed.
  • db.schema.strategy: { check-version | create-drop } 缺省值为check-version,当流程引擎创建时检查数据库的版本号是否与包的版本号一致。 create-drop 则方便进行测试。它则是在流程引擎启动时创建数据库并在引擎关闭时将数据库删除掉。
  • job.executor.auto.activate: { enabled | disabled } enabled is the default which means that the JobExecutor component will start when the process engine is created. In testing, it's best to set this property to disabled. Then the job executor won't be activated and the test can manually search for jobs with ManagementService.createJobQuery and execute them withManagementService.executeJob.
  • job.executor.auto.activate: { enabled | disabled }缺省值为 enabled ,当流程引擎创建是则启动JobExecutor组件。当在进行测试时,最好将该值设置为disabled。此时任务调度器不会被激活,测试则可以通过ManagementService.createJobQuery 获取所要执行的任务,并通过调用ManagementService.executeJob执行。
  • mail.smtp.host, mail.smtp.port, mail.smtp.user, mail.smtp.password and mail.default.from: SMTP properties used when Activiti needs to send email.
  • mail.smtp.host, mail.smtp.port, mail.smtp.user, mail.smtp.password  mail.default.from: SMTP属性,用来支持Activiti发送邮件。

Supported databases

支持的数据库

Following are the names (case sensitive!) that Activiti uses to refer to databases.

下面列出的名称(大小写敏感)可以用来配置Activiti的数据库。

Table 3.1. Supported databases

Activiti database name

Versions tested

Notes

h2

1.2.132

 

mysql

5.1.11

 

oracle

 

not yet supported (coming soon)

postgresql

 

not yet supported (coming soon)

db2

 

not yet supported (coming soon)

 

Changing the database

更换数据库

One of the things you probably want to do fairly soon, is configuring Activiti to use a different database. To generate a configuration file that can be used to configure the engine, following steps need to be done:

接下来你可能想做的就是为Activiti使用一个不同的数据库。为此,你需要执行以下步骤来产生一个新的配置文件:

 

  • Edit setup/build.properties and change the db parameter to your type of database (e.g. mysql).
  • 编辑 setup/build.properties 文件,并将db参数修改为你所需要的数据库(如:mysql
  • Edit setup/build.${db}.properties and change the JDBC connection parameters to those of your database installation.
  • 编辑 setup/build.${db}.properties 文件,并修改为你所配置数据库的JDBC连接参数
  • Run 'ant cfg.create' from within the setup folder.
  • setup文件中运行 'ant cfg.create'
  • The generate configuration file can now be found in setup/build/activiti-cfg. Also, for convenience, a jar called activiti-cfg.jarcontaining the configuration file can be found in setup/build
  • 此时在setup/build/activiti-cfg目录中就可以找到新产生的配置文件。同时,为了方便在setup/build目录中会生成一个包含配置文件并且名称为activiti-cfg.jar jar文件。

你可能感兴趣的:(spring,oracle,mysql,jdbc,ant)