04-02-2014 08:03 AM
04-16-2014 02:09 AM
// start process instance
ProcessInstance pi = runtimeService.startProcessInstanceByKey("receiveTask");
// check that receive task has been reached
Execution execution = runtimeService.createExecutionQuery()
.processInstanceId(pi.getId())
.activityId("waitState1")
.singleResult();
assertNotNull(execution);
// deploy new version of the process definition
org.activiti.engine.repository.Deployment deployment = repositoryService
.createDeployment()
.addClasspathResource(TEST_PROCESS)
.deploy();
assertEquals(2, repositoryService.createProcessDefinitionQuery().count());
// migrate process instance to new process definition version
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
commandExecutor.execute(new SetProcessDefinitionVersionCmd(pi.getId(), 2));
// signal process instance
runtimeService.signal(execution.getId());
// check that the instance now uses the new process definition version
ProcessDefinition newProcessDefinition = repositoryService
.createProcessDefinitionQuery()
.processDefinitionVersion(2)
.singleResult();
pi = runtimeService
.createProcessInstanceQuery()
.processInstanceId(pi.getId())
.singleResult();
assertEquals(newProcessDefinition.getId(), pi.getProcessDefinitionId());
// check history
if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.ACTIVITY)) {
HistoricProcessInstance historicPI = historyService
.createHistoricProcessInstanceQuery()
.processInstanceId(pi.getId())
.singleResult();
assertEquals(newProcessDefinition.getId(), historicPI.getProcessDefinitionId());
}
// undeploy "manually" deployed process definition
repositoryService.deleteDeployment(deployment.getId(), true);
04-03-2014 02:45 AM
SetProcessDefinitionVersionCmd
. 04-03-2014 03:27 AM
04-04-2014 01:04 AM
04-04-2014 02:31 AM
04-07-2014 12:25 AM
04-07-2014 01:51 AM
04-07-2014 02:00 AM
04-14-2014 12:17 AM
04-14-2014 02:26 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.