Configuring the Activiti Process Engine

We can configure the Activiti Process Engine using an XML file known as activiti.cfg.xml. We have to configure a bean in activiti.cfg.xml for the Process Engine's configuration.

We have to define the following bean as follows:

<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">

This bean is used to generate the Process Engine. Different types of classes are available to configure the Process Engine. We can choose which class to use depending on the environment. Choose the appropriate class for your environment so that the number of properties used for configuring the engine can be minimized.

We can use the following classes:

  • org.activiti.spring.SpringProcessEngineConfiguration: This can be used when we have configured the Process Engine in Spring.
  • org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration: This is the appropriate class for unit testing. The H2 in-memory database is used by default. A database will be automatically created when the engine starts and dropped when it shuts down. We don't have to put extra effort into the configuration.
  • org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration: This is used with the Jta transaction when the engine runs in the standalone mode.
  • org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration: The Process Engine is used in a standalone way. Transactions will be conducted by Activiti itself. By default, the database will only be checked when the engine boots.

We can point the Activiti Engine to the production database using the Spring environment. Let's see how we can configure the production database.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset