Search in sources :

Example 6 with PvmScope

use of org.camunda.bpm.engine.impl.pvm.PvmScope in project camunda-bpm-platform by camunda.

the class DefaultHistoryEventProducer method initActivityInstanceEvent.

protected void initActivityInstanceEvent(HistoricActivityInstanceEventEntity evt, MigratingActivityInstance migratingActivityInstance, HistoryEventType eventType) {
    PvmScope eventSource = migratingActivityInstance.getTargetScope();
    String activityInstanceId = migratingActivityInstance.getActivityInstanceId();
    MigratingActivityInstance parentInstance = migratingActivityInstance.getParent();
    String parentActivityInstanceId = null;
    if (parentInstance != null) {
        parentActivityInstanceId = parentInstance.getActivityInstanceId();
    }
    ExecutionEntity execution = migratingActivityInstance.resolveRepresentativeExecution();
    initActivityInstanceEvent(evt, execution, eventSource, activityInstanceId, parentActivityInstanceId, eventType);
}
Also used : PvmScope(org.camunda.bpm.engine.impl.pvm.PvmScope) ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) CaseExecutionEntity(org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity) MigratingActivityInstance(org.camunda.bpm.engine.impl.migration.instance.MigratingActivityInstance)

Example 7 with PvmScope

use of org.camunda.bpm.engine.impl.pvm.PvmScope in project camunda-bpm-platform by camunda.

the class LegacyBehavior method isLegacyBehaviorRequired.

/**
 * This method
 * @param scopeExecution
 * @param isLegacyBehaviorTurnedOff
 * @return
 */
protected static boolean isLegacyBehaviorRequired(ActivityExecution scopeExecution) {
    // legacy behavior is turned off: the current activity was parsed as scope.
    // now we need to check whether a scope execution was correctly created for the
    // event subprocess.
    // first create the mapping:
    Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping = scopeExecution.createActivityExecutionMapping();
    // if the scope execution for the current activity is the same as for the parent scope
    // -> we need to perform legacy behavior
    PvmScope activity = scopeExecution.getActivity();
    if (!activity.isScope()) {
        activity = activity.getFlowScope();
    }
    return activityExecutionMapping.get(activity) == activityExecutionMapping.get(activity.getFlowScope());
}
Also used : PvmScope(org.camunda.bpm.engine.impl.pvm.PvmScope) ScopeImpl(org.camunda.bpm.engine.impl.pvm.process.ScopeImpl)

Aggregations

PvmScope (org.camunda.bpm.engine.impl.pvm.PvmScope)7 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)3 PvmActivity (org.camunda.bpm.engine.impl.pvm.PvmActivity)3 ScopeImpl (org.camunda.bpm.engine.impl.pvm.process.ScopeImpl)3 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 CaseExecutionEntity (org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity)2 PvmExecutionImpl (org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl)2 NotValidException (org.camunda.bpm.engine.exception.NotValidException)1 ActivityExecutionTreeMapping (org.camunda.bpm.engine.impl.ActivityExecutionTreeMapping)1 CoreModelElement (org.camunda.bpm.engine.impl.core.model.CoreModelElement)1 MigratingActivityInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingActivityInstance)1 ActivityBehavior (org.camunda.bpm.engine.impl.pvm.delegate.ActivityBehavior)1 ActivityExecution (org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution)1 CompositeActivityBehavior (org.camunda.bpm.engine.impl.pvm.delegate.CompositeActivityBehavior)1 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)1 ActivityStartBehavior (org.camunda.bpm.engine.impl.pvm.process.ActivityStartBehavior)1 ProcessDefinitionImpl (org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl)1 TransitionImpl (org.camunda.bpm.engine.impl.pvm.process.TransitionImpl)1 ActivityStackCollector (org.camunda.bpm.engine.impl.tree.ActivityStackCollector)1 FlowScopeWalker (org.camunda.bpm.engine.impl.tree.FlowScopeWalker)1