Package org.activiti.engine.impl.pvm.runtime

Examples of org.activiti.engine.impl.pvm.runtime.InterpretableExecution


        processInstance.insert();
        processInstance.setProcessDefinition(processDefinition);
        processInstance.setProcessInstance(processInstance);
        processInstance.initialize();

        InterpretableExecution scopeInstance = processInstance;

        List<ActivityImpl> initialActivityStack = processDefinition
                .getInitialActivityStack(initial);

        for (ActivityImpl initialActivity : initialActivityStack) {
            if (initialActivity.isScope()) {
                scopeInstance = (InterpretableExecution) scopeInstance
                        .createExecution();
                scopeInstance.setActivity(initialActivity);

                if (initialActivity.isScope()) {
                    scopeInstance.initialize();
                }
            }
        }

        scopeInstance.setActivity(initial);

        return processInstance;
    }
View Full Code Here


   
    // end all executions and process instances in the scope of the transaction
    scopeExecution.destroyScope("cancel end event fired");
   
    // the scope execution executes the boundary event
    InterpretableExecution outgoingExecution = (InterpretableExecution)scopeExecution;
    outgoingExecution.setActivity(cancelBoundaryEvent);
    outgoingExecution.setActive(true);
   
    // execute the boundary
    cancelBoundaryEvent
      .getActivityBehavior()
      .execute(outgoingExecution);   
View Full Code Here

      Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
          ActivitiEventBuilder.createErrorEvent(ActivitiEventType.ACTIVITY_ERROR_RECEIVED, borderEventActivity.getId(), errorCode, leavingExecution.getId(), leavingExecution.getProcessInstanceId(), leavingExecution.getProcessDefinitionId()));
    }
   
    if(borderEventActivity.getActivityBehavior() instanceof EventSubProcessStartEventActivityBehavior) {
      InterpretableExecution execution = (InterpretableExecution) leavingExecution;
      execution.setActivity(borderEventActivity.getParentActivity());
      execution.performOperation(AtomicOperation.ACTIVITY_START); // make sure the listeners are invoked!
    }else {
      leavingExecution.executeActivity(borderEventActivity);
    }
  }
View Full Code Here

      } else {
       
        Object isForCompensation = execution.getActivity().getProperty(BpmnParse.PROPERTYNAME_IS_FOR_COMPENSATION);
        if(isForCompensation != null && (Boolean) isForCompensation) {
         
          InterpretableExecution parentExecution = (InterpretableExecution) execution.getParent();
          ((InterpretableExecution)execution).remove();
          parentExecution.signal("compensationDone", null);           
         
        } else {
         
          if (log.isDebugEnabled()) {
            log.debug("No outgoing sequence flow found for {}. Ending execution.", execution.getActivity().getId());
View Full Code Here

   
    if(initial == null) {
      throw new ActivitiException("Cannot start process instance, initial activity where the process instance should start is null.");
    }
   
    InterpretableExecution processInstance = newProcessInstance(initial);
    processInstance.setProcessDefinition(this);
    processInstance.setProcessInstance(processInstance);
    processInstance.initialize();

    InterpretableExecution scopeInstance = processInstance;
   
    List<ActivityImpl> initialActivityStack = getInitialActivityStack(initial);
   
    for (ActivityImpl initialActivity: initialActivityStack) {
      if (initialActivity.isScope()) {
        scopeInstance = (InterpretableExecution) scopeInstance.createExecution();
        scopeInstance.setActivity(initialActivity);
        if (initialActivity.isScope()) {
          scopeInstance.initialize();
        }
      }
    }
   
    scopeInstance.setActivity(initial);

    return processInstance;
  }
View Full Code Here

      } else {
       
        Object isForCompensation = execution.getActivity().getProperty(BpmnParse.PROPERTYNAME_IS_FOR_COMPENSATION);
        if(isForCompensation != null && (Boolean) isForCompensation) {
         
          InterpretableExecution parentExecution = (InterpretableExecution) execution.getParent();
          ((InterpretableExecution)execution).remove();
          parentExecution.signal("compensationDone", null);           
         
        } else {
         
          if (log.isLoggable(Level.FINE)) {
            log.fine("No outgoing sequence flow found for " + execution.getActivity().getId() + ". Ending execution.");
View Full Code Here

   
    if(initial == null) {
      throw new ActivitiException("Cannot start process instance, initial activity where the process instance should start is null.");
    }
   
    InterpretableExecution processInstance = newProcessInstance(initial);
    processInstance.setProcessDefinition(this);
    processInstance.setProcessInstance(processInstance);
    processInstance.initialize();

    InterpretableExecution scopeInstance = processInstance;
   
    List<ActivityImpl> initialActivityStack = getInitialActivityStack(initial);
   
    for (ActivityImpl initialActivity: initialActivityStack) {
      if (initialActivity.isScope()) {
        scopeInstance = (InterpretableExecution) scopeInstance.createExecution();
        scopeInstance.setActivity(initialActivity);
        if (initialActivity.isScope()) {
          scopeInstance.initialize();
        }
      }
    }
   
    scopeInstance.setActivity(initial);

    return processInstance;
  }
View Full Code Here

       
  }

  private static void executeEventHandler(ActivityImpl borderEventActivity, ActivityExecution leavingExecution) { 
    if(borderEventActivity.getActivityBehavior() instanceof EventSubProcessStartEventActivityBehavior) {
      InterpretableExecution execution = (InterpretableExecution) leavingExecution;
      execution.setActivity(borderEventActivity.getParentActivity());
      execution.performOperation(AtomicOperation.ACTIVITY_START); // make sure the listeners are invoked!
    }else {
      leavingExecution.executeActivity(borderEventActivity);
    }
  }
View Full Code Here

  }
 
  @Override
  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);
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.pvm.runtime.InterpretableExecution

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.