zoukankan      html  css  js  c++  java
  • activiti查询

    一  1.根据当前任务id获得当前任务对象
      Task task = processEngine.getTaskService().createTaskQuery().taskId(taskId).singleResult();
    2.根据流程id获得流程实例

    ProcessInstance pi =processEngine.getRuntimeService().createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();

    3.根据任务id获得流程实例id

    task.getProcessInstanceId();

    4.根据任务id获得流程定义id

    task.getProcessDefinitionId();

    5.更具流程实例id获得流程

    HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()

    .processInstanceId(pProcessInstanceId).singleResult();

    6.根据任务名字获得所有任务

    List<Task> list = taskService.createTaskQuery() 

    .taskCandidateOrAssigned("userId").list();  

    7.添加批注信息

    taskService.addComment(taskId, task.getProcessInstanceId(), message); 

    8.查询批注信息

     List<Comment> list = taskService.getProcessInstanceComments(task.getProcessInstanceId()); 

    9.获取历史流程实例

    HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
                     .processInstanceId(pProcessInstanceId).singleResult();

    10.获得流程定义(根据历史流程实例id)

    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
                         .getDeployedProcessDefinition(historicProcessInstance.getProcessDefinitionId());

    11.获得流程实例中已执行的节点

    List<HistoricActivityInstance> historicActivityInstanceList = historyService.createHistoricActivityInstanceQuery()
                         .processInstanceId(pProcessInstanceId).orderByHistoricActivityInstanceId().asc().list();

    12.查询流程定

    List<ProcessDifintion> list = processEngine.getRepositoryService.CreateProcessDefinitionQuery().processDefinitionId(processDefifinitionId).list();
    ---------------------
    作者:pgh_1947
    来源:CSDN
    原文:https://blog.csdn.net/pgh_1947/article/details/77340711
    版权声明:本文为博主原创文章,转载请附上博文链接!

  • 相关阅读:
    转MySQL详解--索引
    [转]关于MYSQL Innodb 锁行还是锁表
    根据STATUS信息对MySQL进行优化
    源码编译安装 MySQL 5.5.x 实践
    thrift服务端到客户端开发简单示例
    thrift安装
    thrift 调取 python php go 客户端代码
    Linux系统启动级别及顺序
    Linux手动释放内存
    /etc/passwd&/etc/shadow文件分析
  • 原文地址:https://www.cnblogs.com/furenjian/p/10259429.html
Copyright © 2011-2022 走看看