Activiti customizes the highlighting of diagram.

  activiti, java, springboot

Implement ProcessDiagramGenerator

The main method is to extend the generateDiagram.

public InputStream generateDiagram(BpmnModel bpmnModel, String imageType,
                                       List<String> highLightedActivities, List<String> highLightedFlows, double scaleFactor) {
        return generateDiagram(bpmnModel, imageType, highLightedActivities, highLightedFlows,null, null, null,null, scaleFactor);
    }

By modifying this method, you can customize what color has been used and what color is currently used.

Gets the current activity

runtimeService.getActiveActivityIds(execution.getId());

Get historical activity and flow

List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).list();
Process process = bpmnModel.getMainProcess();
FlowElement flowElement = process.getFlowElement(getActivityId());

docs