deploy jbpm to database

here is just the simplest way:

1. download and install jbpm(please google it if you wanna know);

2. use eclipse to create flow names myworkflow;

3. copy jbpm.cfg.xml, jbpm.mail.properties,  jbpm.hibernate.cfg.xml which are under myworkflow src folder to my project myproj src folder. (the myproj project is in MyEclipse IDE);

attention:  if myproj has it’s own DataSource definition file(eg: applicationContext.xml has connection setting), the  jbpm.hibernate.cfg.xml need not to copy.

4. copy your design wf.jpdl.xml and wf.png to myproj(in this example:  src/com.company/jbpm/).

5.  create a java class in a suitable place:

import java.io.File;

import org.jbpm.api.Configuration;

import org.jbpm.api.ProcessEngine;

import org.jbpm.api.RepositoryService;

public class Test {

public void deploy() {

ProcessEngine processEngine = new Configuration().buildProcessEngine();

RepositoryService repositoryService = processEngine.getRepositoryService();

String deployid = repositoryService.createDeployment()

.addResourceFromClasspath(“com/company/jbpm/wf.jpdl.xml”).deploy();

System.out.println(“generated deploymentId: ” + deployid);

}

public static void main(String[] args) {

System.out.println(“********** deploy ******************”);

try {

Test test = new Test();

test.deploy();

} catch (Exception e) {

// TODO: handle exception

e.printStackTrace();

}

}

}

6. Run the class as Java Application.

if there’s no error, it’s done!

This entry was posted in Computer, Java. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s