package org.activiti.designer.test;
import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Map;
import java.io.FileInputStream;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.test.ActivitiRule;
import org.junit.Rule;
import org.junit.Test;
public class ProcessTestInclusiveGatewayDefalutWay {
private String filename = "/Users/henryyan/work/projects/activiti/activiti-study/src/test/resources/diagrams/InclusiveGatewayDefalutWay.bpmn";
@Rule
public ActivitiRule activitiRule = new ActivitiRule();
@Test
public void startProcess() throws Exception {
RepositoryService repositoryService = activitiRule.getRepositoryService();
repositoryService.createDeployment()
.addInputStream("InclusiveGatewayDefalutWay.bpmn20.xml", new FileInputStream(filename)).deploy();
RuntimeService runtimeService = activitiRule.getRuntimeService();
Map<String, Object> variableMap = new HashMap<String, Object>();
variableMap.put("way", "no");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("InclusiveGatewayDefalutWay", variableMap);
assertNotNull(processInstance.getId());
System.out.println("id " + processInstance.getId() + " " + processInstance.getProcessDefinitionId());
}
}