activiti流程图的显⽰⾼亮连线和已执⾏节点及当前节点
activiti流程图的显⽰ ⾼亮连线和已执⾏节点及当前节点
⼤家好,本⼈⽟⽶,这是我⾸次在csdn发帖,不太会编辑,见谅。本贴是为了教⼤家解决activiti5.22⾥的流程图⾼亮显⽰,并且绿⾊表明已⾛过的路线,以及红⾊表明当期正处于的任务节点。话不多说,先上效果图:
是不是很帅~~
一朵白蔷薇我⽤的是springboot+springcloud
controller⾥的调⽤代码:
/**
* @读取动态流程图
* @author yumiyellow
*/
@RequestMapping("/showView/{processInstanceId}")
public String showView(@PathVariable("processInstanceId")String processInstanceId, HttpServletRespon respon) throws IOException {
try {
if (StringUtil.isEmpty(processInstanceId)) {
<("参数为空");
}
HistoricProcessInstance processInstance = ateHistoricProcessInstanceQuery()
.processInstanceId(processInstanceId).singleResult();
BpmnModel bpmnModel = ProcessDefinitionId());
ProcessDefinitionEntity definitionEntity = (ProcessDefinitionEntity) repositoryService
.ProcessDefinitionId());
List<HistoricActivityInstance> highLightedActivitList = ateHistoricActivityInstanceQuery()
.processInstanceId(processInstanceId).orderByHistoricActivityInstanceStartTime().asc().list();
// ⾼亮环节id集合
List<String> highLightedActivitis = new ArrayList<String>();
// ⾼亮线路id集合
List<String> highLightedFlows = getHighLightedFlows(definitionEntity, highLightedActivitList);
税管员for (HistoricActivityInstance tempActivity : highLightedActivitList) {
String activityId = ActivityId();
highLightedActivitis.add(activityId);
}
Set<String> currIds = ateExecutionQuery().Id()).list()
.stream().map(e-&ActivityId()).Set());
炒饭的100种做法大全CustomProcessDiagramGeneratorI diagramGenerator = (CustomProcessDiagramGeneratorI) processEngineConfiguration
.getProcessDiagramGenerator();
InputStream inputStream = ateDiagram(bpmnModel, "png", highLightedActivitis,
highLightedFlows, "宋体", "宋体", "宋体", null, 1.0, new Color[] { WorkflowConstants.COLOR_NORMAL, WorkflowConstants.COLOR_CURREN T }, currIds);
OutputStream outputStream = OutputStream();
for (int b = -1; (b = ad()) != -1; ) {
outputStream.write(b);
}
outputStream.clo();
inputStream.clo();
return null;
蒸排骨需要多长时间}catch (Exception e){
<("流程图查看出错{}",e);
}
aabc式的成语有哪些return null;
}
沙拉每日金句励志另外需要以下⼏个⽂件在项⽬中配置下:
渲图
这5个⽂件我已为⼤家写好了,⼤家可以打包下载以上需要使⽤的⽂件,放进⾃⼰项⽬就能直接⽤。感谢⽀持下哈!o( ̄︶ ̄)o
资料下载链接: