Package org.jbpm.logging.exe

Examples of org.jbpm.logging.exe.LoggingInstance


  public void save(ProcessInstance processInstance, JbpmContext jbpmContext) {
    LoggingService loggingService = jbpmContext.getServices().getLoggingService();

    if (loggingService != null) {
      LoggingInstance loggingInstance = processInstance.getLoggingInstance();
      log.debug("posting logs to logging service.");
      for (ProcessLog processLog : loggingInstance.getLogs()) {
        loggingService.log(processLog);
      }
    }
    else {
      log.debug("ignoring logs.  no logging service available.");
View Full Code Here


  /**
   * convenience method for adding a process log.
   */
  public void addLog(ProcessLog processLog)
  {
    LoggingInstance li = processInstance.getLoggingInstance();
    if (li != null)
    {
      processLog.setToken(this);
      li.addLog(processLog);
    }
  }
View Full Code Here

   * convenience method for starting a composite log. When you add composite logs, make sure you put the
   * {@link #endCompositeLog()} in a finally block.
   */
  public void startCompositeLog(CompositeLog compositeLog)
  {
    LoggingInstance li = processInstance.getLoggingInstance();
    if (li != null)
    {
      compositeLog.setToken(this);
      li.startCompositeLog(compositeLog);
    }
  }
View Full Code Here

  /**
   * convenience method for ending a composite log. Make sure you put this in a finally block.
   */
  public void endCompositeLog()
  {
    LoggingInstance li = processInstance.getLoggingInstance();
    if (li != null)
    {
      li.endCompositeLog();
    }
  }
View Full Code Here

                if (! ProcessLog.class.isAssignableFrom(type)) {
                    context.setError("Error reading process logs", "The given log type '" + type.getName() + "' is not a valid process log type");
                    return;
                }
                final ProcessInstance processInstance = (ProcessInstance) processInstanceValue;
                final LoggingInstance loggingInstance = processInstance.getLoggingInstance();
                processLogs = loggingInstance.getLogs(type);
            } else {
                final ProcessInstance processInstance = (ProcessInstance) processInstanceValue;
                final LoggingInstance loggingInstance = processInstance.getLoggingInstance();
                processLogs = loggingInstance.getLogs();
            }
            // TODO - add filter parameters perhaps?
            targetExpression.setValue(elContext, processLogs);
            context.selectOutcome("success");
        } catch (Exception ex) {
View Full Code Here

  public void save(ProcessInstance processInstance, JbpmContext jbpmContext) {
    LoggingService loggingService = jbpmContext.getServices().getLoggingService();
   
    if (loggingService!=null) {
      LoggingInstance loggingInstance = processInstance.getLoggingInstance();
      log.debug("flushing logs to logging service.");
      Iterator iter = loggingInstance.getLogs().iterator();
      while (iter.hasNext()) {
        ProcessLog processLog = (ProcessLog) iter.next();
        loggingService.log(processLog);
      }
     
View Full Code Here

    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Token token = processInstance.getRootToken();
    processInstance.signal();
   
    // check the transition log (from the start state to the state)
    LoggingInstance loggingInstance = processInstance.getLoggingInstance();
    List processLogs = loggingInstance.getLogs(SignalLog.class);

    // check that there is exactly one signal log
    assertEquals(1, processLogs.size());

    SignalLog signalLog = (SignalLog) processLogs.get(0);
    assertSame(token, signalLog.getToken());
    assertNotNull(signalLog.getDate());
   
    // now we signal a second time
    processInstance.signal();
    // and check if there are exactly 2 signal logs
    assertEquals(2, loggingInstance.getLogs(SignalLog.class).size());
  }
View Full Code Here

    );
    // start a process instance
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    processInstance.signal();
   
    LoggingInstance loggingInstance = processInstance.getLoggingInstance();
    assertEquals(0, loggingInstance.getLogs(NodeLog.class).size());

    processInstance.signal();
   
    List nodeLogs = loggingInstance.getLogs(NodeLog.class);
    assertEquals(1, nodeLogs.size());
    NodeLog nodeLog = (NodeLog) nodeLogs.get(0);
    assertSame(processDefinition.getNode("s"), nodeLog.node);
    assertNotNull(nodeLog.enter);
    assertNotNull(nodeLog.leave);
View Full Code Here

    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Token token = processInstance.getRootToken();
    processInstance.signal();
   
    // check the transition log (from the start state to the state)
    LoggingInstance loggingInstance = processInstance.getLoggingInstance();
    List transitionLogs = loggingInstance.getLogs(TransitionLog.class);
    assertEquals(1, transitionLogs.size());
    TransitionLog transitionLog = (TransitionLog) transitionLogs.get(0);
    assertSame(token, transitionLog.getToken());
    assertNotNull(transitionLog.getDate());
    assertSame(processDefinition.getStartState(), transitionLog.getSourceNode());
    assertSame(processDefinition.getNode("state"), transitionLog.getDestinationNode());

    // signal the process to continue (which will move it to the end state)
    processInstance.signal();
   
    // check the transition log (from the state to the end state)
    transitionLogs = loggingInstance.getLogs(TransitionLog.class);
    assertEquals(2, transitionLogs.size());
    transitionLog = (TransitionLog) transitionLogs.get(1);
    assertSame(token, transitionLog.getToken());
    assertNotNull(transitionLog.getDate());
    assertSame(processDefinition.getNode("state"), transitionLog.getSourceNode());
View Full Code Here

    Token token = processInstance.getRootToken();
    processInstance.signal();
    processInstance.signal();
   
    // check the transition log (from the start state to the state)
    LoggingInstance loggingInstance = processInstance.getLoggingInstance();
    List transitionLogs = loggingInstance.getLogs(TransitionLog.class);
    assertEquals(2, transitionLogs.size());
    TransitionLog transitionLog = (TransitionLog) transitionLogs.get(1);
    assertSame(token, transitionLog.getToken());
    assertNotNull(transitionLog.getDate());
    assertSame(processDefinition.findNode("superstate/state"), transitionLog.getSourceNode());
View Full Code Here

TOP

Related Classes of org.jbpm.logging.exe.LoggingInstance

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.