public MigratingEventSubscriptionInstance(EventSubscriptionEntity eventSubscriptionEntity, ScopeImpl targetScope, bool updateEvent, EventSubscriptionDeclaration targetDeclaration) { this.eventSubscriptionEntity = eventSubscriptionEntity; this.targetScope = targetScope; this.updateEvent = updateEvent; this.targetDeclaration = targetDeclaration; }
protected internal virtual ActivityImpl getFlowScopeActivity(PvmActivity activity) { ScopeImpl flowScope = activity.FlowScope; ActivityImpl flowScopeActivity = null; if (flowScope.ProcessDefinition != flowScope) { flowScopeActivity = (ActivityImpl)flowScope; } return(flowScopeActivity); }
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); } }
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); }
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 + "'"); } } }
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"); } } }
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); } }
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(); } } }
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); } }
public override void parseParallelGateway(Element parallelGwElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public override void parseInclusiveGateway(Element inclusiveGwElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public override void parseBoundaryEvent(Element boundaryEventElement, ScopeImpl scopeElement, ActivityImpl activity) { addListeners(activity); }
public override void parseIntermediateCatchEvent(Element intermediateEventElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public override void parseTransaction(Element transactionElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
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); } }
public override void parseManualTask(Element manualTaskElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public override void parseCallActivity(Element callActivityElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
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; }
public override void parseEndEvent(Element endEventElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public MigratingIncident(IncidentEntity incident, ScopeImpl targetScope) { this.incident = incident; this.targetScope = targetScope; }
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; }
public override void parseScriptTask(Element scriptTaskElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public override void parseReceiveTask(Element receiveTaskElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public override void parseBusinessRuleTask(Element businessRuleTaskElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public override void parseEventBasedGateway(Element eventBasedGwElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public override void parseUserTask(Element userTaskElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
protected internal virtual bool isMultiInstance(ScopeImpl flowScope) { return(flowScope.ActivityBehavior is MultiInstanceActivityBehavior); }
public override void parseSubProcess(Element subProcessElement, ScopeImpl scope, ActivityImpl activity) { addListeners(activity); }
public virtual bool migratesTo(ScopeImpl other) { return(other == targetScope); }