Package org.jbpm.process.audit

Examples of org.jbpm.process.audit.ProcessInstanceLog


    //@PersistenceUnit(unitName = "org.jbpm.domain")
  private EntityManagerFactory emf;

  public List<ActiveNodeInfo> getActiveNodeInfo(String instanceId) {
      AuditLogService auditLogService = new JPAAuditLogService(emf);
    ProcessInstanceLog processInstance = auditLogService.findProcessInstance(new Long(instanceId));
    if (processInstance == null) {
      throw new IllegalArgumentException("Could not find process instance " + instanceId);
    }
    Map<String, NodeInstanceLog> nodeInstances = new HashMap<String, NodeInstanceLog>();
    for (NodeInstanceLog nodeInstance: auditLogService.findNodeInstances(new Long(instanceId))) {
      if (nodeInstance.getType() == NodeInstanceLog.TYPE_ENTER) {
        nodeInstances.put(nodeInstance.getNodeInstanceId(), nodeInstance);
      } else {
        nodeInstances.remove(nodeInstance.getNodeInstanceId());
      }
    }
    if (!nodeInstances.isEmpty()) {
      List<ActiveNodeInfo> result = new ArrayList<ActiveNodeInfo>();
      for (NodeInstanceLog nodeInstance: nodeInstances.values()) {
        boolean found = false;
        DiagramInfo diagramInfo = getDiagramInfo(processInstance.getProcessId());
        if (diagramInfo != null) {
            for (DiagramNodeInfo nodeInfo: diagramInfo.getNodeList()) {
              if (nodeInfo.getName().equals("id=" + nodeInstance.getNodeId())) {
                result.add(new ActiveNodeInfo(diagramInfo.getWidth(), diagramInfo.getHeight(), nodeInfo));
                found = true;
                break;
              }
            }
        } else {
            throw new IllegalArgumentException("Could not find info for diagram for process " + processInstance.getProcessId());
        }
        if (!found) {
          throw new IllegalArgumentException("Could not find info for node "
            + nodeInstance.getNodeId() + " of process " + processInstance.getProcessId());
        }
      }
      return result;
    }
    return null;
View Full Code Here


        System.out.println("Process started");

        AuditLogService logService = (AuditLogService) context.getBean("logService");
        DefaultTransactionDefinition def = new DefaultTransactionDefinition();
        TransactionStatus status = aptm.getTransaction(def);
        ProcessInstanceLog log = logService.findProcessInstance(processInstance.getId());
        aptm.commit(status);
        assertNotNull(log);

        List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");
        System.out.println("Found " + tasks.size() + " task(s) for user 'john'");
View Full Code Here

        System.out.println("Found " + tasks.size() + " task(s) for user 'john'");
        assertEquals(0, tasks.size());

        def = new DefaultTransactionDefinition();
        status = aptm.getTransaction(def);
        ProcessInstanceLog log = logService.findProcessInstance(processInstanceId);
        aptm.commit(status);
        assertNull(log);
    }
View Full Code Here

        ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");

        System.out.println("Process started");

        AuditLogService logService = (AuditLogService) context.getBean("logService");
        ProcessInstanceLog log = logService.findProcessInstance(processInstance.getId());
        assertNotNull(log);

        List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");
        System.out.println("Found " + tasks.size() + " task(s) for user 'john'");
        assertEquals(1, tasks.size());
View Full Code Here

TOP

Related Classes of org.jbpm.process.audit.ProcessInstanceLog

Copyright © 2018 www.massapicom. 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.