package de.nilspreusker; import org.jbpm.api.ProcessInstance; import org.jbpm.test.JbpmTestCase; public class CancelTest extends JbpmTestCase { String deploymentId; protected void setUp() throws Exception { super.setUp(); deploymentId = repositoryService.createDeployment().addResourceFromClasspath("de/nilspreusker/cancel-job.jpdl.xml").deploy(); } protected void tearDown() throws Exception { repositoryService.deleteDeploymentCascade(deploymentId); super.tearDown(); } public void testJavaInstantiate() { ProcessInstance processInstance = executionService.startProcessInstanceByKey("cancel_job"); String pid = processInstance.getId(); assertTrue(processInstance.isActive("wait state")); assertTrue(processInstance.getState().equals(ProcessInstance.STATE_INACTIVE_SCOPE)); // This throws: "org.jbpm.api.JbpmException: execution[cancel_job.7] is not active: inactive-scope" executionService.signalExecutionById(processInstance.getId(), "another wait state"); } }