Activity6.0 查看流程图以及动态显示任务当前执行的点

Activity6.0 中 org.activiti.engine.impl.pvm整个包被移除 ,意味不能用ActivitiImpl的方式获取活动节点了

所有的流程定义有关的信息都可以通过BpmnModel来获得,

获得 BpmnModel的方式可以通过 org.activiti.engine.impl.util.ProcessDefinitionUtil 来拿到。


用BpmnModel的方式获取当前活动 对象的X轴,Y轴,Width,Height的值,这个可用于查看流程图的当前位置,然后加个框框高亮显示就完成了。


    String  taskId = "30008";
    Task task = taskService.createTaskQuery().taskId(taskId).singleResult();

    BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
    //获取当前活动对象
    FlowElement flowElement = bpmnModel.getFlowElement(task.getTaskDefinitionKey());
 
    GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowElement.getId());
 
    System.out.println("graphicInfo.getX() = " + graphicInfo.getX());
    System.out.println("graphicInfo.getY() = " + graphicInfo.getY());
    System.out.println("graphicInfo.getHeight() = " + graphicInfo.getHeight());
    System.out.println("graphicInfo.getWidth() = " + graphicInfo.getWidth());
 

 

你可能感兴趣的:(activiti6)