Package org.jbpm.logging.log

Examples of org.jbpm.logging.log.MessageLog


public class LogLogTest extends TestCase {
 
  public static class MessageAction implements ActionHandler {
    private static final long serialVersionUID = 1L;
    public void execute(ExecutionContext executionContext) throws Exception {
      executionContext.getToken().addLog(new MessageLog("hello from inside the message action"));
      executionContext.getContextInstance().setVariable("number", new Float(3.3));
    }
View Full Code Here


    ProcessDefinition processDefinition = new ProcessDefinition();
    ProcessInstance pi = new ProcessInstance(processDefinition);
    Token root = pi.getRootToken();
    LoggingInstance li = (LoggingInstance) pi.getInstance(LoggingInstance.class);
   
    ProcessLog one = new MessageLog(null);
    li.addLog(one);
   
    assertNull( one.getParent() );
    assertSame( one, li.getLogs().get(1) );
    assertEquals( 2, li.getLogs().size() );
    assertEquals( 0, li.getCompositeLogStack().size() );

    CompositeLog two = new CompositeLog();
    two.setToken(root);
    li.startCompositeLog(two);

    assertNull( two.getParent() );
    assertSame( two, li.getLogs().get(2) );
    assertEquals( 3, li.getLogs().size() );
    assertEquals( 1, li.getCompositeLogStack().size() );

    ProcessLog three = new MessageLog(null);
    li.addLog(three);

    assertSame( two, three.getParent() );
    assertSame( three, li.getLogs().get(3) );
    assertEquals( 4, li.getLogs().size() );
    assertEquals( 1, li.getCompositeLogStack().size() );

    CompositeLog four = new CompositeLog();
    four.setToken(root);
    li.startCompositeLog(four);

    assertSame( two, four.getParent() );
    assertSame( four, li.getLogs().get(4) );
    assertEquals( 5, li.getLogs().size() );
    assertEquals( 2, li.getCompositeLogStack().size() );

    ProcessLog five = new MessageLog(null);
    li.addLog(five);

    assertSame( four, five.getParent() );
    assertSame( two, five.getParent().getParent() );
    assertNull( five.getParent().getParent().getParent() );
    assertSame( five, li.getLogs().get(5) );
    assertEquals( 6, li.getLogs().size() );
    assertEquals( 2, li.getCompositeLogStack().size() );

    li.endCompositeLog();

    assertEquals( 1, li.getCompositeLogStack().size() );

    ProcessLog six = new MessageLog(null);
    li.addLog(six);

    assertSame( two, six.getParent() );
    assertNull( six.getParent().getParent() );
    assertSame( six, li.getLogs().get(6) );
    assertEquals( 7, li.getLogs().size() );
    assertEquals( 1, li.getCompositeLogStack().size() );

    li.endCompositeLog();
View Full Code Here

      "  </jbpm-context>" +
      "</jbpm-configuration>"
    );
   
    CustomLoggingService customLoggingService = null;
    MessageLog messageLog = null;
   
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext("a");
    try {
      customLoggingService = (CustomLoggingService) jbpmContext.getServices().getLoggingService();
      messageLog = new MessageLog("blablabla");
      ProcessInstance processInstance = new ProcessInstance();
      processInstance.getLoggingInstance().addLog(messageLog);
      jbpmContext.save(processInstance);

    } finally {
View Full Code Here

TOP

Related Classes of org.jbpm.logging.log.MessageLog

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.