Example #1
0
        public IWorkflowEngine CreateWorkflowEngine()
        {
            var workflowStore         = _workflowStoreFactory.Create();
            var workflowEngineBuilder = new WorkflowEngineBuilder();

            workflowEngineBuilder
            .WithActivityFactory(_activityFactory)
            .WithEventHandlerFactory(_eventHandlerFactory)
            .WithDomainStore(_workflowDomainStore)
            .WithMessageTransportFactoryProvider(_workflowMessageTransportFactoryProvider)
            .WithWorkflowRuntimeConfigurationFactory(_workflowRuntimeConfigurationFactory)
            .WithWorkflowStore(workflowStore);
            return(new WorkflowEngine(workflowEngineBuilder));
        }
Example #2
0
        protected WorkflowEngineBuildResult BuildWorkflowEngine(bool mockWorkflowStore, bool nested, IActivity activity, ICodeEventHandler eventHandler)
        {
            var activityFactoryMock = BuildActivityFactory(activity);
            var eventHandlerFactory = BuildEventHandlerFactory(eventHandler);
            var domainStore         = BuildDomainStore(nested);
            var workflowStore       = BuildWorkflowStore(mockWorkflowStore, nested);
            var workflowMessageBus  = BuildWorkflowMessageTransportFactoryProvider();
            var workflowRuntimeConfigurationFactory = BuildWorkflowRuntimeConfigurationFactory();

            var workflowEngineBuilder = new WorkflowEngineBuilder();

            workflowEngineBuilder
            .WithActivityFactory(activityFactoryMock)
            .WithEventHandlerFactory(eventHandlerFactory)
            .WithDomainStore(domainStore)
            .WithMessageTransportFactoryProvider(workflowMessageBus)
            .WithWorkflowRuntimeConfigurationFactory(workflowRuntimeConfigurationFactory)
            .WithWorkflowStore(workflowStore);
            return(new WorkflowEngineBuildResult(workflowEngineBuilder, new WorkflowEngine(workflowEngineBuilder)));
        }