Activiti Workflow Core-----Processengine 3 Creation method

Source: Internet
Author: User

Package Com.tabchanj.activiti;import Org.activiti.engine.processengine;import Org.activiti.engine.processengineconfiguration;import Org.activiti.engine.processengines;import org.junit.Test; Public classEnvtest {/** * Create Processengine Mode 1: Use configuration objects directly, set database connection information, and automatically build and build tables * * @throws Exception*/@Test Public voidtestname () throws Exception {processengineconfiguration config=processengineconfiguration.createstandaloneprocessengineconfiguration (); Config.setjdbcdriver ("Com.mysql.jdbc.Driver"); Config.setjdbcurl ("jdbc:mysql://localhost:3306/activiti?createdatabaseifnotexist=true"); Config.setjdbcusername ("Root"); Config.setjdbcpassword ("4230");        Config.setdatabaseschemaupdate (processengineconfiguration.db_schema_update_true); Processengine engine=Config.buildprocessengine (); System. out. println (engine); System. out. println (engine); }    /** * Method 2: Create processengine with configuration file * * @throws Exception*/@Test Public voidTestxml () throws Exception {processengineconfiguration config=processengineconfiguration. Createprocessengineconfigurationfromresource ("Activiti.cfg.xml"); Processengine engine=Config.buildprocessengine (); System. out. println (engine); }    /** * Mode 3: The default way, you need to ensure that the configuration file name is activiti.cfg.xml * * @throws Exception*/@Test Public voidTestdefault () throws Exception {Processengine engine=Processengines.getdefaultprocessengine (); System. out. println (engine); }}

Activiti Workflow Core-----Processengine 3 Creation method

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.