Create ProcessEngineConfiguration instance and oracle instance
The ProcessEngineConfiguration object represents all the configurations of the activiti process engine. ProcessEngineConfiguration provides a static method for parsing the configuration file and returns the ProcessEngineConfiguration instance.
// Specify the configuration file to create the ProcessEngineConfiguration instance ProcessEngineConfiguration config = ProcessEngineConfiguration. createProcessEngineConfigurationFromResource ("my-activiti.xml"); // specify the ProcessEngineConfiguration config = ProcessEngineConfiguration of myconfig as the bean created in the configuration file. createProcessEngineConfigurationFromResource ("my-activiti.xml", "myconfig ");
3. Create a file based on the input stream of the configuration file
File file = new File ("resource/input-stream.xml"); // get the file input stream InputStream FS = new FileInputStream (File); // create ProcessEngineConfiguration config = ProcessEngineConfiguration Based on the configuration file stream. createProcessEngineConfigurationFromInputStream (FCM );
4. Do not create from the configuration file, create in code
StandaloneInMemProcessEngineConfiguration is a subclass of StandaloneProcessEngineConfiguration, which is specially specified by StandaloneInMemProcessEngineConfiguration.
DatabaseSchemaUpdate (create-drop) and JdbcUrl (jdbc: h2: mem: activiti ).
// ProcessEngineConfiguration config = ProcessEngineConfiguration. createStandaloneInMemProcessEngineConfiguration (); ProcessEngineConfiguration config = ProcessEngineConfiguration. createStandaloneProcessEngineConfiguration (); // The default value is false System. out. println (config. getDatabaseSchemaUpdate (); // The default value is jdbc: h2: tcp: // localhost/activiti System. out. println (config. getJdbcUrl (); // use custom config. setJdbcUrl ("jdbcUrl ");
StandaloneInMemProcessEngineConfiguration can be configured as the bean class, but note that the default attribute value is not required by the business.