jbpm设计活动之state

作用:等待.即流程走到这里的时候,不需要执行任何的任务,只需要停在这里,直到发出执行下一流程的指令,遍可以进行到下一流程


一、流程图

  jbpm设计活动之state_第1张图片

二、代码实现

      这里只需要编写流程处理的代码测试类就行,代码如下:

   

package com.njupt.state;

import java.io.InputStream;

import org.jbpm.api.Configuration;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.ProcessInstance;
import org.junit.Test;

public class ProcessTest {

	private ProcessEngine processEngine = Configuration.getProcessEngine();

	@Test
	public void test() throws Exception {
		// 1,部署流程定义
		InputStream in = getClass().getResourceAsStream("test.jpdl.xml");
		processEngine.getRepositoryService()//
				.createDeployment()//
				.addResourceFromInputStream("test.jpdl.xml", in)//
				.deploy();

		// 2,启动流程实例
		ProcessInstance pi = processEngine.getExecutionService().startProcessInstanceByKey("test");
	}

	@Test
	public void testSignal() throws Exception {
		String executionId = "test.210007";
		processEngine.getExecutionService().signalExecutionById(executionId);
	}
}

三、同样可以从_execution即_hist_task这两张表中查看流程相应的信息

你可能感兴趣的:(jbpm,state,设计流程)