Examples of HistoryService


Examples of org.activiti.engine.HistoryService

    /**
     * 已办任务(历史任务).
     */
    public Page findHistoryTasks(String userId, Page page) {
        HistoryService historyService = processEngine.getHistoryService();

        long count = historyService.createHistoricTaskInstanceQuery()
                .taskAssignee(userId).finished().count();
        List<HistoricTaskInstance> historicTaskInstances = historyService
                .createHistoricTaskInstanceQuery().taskAssignee(userId)
                .finished().listPage((int) page.getStart(), page.getPageSize());
        page.setResult(historicTaskInstances);
        page.setTotalCount(count);

View Full Code Here

Examples of org.activiti.engine.HistoryService

    /**
     * 历史流程实例.
     */
    public Page findHistoricProcessInstances(Page page) {
        HistoryService historyService = processEngine.getHistoryService();

        long count = historyService.createHistoricProcessInstanceQuery()
                .count();
        List<HistoricProcessInstance> historicProcessInstances = historyService
                .createHistoricProcessInstanceQuery().listPage(
                        (int) page.getStart(), page.getPageSize());
        page.setResult(historicProcessInstances);
        page.setTotalCount(count);

View Full Code Here

Examples of org.activiti.engine.HistoryService

    /**
     * 历史节点.
     */
    public Page findHistoricActivityInstances(Page page) {
        HistoryService historyService = processEngine.getHistoryService();

        long count = historyService.createHistoricActivityInstanceQuery()
                .count();
        List<HistoricActivityInstance> historicActivityInstances = historyService
                .createHistoricActivityInstanceQuery().listPage(
                        (int) page.getStart(), page.getPageSize());
        page.setResult(historicActivityInstances);
        page.setTotalCount(count);

View Full Code Here

Examples of org.activiti.engine.HistoryService

    /**
     * 历史任务.
     */
    public Page findHistoricTaskInstances(Page page) {
        HistoryService historyService = processEngine.getHistoryService();

        long count = historyService.createHistoricTaskInstanceQuery().count();
        List<HistoricTaskInstance> historicTaskInstances = historyService
                .createHistoricTaskInstanceQuery().listPage(
                        (int) page.getStart(), page.getPageSize());
        page.setResult(historicTaskInstances);
        page.setTotalCount(count);

View Full Code Here

Examples of org.activiti.engine.HistoryService

    for (Entry<String, Object> entry : entrySet) {
      System.out.println(entry.getKey() + "=" + entry.getValue());
    }
   
    // 历史记录
    HistoryService historyService = activitiRule.getHistoryService();
    List<HistoricDetail> list = historyService.createHistoricDetailQuery().formProperties().list();
    assertEquals(1, list.size());
   
    // 获取第一个节点
    TaskService taskService = activitiRule.getTaskService();
    Task task = taskService.createTaskQuery().singleResult();
View Full Code Here

Examples of org.activiti.engine.HistoryService

    protected void printDetails(String pid) {
        ProcessEngine pe = this.getProcessEngine();
        RepositoryService repo = pe.getRepositoryService();
        RuntimeService rt = pe.getRuntimeService();
        HistoryService hs = pe.getHistoryService();

        ProcessInstance pi = rt.createProcessInstanceQuery().processInstanceId(pid).singleResult();
        HistoricProcessInstance hpi = hs.createHistoricProcessInstanceQuery().processInstanceId(pid)
            .singleResult();
        if (pi == null && hpi == null) {
            // both null means. no process with that id.
            out().printf("No process details found with process id %s \n", pid);
            return;
        }

        String pdId = null;
        if (pi != null) {
            pdId = pi.getProcessDefinitionId();
        } else if (hpi != null) {
            pdId = hpi.getProcessDefinitionId();
        }

        ProcessDefinition pd = repo.createProcessDefinitionQuery().processDefinitionId(pdId).singleResult();
        Deployment depInfo = repo.createDeploymentQuery().deploymentId(pd.getDeploymentId()).singleResult();
        // print
        if (isVerbose()) {
            out().println("======== Deployment Details");
            printDeploymentInfo(depInfo);

            out().println("======== Process Definition Details");
            printProcessDefinitionInfo(pd);
        }

        out().println("======== Process Instance Details");
        printProcessInstanceInfo(hpi);

        List<HistoricActivityInstance> actInstList = hs.createHistoricActivityInstanceQuery()
            .processInstanceId(hpi.getId()).orderByHistoricActivityInstanceStartTime().asc().list();
        if (actInstList != null && actInstList.size() > 0) {
            out().println("======== Activity Execution Details");
            for (HistoricActivityInstance actInst : actInstList) {
                printActivityInstanceInfo(actInst);
View Full Code Here

Examples of org.activiti.engine.HistoryService

            RepositoryService repo = pe.getRepositoryService();
            printProcessDefinitions(out(), repo);
        }

        if (this.history) {
            HistoryService his = pe.getHistoryService();
            boolean printActive = !this.active; // if we show active process, dont print then in history
            printHistoricProcessInstances(out(), his, printActive);
        }

        if (this.active) {
View Full Code Here

Examples of org.activiti.engine.HistoryService

        ProcessEngine engine = this.getProcessEngine();
        if (engine == null) {
            out().println("Process Engine NOT Found!");
            return null;
        }
        HistoryService historyService = engine.getHistoryService();

        // order of priority if instnaceIDs or definitionIDs and all on the list
        // process instnaceID and exist or process definitionIDs and exit or process all
        // TODO figure out how to add mutually exclusive options - instanceIDs | definitions | all
View Full Code Here

Examples of org.activiti.engine.HistoryService

    List<Object> varList = (List<Object>) variable;
    assertEquals(1, varList.size());
    Message ruledMessage = (Message) varList.get(0);
    assertEquals(1, ruledMessage.getStatus());*/

    HistoryService historyService = activitiRule.getHistoryService();
    long count = historyService.createHistoricProcessInstanceQuery()
        .finished().count();
    assert count == 1;

    // 从history查询变量
    List<HistoricDetail> list = historyService.createHistoricDetailQuery()
        .processInstanceId(processInstance.getId()).list();
    for (HistoricDetail historicDetail : list) {
      HistoricVariableUpdate variableDetail = (HistoricVariableUpdate) historicDetail;
      System.out.println(variableDetail.getVariableName() + " = "
          + variableDetail.getValue());
View Full Code Here

Examples of org.activiti.engine.HistoryService

    return new ArchivedListQuery();
  }
 
  @Override
  protected Component createDetailComponent(String id) {
    HistoryService historyService = ProcessEngines.getDefaultProcessEngine().getHistoryService();
    HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().taskId(id).singleResult();
    taskEventPanel.setTaskId(historicTaskInstance.getId());
    return new HistoricTaskDetailPanel(historicTaskInstance, this);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.