activiti7__02ProcessDefinition
作者:互联网
流程定义 ProcessDefinition
◆ Deployment:添加资源文件、获取部署信息、部署时间
◆ Process Definition:获取版本号、key、资源名称、部署ID等
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.ProcessDefinition;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.List;
@SpringBootTest
public class Test02ProcessDefinition {
@Autowired
private RepositoryService repositoryService;
//流程定义查询
@Test
public void getInfo111(){
List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().list();
for (int i = 0; i <list.size() ; i++) {
ProcessDefinition p = list.get(i);
System.out.println("getCategory>>"+p.getCategory());
System.out.println("getDeploymentId>>"+p.getDeploymentId());
System.out.println("getId>>"+p.getId());
System.out.println("getDescription>>"+p.getDescription());
System.out.println("getVersion>>"+p.getVersion());
}
}
//删除流程
@Test
public void getInfo222(){
//给定的不是id 是deploymentId
String deploymentId = "dcf55fd1-4b74-11eb-bb53-6c71d96cc83a";
// 否认false 保留历史定义信息
//true 表示一笔勾销 删除与流程所有的信息
repositoryService.deleteDeployment(deploymentId,true);
}
}
标签:__,System,02ProcessDefinition,activiti7,Test,import,println,org,out 来源: https://www.cnblogs.com/code1990/p/14219341.html