Examples of ProcessInstanceLog


Examples of org.drools.process.audit.ProcessInstanceLog

* @author Kris Verlaenen
*/
public class GraphViewerPluginImpl implements GraphViewerPlugin {

  public List<ActiveNodeInfo> getActiveNodeInfo(String instanceId) {
    ProcessInstanceLog processInstance = ProcessInstanceDbLog.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: ProcessInstanceDbLog.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());
        for (DiagramNodeInfo nodeInfo: diagramInfo.getNodeList()) {
          if (nodeInfo.getName().equals("id=" + nodeInstance.getNodeId())) {
            result.add(new ActiveNodeInfo(diagramInfo.getWidth(), diagramInfo.getHeight(), nodeInfo));
            found = true;
            break;
          }
        }
        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

Examples of org.jbpm.process.audit.ProcessInstanceLog

public class GraphViewerPluginImpl implements GraphViewerPlugin {
 
  private KnowledgeBase kbase;

  public List<ActiveNodeInfo> getActiveNodeInfo(String instanceId) {
    ProcessInstanceLog processInstance = ProcessInstanceDbLog.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: ProcessInstanceDbLog.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());
        for (DiagramNodeInfo nodeInfo: diagramInfo.getNodeList()) {
          if (nodeInfo.getName().equals("id=" + nodeInstance.getNodeId())) {
            result.add(new ActiveNodeInfo(diagramInfo.getWidth(), diagramInfo.getHeight(), nodeInfo));
            found = true;
            break;
          }
        }
        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

Examples of org.jbpm.process.audit.ProcessInstanceLog

    delegate.removeProcess("312");
 
 
  @Test
  public void testStartInstance(){
    ProcessInstanceLog instance = delegate.startProcess("Minimal", null);
    assertEquals("Minimal", instance.getProcessId());
  }
View Full Code Here

Examples of org.jbpm.process.audit.ProcessInstanceLog

    assertEquals("Minimal", instance.getProcessId());
  }
 
  @Test
  public void testGetProcessInstanceLog() {
    ProcessInstanceLog instance = delegate.startProcess("Minimal", null);
    assertEquals(instance.getId(), delegate.getProcessInstanceLog(instance.getId() + "").getId());
  }
View Full Code Here

Examples of org.jbpm.process.audit.ProcessInstanceLog

  @Test
  public void testGetProcessInstanceVariables(){
    HashMap<String,Object> variables = new HashMap<String, Object>();
    variables.put("key", "value");
   
    ProcessInstanceLog instance = delegate.startProcess("UserTask", variables);
   
    assertEquals(variables, delegate.getProcessInstanceVariables(instance.getProcessInstanceId() + ""));
  }
View Full Code Here

Examples of org.jbpm.process.audit.ProcessInstanceLog

    assertEquals(variables, delegate.getProcessInstanceVariables(instance.getProcessInstanceId() + ""));
  }
 
  @Test
  public void testSetProcessInstanceVariables(){
    ProcessInstanceLog instance = delegate.startProcess("UserTask", null);
    HashMap<String,Object> newVariables = new HashMap<String, Object>();
    newVariables.put("key", "value2");
    delegate.setProcessInstanceVariables(instance.getId() + "", newVariables);
    assertEquals(newVariables, delegate.getProcessInstanceVariables(instance.getId() + ""));
  }
View Full Code Here

Examples of org.jbpm.process.audit.ProcessInstanceLog

  }
 
  @Test
  public void testProcessInstance(){
    String instanceID = Long.toString(delegate.startProcess("UserTask", null).getId());
    ProcessInstanceLog instanceLog =delegate.getProcessInstanceLog(instanceID);
    ProcessInstanceRef processInstanceRef = Transform.processInstance(instanceLog);
   
    assertEquals(instanceLog.getProcessInstanceId(),Long.parseLong(processInstanceRef.getId()));
    assertEquals(instanceLog.getProcessId(),processInstanceRef.getDefinitionId());
   
  }
View Full Code Here

Examples of org.jbpm.process.audit.ProcessInstanceLog

    delegate.removeProcess(definitionId);
      return getProcessDefinitions();
  }

  public ProcessInstanceRef getProcessInstance(String instanceId) {
    ProcessInstanceLog processInstance = delegate.getProcessInstanceLog(instanceId);
    return Transform.processInstance(processInstance);
  }
View Full Code Here

Examples of org.jbpm.process.audit.ProcessInstanceLog

    }
    return result;
  }

  public ProcessInstanceRef newInstance(String definitionId) {
    ProcessInstanceLog processInstance = delegate.startProcess(definitionId, null);
    return Transform.processInstance(processInstance);
  }
View Full Code Here

Examples of org.jbpm.process.audit.ProcessInstanceLog

    ProcessInstanceLog processInstance = delegate.startProcess(definitionId, null);
    return Transform.processInstance(processInstance);
  }
 
  public ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars) {
    ProcessInstanceLog processInstance = delegate.startProcess(definitionId, processVars);
    return Transform.processInstance(processInstance);
  }
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.