public async Task StartAsync(CancellationToken cancellationToken)
        {
            this.Logger.LogInformation($"Starting {nameof(BasicExampleHostedService)} service.");

            try
            {
                using (IServiceScope scope = this.ServiceScopeFactory.CreateScope())
                {
                    IWorkflowManagerFactory factory = scope.ServiceProvider.GetService <IWorkflowManagerFactory>();

                    this.Logger.LogInformation($"Retrieving work flow manager '{WellKnown.Workflow.SampleWorkflow}'.");
                    IWorkflowManager workflowManager = await factory.GetAsync(WellKnown.Workflow.SampleWorkflow);

                    this.Logger.LogInformation($"Executing work flow manager '{WellKnown.Workflow.SampleWorkflow}'.");
                    if (await workflowManager.ExecuteWorkflowAsync(new WorkflowContext()))
                    {
                        this.Logger.LogInformation("Work flow execution was successful.");
                        this.ExitCode = 0;
                    }
                    else
                    {
                        this.Logger.LogError("Work flow execution failed.");
                        this.ExitCode = 1;
                    }
                }
            }
            catch (Exception ex)
            {
                this.Logger.LogError(ex, $"Exception while executing work flow '{WellKnown.Workflow.SampleWorkflow}'.");
                this.ExitCode = 2;
            }
            finally
            {
                this.HostApplicationLifetime.StopApplication();
            }
        }