工作流activiti 6 学习笔记 获取流程分支扩展属性配置
【摘要】 获取流程分支扩展属性配置// 部署流程 Deployment deploye = rs.createDeployment().addClasspathResource("proptest.bpmn").deploy(); ProcessDefinition pdf = rs.createProcessDefinitionQuery().deploymentId(deploye.ge...
获取流程分支扩展属性配置
// 部署流程
Deployment deploye = rs.createDeployment().addClasspathResource("proptest.bpmn").deploy();
ProcessDefinition pdf = rs.createProcessDefinitionQuery().deploymentId(deploye.getId()).singleResult();
ProcessInstance pi = runS.startProcessInstanceById(pdf.getId());
System.out.println(pi.getId());
Task currenttask = ts.createTaskQuery().processInstanceId(pi.getId()).singleResult();
ts.complete(currenttask.getId());
currenttask = ts.createTaskQuery().processInstanceId(pi.getId()).singleResult();
BpmnModel bpmnModel = rs.getBpmnModel(pdf.getId());
org.activiti.bpmn.model.Process process = bpmnModel.getProcesses().get(0);
//获取所有普通任务节点
List<UserTask> UserTaskList = process.findFlowElementsOfType(UserTask.class);
for(UserTask userTask:UserTaskList){
//获取当前任务节点Id
String id = userTask.getId();
if(id.equals(currenttask.getTaskDefinitionKey())){
//获取当前任务节点的所有出线信息
List<SequenceFlow> outgoingFlows = userTask.getOutgoingFlows();
for(SequenceFlow sequenceFlow:outgoingFlows){
Map<String, List<ExtensionElement>> map = sequenceFlow.getExtensionElements();
List<ExtensionElement> listpros = map.get("properties");
if(listpros!=null) {
ExtensionElement element = listpros.get(0);
Map<String, List<ExtensionElement>> tem = element.getChildElements();
List<ExtensionElement> tlist = tem.get("property");
ExtensionElement te = tlist.get(0);
Map<String, List<ExtensionAttribute>> ddd = te.getAttributes();
List<ExtensionAttribute> list = ddd.get("name");
list.get(0).getValue();
List<ExtensionAttribute> list2 = ddd.get("value");
list2.get(0).getValue();
String dd= te.getAttributeValue(te.getNamespace(), "property");
String naem = element.getName();
String cf = element.getAttributeValue(element.getNamespace(), "cf");
}
}
}
}
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)