Package org.camunda.bpm.engine.impl.pvm.process

Examples of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl


  private boolean isParallelMultiInstance(ExecutionEntity execution) {
    if (isParallelMultiInstance == null) { // cache result
      if (eventScopeActivityId == null) {
        isParallelMultiInstance = false;
      } else {
        ActivityImpl activity = execution.getProcessDefinition().findActivity(eventScopeActivityId);
        isParallelMultiInstance = activity.getActivityBehavior() instanceof ParallelMultiInstanceBehavior;
      }
    }
    return isParallelMultiInstance;
  }
View Full Code Here


      throw new ProcessEngineException("Found event definition of unknown type: " + eventType);
    }

    eventSubscriptionEntity.setEventName(eventName);
    if (activityId != null) {
      ActivityImpl activity = execution.getProcessDefinition().findActivity(activityId);
      eventSubscriptionEntity.setActivity(activity);
    }

    eventSubscriptionEntity.insert();
    return eventSubscriptionEntity;
View Full Code Here

  @Override
  protected void eventNotificationsCompleted(PvmExecutionImpl execution) {

    super.eventNotificationsCompleted(execution);

    ActivityImpl activity = execution.getActivity();
    ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();

    ProcessInstanceStartContext processInstanceStartContext = execution.getProcessInstanceStartContext();
    if (processInstanceStartContext==null) {
      // The ProcessInstanceStartContext is set on the process instance / parent execution - grab it from there:
View Full Code Here

  }

  public void execute(PvmExecutionImpl execution) {
    ActivityBehavior activityBehavior = getActivityBehavior(execution);

    ActivityImpl activity = execution.getActivity();
    log.fine(execution+" executes "+activity+": "+activityBehavior.getClass().getName());

    try {
      activityBehavior.execute(execution);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new PvmException("couldn't execute activity <"+activity.getProperty("type")+" id=\""+activity.getId()+"\" ...>: "+e.getMessage(), e);
    }
  }
View Full Code Here

*
*/
public abstract class PvmAtomicOperationCancelScope implements PvmAtomicOperation {

  public void execute(PvmExecutionImpl execution) {
    ActivityImpl activity = getCancellingActivity(execution);

    // find scope execution:
    PvmExecutionImpl scopeExecution = execution.isScope() ? execution : execution.getParent();

    ScopeImpl scope = activity.getScope();
    if (scope != activity.getParent()) {

      if (activity.getParent() instanceof ActivityImpl) {
        ActivityImpl parent = (ActivityImpl) activity.getParent();

        if (parent.isScope()) {
          scopeExecution = scopeExecution.getParent();
        }
      }
    }

View Full Code Here

    execution.setCanceled(true);
    return super.eventNotificationsStarted(execution);
  }

  protected ScopeImpl getScope(PvmExecutionImpl execution) {
    ActivityImpl activity = execution.getActivity();

    if (activity!=null) {
      return activity;
    } else {
      PvmExecutionImpl parent = execution.getParent();
View Full Code Here

  @Override
  protected void eventNotificationsCompleted(PvmExecutionImpl execution) {

    super.eventNotificationsCompleted(execution);

    ActivityImpl activity = execution.getActivity();
    if ( (execution.isScope())
            && (activity!=null)
            && (!activity.isScope())
          )  {
      execution.setActivity(activity.getParentActivity());
      execution.performOperation(DELETE_CASCADE_FIRE_ACTIVITY_END);

    } else {
      if (execution.isScope()) {
        execution.destroy();
      }

      execution.remove();

      if (!execution.isDeleteRoot()) {
        PvmExecutionImpl parent = execution.getParent();
        if (parent!=null) {
          // set activity on parent in case the parent is an inactive scope execution and activity has been set to 'null'.
          if(parent.getActivity() == null && activity != null && activity.getParentActivity() != null) {
            parent.setActivity(activity.getParentActivity());
          }
          parent.performOperation(DELETE_CASCADE);
        }
      }
    }
View Full Code Here

  protected void eventNotificationsCompleted(PvmExecutionImpl execution) {

    super.eventNotificationsCompleted(execution);

    TransitionImpl transition = execution.getTransition();
    ActivityImpl destination;
    if(transition == null) { // this is null after async cont. -> transition is not stored in execution
      destination = execution.getActivity();
    } else {
      destination = transition.getDestination();
    }
    ActivityImpl activity = execution.getActivity();
    if (activity!=destination) {
      ActivityImpl nextScope = PvmAtomicOperationTransitionNotifyListenerTake.findNextScope(activity, destination);
      execution.setActivity(nextScope);
      execution.performOperation(TRANSITION_CREATE_SCOPE);
    } else {
      execution.setTransition(null);
      execution.setActivity(destination);
View Full Code Here

    // hack around execution tree structure not being in sync with activity instance concept:
    // if we end a scope activity, take remembered activity instance from parent and set on
    // execution before calling END listeners.
    PvmExecutionImpl parent = execution.getParent();
    ActivityImpl activity = execution.getActivity();
    if (parent != null && execution.isScope() &&
        activity != null && activity.isScope() &&
        (activity.getActivityBehavior() instanceof CompositeActivityBehavior)) {

      if(log.isLoggable(Level.FINE)) {
        log.fine("[LEAVE] "+ execution + ": "+execution.getActivityInstanceId() );
      }
View Full Code Here

    return createSubProcessInstance(processDefinition, businessKey, caseInstanceId);
  }

  @SuppressWarnings("unchecked")
  public ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId) {
    ActivityImpl initial = (ActivityImpl) processDefinition.getInitial();
    ExecutionEntity subProcessInstance = newExecution(initial);
    subProcessInstance.setActivity(initial);

    shouldQueryForSubprocessInstance = true;
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl

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.