Exemplo n.º 1
0
        public void Configure(IApplicationBuilder app)
        {
            var serverAddressesFeature = app.ServerFeatures.Get <IServerAddressesFeature>();

            app.UseStaticFiles();

            ApplicationComposer.Compose();
            var engineManager = ApplicationComposer.GetEngineManager();

            engineManager.Start();

            app.Run(async(context) =>
            {
                context.Response.ContentType = "text/html";
                await context.Response
                .WriteAsync("<!DOCTYPE html><html lang=\"en\"><head>" +
                            "<title></title></head><body><p>Hosted by Kestrel</p>");

                await context.Response.WriteAsync("<p>Workflow Engine Started.");

                if (serverAddressesFeature != null)
                {
                    await context.Response
                    .WriteAsync("<p>Listening on the following addresses: " +
                                string.Join(", ", serverAddressesFeature.Addresses) +
                                "</p>");
                }

                await context.Response.WriteAsync("<p>Request URL: " +
                                                  $"{context.Request.GetDisplayUrl()}<p>");

                await context.Response.WriteAsync("</body></html>");
            });
        }
Exemplo n.º 2
0
        public static void Initialize()
        {
            JsonConvert.DefaultSettings = () => new JsonSerializerSettings()
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            };
            ApplicationComposer.Container.Options.AllowOverridingRegistrations = true;
            ApplicationComposer.Container.Register <IWorkflowProcessStore, TestWorkflowProcessStore>();
            ApplicationComposer.Container.RegisterSingleton <IProcessItemEventStore, TestWorkflowProcessItemEventStore>();
            ApplicationComposer.Container.RegisterSingleton <IWorkflowEngineTaskQueue, TestWorkflowEngineTaskQueue>();
            ApplicationComposer.Container.RegisterSingleton <IWorkflowEngineEventQueue, TestWorkflowEngineEventQueue>();

            ApplicationComposer.Compose();
            ApplicationComposer.Container.RegisterSingleton <ILoggingAdapter, TestOutputLoggingAdapter>();
            ApplicationComposer.Container.RegisterSingleton <EventLogContainer>();
            var engineManager = ApplicationComposer.GetEngineManager();

            engineManager.Start();

            _container = ApplicationComposer.Container;
        }