yuxc
2025-01-07 1f7fb3d9affd85a327d6baa60bb3fd32943ef5c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package org.jbpm.pvm.internal.migration;
 
import org.jbpm.api.ExecutionService;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessInstance;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
 
 
public class AbortMigrationHandler implements MigrationHandler {
 
  public void migrateInstance(ProcessDefinition newProcessDefinition, ProcessInstance processInstance, MigrationDescriptor migrationDescriptor) {
    ExecutionService executionService = EnvironmentImpl.getFromCurrent(ExecutionService.class);
    if (executionService == null) return;
    executionService.endProcessInstance(processInstance.getId(), "aborted");
  }
 
}