查询流程实例

/**
 * 查询流程实例
 * @author Administrator
 *
 */
public class Test05 {
    public static void main(String[] args) {
        ProcessEngine processEngine = 
                 ProcessEngines.getDefaultProcessEngine();
        //查询所有的流程实例
        List<ProcessInstance> list = 
                    processEngine.getRuntimeService()
                    .createProcessInstanceQuery().list();
        System.out.println(list.size());
        //遍历所有的的流程
        for(ProcessInstance pi:list){
            System.out.println(pi.getId());
            System.out.println(pi.getProcessDefinitionId());
            System.out.println(pi.getProcessInstanceId());
            System.out.println(pi.getActivityId());
            System.out.println(pi.getParentId());
            System.out.println("---------------------------");
        }
    }
}

 

posted @ 2018-01-17 08:36  yoyo198212  阅读(546)  评论(0编辑  收藏  举报