Jbpm process release and process instance Management

Source: Internet
Author: User
Tags jbpm
> 1. Process deployment 1. Process Engine Retrieval
ProcessEngine processEngine = new Configuration().setResource("my-own-configuration-file.xml").buildProcessEngine();

In actual development, we generally obtain the data through the spring configuration file through relevant methods.

2. obtain the corresponding WebService according to the process engine.
RepositoryService repositoryService = processEngine.getRepositoryService();ExecutionService executionService = processEngine.getExecutionService();TaskService taskService = processEngine.getTaskService();HistoryService historyService = processEngine.getHistoryService();ManagementService managementService = processEngine.getManagementService();
3. deployment process

The repositoryservice contains all the methods used to manage published resources. In the first example, we will use

Repositoryservice deploys a process resource from classpath.

String deploymentid = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/examples/services/Order.jpdl.xml").deploy();


2. Process instance Management 1. Start a process instance

The following is the simplest and most common method to start a new process instance for the process definition:

ProcessInstance processInstance = executionService.startProcessInstanceByKey("ICL");

The above service method will find the process definition of the latest version whose key is ICL, and then start it in the latest process definition.

Process instance.

When a new version is deployed in the insurance claim process, the startprocessinstancebykey method automatically switches to

The new deployment version.


2. delete an instance
executionService.deleteProcessInstanceCascade(processInstance.getId());


3. termination process
 executionService.endProcessInstance(processInstance.getId(), "cancle");


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.