Exemple #1
0
 public MigratingEventSubscriptionInstance(EventSubscriptionEntity eventSubscriptionEntity, ScopeImpl targetScope, bool updateEvent, EventSubscriptionDeclaration targetDeclaration)
 {
     this.eventSubscriptionEntity = eventSubscriptionEntity;
     this.targetScope             = targetScope;
     this.updateEvent             = updateEvent;
     this.targetDeclaration       = targetDeclaration;
 }
Exemple #2
0
        protected internal virtual ActivityImpl getFlowScopeActivity(PvmActivity activity)
        {
            ScopeImpl    flowScope         = activity.FlowScope;
            ActivityImpl flowScopeActivity = null;

            if (flowScope.ProcessDefinition != flowScope)
            {
                flowScopeActivity = (ActivityImpl)flowScope;
            }
            return(flowScopeActivity);
        }
Exemple #3
0
        public static bool definesPersistentEventTrigger(ActivityImpl activity)
        {
            ScopeImpl eventScope = activity.EventScope;

            if (eventScope != null)
            {
                return(TimerDeclarationImpl.getDeclarationsForScope(eventScope).ContainsKey(activity.Id) || EventSubscriptionDeclaration.getDeclarationsForScope(eventScope).ContainsKey(activity.Id));
            }
            else
            {
                return(false);
            }
        }
Exemple #4
0
        public virtual void attachState(MigratingScopeInstance owningActivityInstance)
        {
            ExecutionEntity representativeExecution = owningActivityInstance.resolveRepresentativeExecution();
            ScopeImpl       currentScope            = owningActivityInstance.CurrentScope;

            ExecutionEntity newOwningExecution = representativeExecution;

            if (currentScope.Scope && isConcurrentLocalInParentScope)
            {
                newOwningExecution = representativeExecution.Parent;
            }

            newOwningExecution.addVariableInternal(variable);
        }
Exemple #5
0
        public virtual void validate(ValidatingMigrationInstruction instruction, ValidatingMigrationInstructions instructions, MigrationInstructionValidationReportImpl report)
        {
            ValidatingMigrationInstruction ancestorScopeInstruction = getClosestPreservedAncestorScopeMigrationInstruction(instruction, instructions);
            ScopeImpl targetScope = instruction.TargetActivity;

            if (ancestorScopeInstruction != null && targetScope != null && targetScope != targetScope.ProcessDefinition)
            {
                ScopeImpl parentInstanceTargetScope = ancestorScopeInstruction.TargetActivity;
                if (parentInstanceTargetScope != null && !parentInstanceTargetScope.isAncestorFlowScopeOf(targetScope))
                {
                    report.addFailure("The closest mapped ancestor '" + ancestorScopeInstruction.SourceActivity.Id + "' is mapped to scope '" + parentInstanceTargetScope.Id + "' which is not an ancestor of target scope '" + targetScope.Id + "'");
                }
            }
        }
Exemple #6
0
        public virtual void validate(MigratingActivityInstance migratingInstance, MigratingProcessInstance migratingProcessInstance, MigratingActivityInstanceValidationReportImpl instanceReport)
        {
            ScopeImpl sourceScope = migratingInstance.SourceScope;

            if (sourceScope != sourceScope.ProcessDefinition)
            {
                ActivityImpl sourceActivity = (ActivityImpl)migratingInstance.SourceScope;

                if (!SupportedActivityValidator.INSTANCE.isSupportedActivity(sourceActivity))
                {
                    instanceReport.addFailure("The type of the source activity is not supported for activity instance migration");
                }
            }
        }
Exemple #7
0
        protected internal virtual ValidatingMigrationInstruction getClosestPreservedAncestorScopeMigrationInstruction(ValidatingMigrationInstruction instruction, ValidatingMigrationInstructions instructions)
        {
            ScopeImpl parent = instruction.SourceActivity.FlowScope;

            while (parent != null && instructions.getInstructionsBySourceScope(parent).Count == 0)
            {
                parent = parent.FlowScope;
            }

            if (parent != null)
            {
                return(instructions.getInstructionsBySourceScope(parent)[0]);
            }
            else
            {
                return(null);
            }
        }
Exemple #8
0
        public static void handleChildRemovalInScope(ExecutionEntity removedExecution)
        {
            ActivityImpl activity = removedExecution.getActivity();

            if (activity == null)
            {
                if (removedExecution.getSuperExecution() != null)
                {
                    removedExecution = removedExecution.getSuperExecution();
                    activity         = removedExecution.getActivity();
                    if (activity == null)
                    {
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
            ScopeImpl flowScope = activity.FlowScope;

            PvmExecutionImpl scopeExecution         = removedExecution.getParentScopeExecution(false);
            PvmExecutionImpl executionInParentScope = removedExecution.Concurrent ? removedExecution : removedExecution.Parent;

            if (flowScope.ActivityBehavior != null && flowScope.ActivityBehavior is ModificationObserverBehavior)
            {
                // let child removal be handled by the scope itself
                ModificationObserverBehavior behavior = (ModificationObserverBehavior)flowScope.ActivityBehavior;
                behavior.destroyInnerInstance(executionInParentScope);
            }
            else
            {
                if (executionInParentScope.Concurrent)
                {
                    executionInParentScope.remove();
                    scopeExecution.tryPruneLastConcurrentChild();
                    scopeExecution.forceUpdate();
                }
            }
        }
Exemple #9
0
        public override void parseServiceTask(Element serviceTaskElement, ScopeImpl scope, ActivityImpl activity)
        {
            Element connectorDefinition = findCamundaExtensionElement(serviceTaskElement, "connector");

            if (connectorDefinition != null)
            {
                Element connectorIdElement = connectorDefinition.element("connectorId");

                string connectorId = null;
                if (connectorIdElement != null)
                {
                    connectorId = connectorIdElement.Text.Trim();
                }
                if (connectorIdElement == null || connectorId.Length == 0)
                {
                    throw new BpmnParseException("No 'id' defined for connector.", connectorDefinition);
                }

                IoMapping ioMapping = parseInputOutput(connectorDefinition);
                activity.ActivityBehavior = new ServiceTaskConnectorActivityBehavior(connectorId, ioMapping);
            }
        }
Exemple #10
0
 public override void parseParallelGateway(Element parallelGwElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #11
0
 public override void parseInclusiveGateway(Element inclusiveGwElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #12
0
 public override void parseBoundaryEvent(Element boundaryEventElement, ScopeImpl scopeElement, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #13
0
 public override void parseIntermediateCatchEvent(Element intermediateEventElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #14
0
 public override void parseTransaction(Element transactionElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #15
0
 protected internal virtual ScopeImpl determineTimerTriggerTargetScope(JobEntity jobEntity, ScopeImpl targetScope)
 {
     if (TimerStartEventSubprocessJobHandler.TYPE.Equals(jobEntity.JobHandlerType))
     {
         // for event subprocess start jobs, the job handler configuration references the subprocess while
         // the job references the start event
         return(targetScope.FlowScope);
     }
     else
     {
         return(targetScope);
     }
 }
Exemple #16
0
 public override void parseManualTask(Element manualTaskElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #17
0
 public override void parseCallActivity(Element callActivityElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #18
0
 public MigratingCompensationEventSubscriptionInstance(MigrationInstruction migrationInstruction, ScopeImpl sourceScope, ScopeImpl targetScope, EventSubscriptionEntity eventSubscription)
 {
     this.migrationInstruction = migrationInstruction;
     this.eventSubscription    = eventSubscription;
     this.sourceScope          = sourceScope;
     this.targetScope          = targetScope;
     this.currentScope         = sourceScope;
 }
Exemple #19
0
 public override void parseEndEvent(Element endEventElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #20
0
 public MigratingIncident(IncidentEntity incident, ScopeImpl targetScope)
 {
     this.incident    = incident;
     this.targetScope = targetScope;
 }
Exemple #21
0
 public MigratingTimerJobInstance(JobEntity jobEntity, JobDefinitionEntity jobDefinitionEntity, ScopeImpl targetScope, bool updateEvent, TimerDeclarationImpl targetTimerDeclaration) : base(jobEntity, jobDefinitionEntity, targetScope)
 {
     timerTriggerTargetScope   = determineTimerTriggerTargetScope(jobEntity, targetScope);
     this.updateEvent          = updateEvent;
     this.targetJobDeclaration = targetTimerDeclaration;
 }
Exemple #22
0
 public override void parseScriptTask(Element scriptTaskElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #23
0
 public override void parseReceiveTask(Element receiveTaskElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #24
0
 public override void parseBusinessRuleTask(Element businessRuleTaskElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #25
0
 public override void parseEventBasedGateway(Element eventBasedGwElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #26
0
 public override void parseUserTask(Element userTaskElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #27
0
 protected internal virtual bool isMultiInstance(ScopeImpl flowScope)
 {
     return(flowScope.ActivityBehavior is MultiInstanceActivityBehavior);
 }
Exemple #28
0
 public override void parseSubProcess(Element subProcessElement, ScopeImpl scope, ActivityImpl activity)
 {
     addListeners(activity);
 }
Exemple #29
0
 public virtual bool migratesTo(ScopeImpl other)
 {
     return(other == targetScope);
 }