Creating an Processengineconfiguration instance

Source: Internet
Author: User

The Processengineconfiguration object represents the full configuration of the Activiti process engine, Processengineconfiguration provides a static method parsing configuration file, Returns a Processengineconfiguration instance.

    1. By default, the Activiti.cfg.xml file is read from classpath and a bean instance named Processengineconfiguration is started.
      processengineconfiguration config = Processengineconfiguration.createprocessengineconfigurationfromresourcedefault ()
    2. CLASSPATH read the specified configuration file or customize the Processengineconfiguration bean name
  //  To specify a configuration file to create an Processengineconfiguration instance processengineconfiguration config = Processengineconfiguration.createprocessengineconfigurationfromresource ("  My-activiti.xml ");  // specify config file to create bean name called Myconfig processengineconfiguration processengineconfiguration config = Processengineconfiguration.createprocessengineconfigurationfromresource ("My-activiti.xml", "myconfig");

3. Create based on profile input stream

        New File ("Resource/input-stream.xml");         // get file input stream        New fileinputstream (file);         // Create a processengineconfiguration        based on a configuration file stream processengineconfiguration config = Processengineconfiguration.createprocessengineconfigurationfrominputstream ( FIS);

4. Not created from the configuration file, create in code

Standaloneinmemprocessengineconfiguration is a subclass of Standaloneprocessengineconfiguration, Standaloneinmemprocessengineconfiguration Special Designation

Databaseschemaupdate (Create-drop) and Jdbcurl (Jdbc:h2:mem:activiti).

 // processengineconfiguration config = Pro        Cessengineconfiguration.createstandaloneinmemprocessengineconfiguration ();  processengineconfiguration config =        Processengineconfiguration.createstandaloneprocessengineconfiguration ();  //   System.out.println (Config.getdatabaseschemaupdate ());  //  // localhost/activiti          System.out.println (Config.getjdbcurl ());  //  Use custom configuration  config.setjdbcurl (" Jdbcurl "); 

You can configure standaloneinmemprocessengineconfiguration as the Bean's class to use, but be aware that the default value of the property is not required by the business.

Creating an Processengineconfiguration instance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.