资源简介

Activiti6-流程跟踪监控图-节点-流程线高亮显示-支持通过、不通过、驳回、退回 支持内容: 已完成节点高亮显示、当前执行中节点红色显示 支持一个节点多条流出线,包括通过、不通过、驳回、退回,按照已执行操作正确显示高亮流程线

资源截图

代码片段和文件信息


import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.activiti.bpmn.model.BpmnModel;
import org.activiti.bpmn.model.FlowNode;
import org.activiti.bpmn.model.SequenceFlow;
import org.activiti.engine.HistoryService;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntityImpl;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.task.Task;
import org.activiti.image.ProcessDiagramGenerator;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;


/**
 * title: activiti工具类 

 * 
 * @author Fuxs
 */
public class ActivitiUtils {

private static Logger logger = LogsUtil.getLogger(ActivitiUtils.class);
private static RepositoryService repositoryService = SpringContextUtils.getBean(RepositoryService.class);
private static HistoryService historyService = SpringContextUtils.getBean(HistoryService.class);
private static RuntimeService runtimeService = SpringContextUtils.getBean(RuntimeService.class);
private static TaskService taskService = SpringContextUtils.getBean(TaskService.class);
private static ProcessEngineConfiguration processEngineConfiguration = SpringContextUtils.getBean(
ProcessEngineConfiguration.class);


/**
 * Desc: 通过流程实例ID获取历史流程实例
 * @param procInstId
 * @return
 * @author Fuxs
 */
public static HistoricProcessInstance getHistoricProcInst(String procInstId) {
return historyService.createHistoricProcessInstanceQuery().processInstanceId(procInstId).singleResult();
}

/**
 * Desc: 通过流程实例ID获取流程中已经执行的节点,按照执行先后顺序排序
 * @param procInstId
 * @return
 * @author Fuxs
 */
public static List getHistoricActivityInstAsc(String procInstId) {
return historyService.createHistoricActivityInstanceQuery().processInstanceId(procInstId)
.orderByHistoricActivityInstanceId().asc().list();
}

/**
 * Desc: 通过流程实例ID获取流程中正在执行的节点
 * @param procInstId
 * @return
 * @author Fuxs
 */
public static List getRunningActivityInst(String procInstId) {
return runtimeService.createExecutionQuery().processInstanceId(procInstId).list();
}

/**
 * Desc: 通过流程实例ID获取已经完成的历史流程实例
 * @param procInstId
 * @return
 * @author Fuxs
 */
public static List getHistoricFinishedProcInst(String procInstId) {
return historyService.createHistoricProcessInstanceQuery().processInstanceId(procInstId).finished().list();
}

/**
 * 获取已流经的

评论

共有 条评论