Package org.jbpm.graph.log

Examples of org.jbpm.graph.log.ActionLog


  public void executeAction(Action action, ExecutionContext executionContext) {
    Token token = executionContext.getToken();

    // create action log
    ActionLog actionLog = new ActionLog(action);
    token.startCompositeLog(actionLog);

    // if this is an action being executed in an event,
    // the token needs to be locked. if this is an action
    // being executed as the node behaviour or if the token
    // is already locked, the token doesn't need to be locked.
    boolean actionMustBeLocked = (executionContext.getEvent() != null) && (!token.isLocked());

    try {
      // update the execution context
      executionContext.setAction(action);

      // execute the action
      log.debug("executing " + action);
      String lockOwnerId = "token[" + token.getId() + "]";
      try {
        if (actionMustBeLocked) {
          token.lock(lockOwnerId);
        }

        if (UserCodeInterceptorConfig.userCodeInterceptor != null) {
          UserCodeInterceptorConfig.userCodeInterceptor.executeAction(action, executionContext);
        } else {
          action.execute(executionContext);
        }

      } finally {
        if (actionMustBeLocked) {
          token.unlock(lockOwnerId);
        }
      }

    } catch (Exception exception) {
      // NOTE that Errors are not caught because that might halt the JVM and mask the original Error
      log.error("action threw exception: " + exception.getMessage(), exception);

      // log the action exception
      actionLog.setException(exception);

      // if an exception handler is available
      raiseException(exception, executionContext);
    } finally {
      executionContext.setAction(null);
View Full Code Here


  public void executeAction(Action action, ExecutionContext executionContext) {
    Token token = executionContext.getToken();

    // create action log
    ActionLog actionLog = new ActionLog(action);
    token.startCompositeLog(actionLog);

    try {
      // update the execution context
      executionContext.setAction(action);

      // execute the action
      log.debug("executing action '"+action+"'");
      try {
        token.lock();
       
        action.execute(executionContext);

      } finally {
        token.unlock();
      }
  
    } catch (Throwable exception) {
      log.error("action threw exception: "+exception.getMessage(), exception);
     
      // log the action exception
      actionLog.setException(exception);
  
      // if an exception handler is available
      raiseException(exception, executionContext);
     
    } finally {
View Full Code Here

  public void executeAction(Action action, ExecutionContext executionContext) {
    Token token = executionContext.getToken();

    // create action log
    ActionLog actionLog = new ActionLog(action);
    token.startCompositeLog(actionLog);

    try {
      // update the execution context
      executionContext.setAction(action);

      // execute the action
      log.debug("executing action '"+action+"'");
      String lockOwnerId = "token["+token.getId()+"]";
      try {
        token.lock(lockOwnerId);
       
        action.execute(executionContext);

      } finally {
        token.unlock(lockOwnerId);
      }
  
    } catch (Exception exception) {
      // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
      log.error("action threw exception: "+exception.getMessage(), exception);
     
      // log the action exception
      actionLog.setException(exception);
  
      // if an exception handler is available
      raiseException(exception, executionContext);
     
    } finally {
View Full Code Here

  public void executeAction(Action action, ExecutionContext executionContext) {
    Token token = executionContext.getToken();

    // create action log
    ActionLog actionLog = new ActionLog(action);
    token.startCompositeLog(actionLog);

    // if this is an action being executed in an event,
    // the token needs to be locked.  if this is an action
    // being executed as the node behaviour or if the token
    // is already locked, the token doesn't need to be locked.
    boolean actionMustBeLocked = (executionContext.getEvent()!=null)
                                 && (!token.isLocked());

    try {
      // update the execution context
      executionContext.setAction(action);

      // execute the action
      log.debug("executing action '"+action+"'");
      String lockOwnerId = "token["+token.getId()+"]";
      try {
        if (actionMustBeLocked) {
          token.lock(lockOwnerId);
        }
       
        if (UserCodeInterceptorConfig.userCodeInterceptor!=null) {
          UserCodeInterceptorConfig.userCodeInterceptor.executeAction(action, executionContext);
        } else {
          action.execute(executionContext);
        }

      } finally {
        if (actionMustBeLocked) {
          token.unlock(lockOwnerId);
        }
      }
  
    } catch (Exception exception) {
      // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
      log.error("action threw exception: "+exception.getMessage(), exception);
     
      // log the action exception
      actionLog.setException(exception);
  
      // if an exception handler is available
      raiseException(exception, executionContext);
     
    } finally {
View Full Code Here

TOP

Related Classes of org.jbpm.graph.log.ActionLog

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.