Package org.activiti.engine.impl.pvm.delegate

Examples of org.activiti.engine.impl.pvm.delegate.ActivityExecution


    // TODO: merge two approaches (super process / regular process approach)
    if(eventHandlerId != null) {
      executeCatch(eventHandlerId, execution);
    }else {
      ActivityExecution superExecution = getSuperExecution(execution);
      if (superExecution != null) {
        executeCatchInSuperProcess(errorCode, superExecution);
      } else {
        LOG.info(execution.getActivity().getId() + " throws error event with errorCode '"
                + errorCode + "', but no catching boundary event was defined. "
View Full Code Here


  private static void executeCatchInSuperProcess(String errorCode, ActivityExecution superExecution) {
    String errorHandlerId = findLocalErrorEventHandler(superExecution, errorCode);
    if (errorHandlerId != null) {
      executeCatch(errorHandlerId, superExecution);
    } else { // no matching catch found, going one level up in process hierarchy
      ActivityExecution superSuperExecution = getSuperExecution(superExecution);
      if (superSuperExecution != null) {
        executeCatchInSuperProcess(errorCode, superSuperExecution);
      } else {
        throw new BpmnError(errorCode, "No catching boundary event found for error with errorCode '"
                + errorCode + "', neither in same process nor in parent process");
View Full Code Here

    if (errorHandler == null) {
      throw new ActivitiException(errorHandlerId + " not found in process definition");
    }
   
    boolean matchingParentFound = false;
    ActivityExecution leavingExecution = execution;
    ActivityImpl currentActivity = (ActivityImpl) execution.getActivity();   
   
    ScopeImpl catchingScope = errorHandler.getParent();
    if(catchingScope instanceof ActivityImpl) {
      ActivityImpl catchingScopeActivity = (ActivityImpl) catchingScope;
      if(!catchingScopeActivity.isScope()) { // event subprocesses
        catchingScope = catchingScopeActivity.getParent();
      }
    }
   
    if(catchingScope instanceof PvmProcessDefinition) {
      executeEventHandler(errorHandler, ((ExecutionEntity)execution).getProcessInstance());
     
    } else {     
      if (currentActivity.getId().equals(catchingScope.getId())) {
        matchingParentFound = true;
      } else {
        currentActivity = (ActivityImpl) currentActivity.getParent();
     
        // Traverse parents until one is found that is a scope
        // and matches the activity the boundary event is defined on
        while(!matchingParentFound && leavingExecution != null && currentActivity != null) {
          if (!leavingExecution.isConcurrent() && currentActivity.getId().equals(catchingScope.getId())) {
            matchingParentFound = true;
          } else if (leavingExecution.isConcurrent()) {
            leavingExecution = leavingExecution.getParent();
          } else {
            currentActivity = currentActivity.getParentActivity();
            leavingExecution = leavingExecution.getParent();
          }
        }
       
        // Follow parents up until matching scope can't be found anymore (needed to support for multi-instance)
        while (leavingExecution != null
                && leavingExecution.getParent() != null
                && leavingExecution.getParent().getActivity() != null
                && leavingExecution.getParent().getActivity().getId().equals(catchingScope.getId())) {
          leavingExecution = leavingExecution.getParent();
        }
      }
     
      if (matchingParentFound && leavingExecution != null) {
        executeEventHandler(errorHandler, leavingExecution);
View Full Code Here

  public void execute(ActivityExecution execution) throws Exception {

    InterpretableExecution interpretableExecution = (InterpretableExecution) execution;
    ActivityImpl activity = interpretableExecution.getProcessDefinition().findActivity(activityId);
   
    ActivityExecution outgoingExecution = execution;
   
    if(isInterrupting) {
      execution.destroyScope("Event subprocess triggered using activity "+ activityId);
    } else{
      outgoingExecution = execution.createExecution();
      outgoingExecution.setActive(true);
      outgoingExecution.setScope(false);
      outgoingExecution.setConcurrent(true);
    }
   
    // set the outgoing execution to this activity
    ((InterpretableExecution)outgoingExecution).setActivity(activity);
   
    // continue execution
    outgoingExecution.takeAll(activity.getOutgoingTransitions(), Collections.EMPTY_LIST);
  }
View Full Code Here

    // have compensated
   
    // join compensating executions   
    if(execution.getExecutions().isEmpty()) {
      if(execution.getParent() != null) {
        ActivityExecution parent = execution.getParent();
        ((InterpretableExecution)execution).remove();
        ((InterpretableExecution)parent).signal("compensationDone", signalData);
      }     
    } else {     
      ((ExecutionEntity)execution).forceUpdate()
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.pvm.delegate.ActivityExecution

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.