public ControlOperationInvoker(OperationDescription description, ServiceEndpoint endpoint, CorrelationKeyCalculator correlationKeyCalculator, IOperationInvoker innerInvoker, ServiceHostBase host)
        {
            this.host            = (WorkflowServiceHost)host;
            this.instanceManager = this.host.DurableInstanceManager;
            this.operationName   = description.Name;
            this.isOneWay        = description.IsOneWay;
            this.endpoint        = endpoint;
            this.innerInvoker    = innerInvoker;
            this.keyCalculator   = correlationKeyCalculator;
            this.persistTimeout  = this.host.PersistTimeout;
            if (description.DeclaringContract == WorkflowControlEndpoint.WorkflowControlServiceContract)
            {
                this.isControlOperation = true;
                switch (this.operationName)
                {
                case "Cancel":
                case "TransactedCancel":
                case "Run":
                case "TransactedRun":
                case "Unsuspend":
                case "TransactedUnsuspend":
                    this.inputParameterCount = 1;
                    return;

                case "Abandon":
                case "Suspend":
                case "TransactedSuspend":
                case "Terminate":
                case "TransactedTerminate":
                    this.inputParameterCount = 2;
                    return;
                }
                throw Fx.AssertAndThrow("Unreachable code");
            }
            if (endpoint is WorkflowHostingEndpoint)
            {
                this.CanCreateInstance = true;
            }
            else
            {
                this.bufferedReceiveManager = this.host.Extensions.Find <System.ServiceModel.Activities.Dispatcher.BufferedReceiveManager>();
            }
        }
Ejemplo n.º 2
0
        void InitializeFromConstructor(WorkflowService serviceDefinition, params Uri[] baseAddresses)
        {
            // first initialize some values to their defaults
            this.idleTimeToPersist        = WorkflowIdleBehavior.defaultTimeToPersist;
            this.idleTimeToUnload         = WorkflowIdleBehavior.defaultTimeToUnload;
            this.unhandledExceptionAction = WorkflowUnhandledExceptionBehavior.defaultAction;
            this.workflowExtensions       = new WorkflowServiceHostExtensions();

            // If the AppSettings.DefaultAutomaticInstanceKeyDisassociation is specified and is true, create a DisassociateInstanceKeysExtension, set its
            // AutomaticDisassociationEnabled property to true, and add it to the extensions collection so that System.Activities.BookmarkScopeHandle will
            // unregister its BookmarkScope, which will cause key disassociation. KB2669774.
            if (AppSettings.DefaultAutomaticInstanceKeyDisassociation)
            {
                DisassociateInstanceKeysExtension extension = new DisassociateInstanceKeysExtension();
                extension.AutomaticDisassociationEnabled = true;
                this.workflowExtensions.Add(extension);
            }

            if (TD.CreateWorkflowServiceHostStartIsEnabled())
            {
                TD.CreateWorkflowServiceHostStart();
            }
            if (serviceDefinition != null)
            {
                this.workflowDefinitionProvider = new WorkflowDefinitionProvider(serviceDefinition, this);
                InitializeDescription(serviceDefinition, new UriSchemeKeyedCollection(baseAddresses));
            }
            this.durableInstanceManager = new DurableInstanceManager(this);

            if (TD.CreateWorkflowServiceHostStopIsEnabled())
            {
                TD.CreateWorkflowServiceHostStop();
            }

            this.workflowServiceHostPerformanceCounters = new WorkflowServiceHostPerformanceCounters(this);
        }
Ejemplo n.º 3
0
 internal DurableInstancingOptions(DurableInstanceManager instanceManager)
 {
     this.instanceManager = instanceManager;
 }