Open Closed

Elsa Dashboard Integration error #1551


User avatar
0
viswajwalith created

ABP Framework version: v4.3 UI type: MVCDB provider: EF Core / MongoDB Tiered (MVC) or Identity Server Separated (Angular): yes , Microservice Architecture Exception message and stack trace:

Hi,

We are trying to integrate elsa dashboard, it worked perfectly in Application template, but when we try to integrate in microservice based ABP solution getting following error when accessing the elsa dashboard.


2 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Can you provider steps to reproduce?

  • User Avatar
    0
    viswajwalith created

    Hi,

    Somwhow we are able to get that issue fixed by changing the way of configuring the elsa. Thanks for the support.

        private void ConfigureElsa(ServiceConfigurationContext context, IConfiguration configuration)
        {
            context.Services
                .AddElsa(
                    elsa =>
                    {
                        elsa
                        .AddMongoDbStores(configuration, databaseName: "AppV3_Elsa", connectionStringName: "ElsaServiceMongoDb");
    
                    })
    
                .AddEmailActivities(options => options.Bind(configuration.GetSection("Elsa:Smtp")))
                .AddHttpActivities(options => options.Bind(configuration.GetSection("Elsa:Server")))
                .AddTimerActivities(options => options.Bind(configuration.GetSection("Elsa:Timers")));
                
            context.Services.AddElsaDashboard(options => options.Configure(x => x.ActivityDefinitions
                                                    .Add<WriteLine>()
                                                    .Add<ReadLine>()
                                                    .Add<ReceiveHttpRequest>()
                                                    .Add<SendHttpRequest>()
                                                    .Add<WriteHttpResponse>()
                                                    .Add<SetVariable>()
                                                    .Add<ForEach>()
                                                ));
    
            context.Services.AddUserActivities();
            context.Services.AddAssemblyOf<Elsa.Dashboard.Areas.Elsa.Controllers.HomeController>();
            context.Services.AddAssemblyOf<Elsa.WorkflowDesigner.ViewComponents.WorkflowDesignerViewComponent>();
            context.Services.AddAssemblyOf<Elsa.Dashboard.Areas.Elsa.Controllers.WorkflowDefinitionController>();
            context.Services.AddAssemblyOf<Elsa.Dashboard.Areas.Elsa.Controllers.WorkflowInstanceController>();
    
            context.Services.AddNotificationHandlers(typeof(LiquidConfigurationHandler));
            //Disable antiforgery validation for elsa
            Configure<AbpAntiForgeryOptions>(options =>
            {
                options.AutoValidateFilter = type =>
                    type.Assembly != typeof(Elsa.Dashboard.Areas.Elsa.Controllers.HomeController).Assembly;
                options.AutoValidateFilter = type =>
                    type.Assembly != typeof(Elsa.WorkflowDesigner.ViewComponents.WorkflowDesignerViewComponent).Assembly;
                options.AutoValidateFilter = type =>
                    type.Assembly != typeof(Elsa.Dashboard.Areas.Elsa.Controllers.WorkflowDefinitionController).Assembly;
                options.AutoValidateFilter = type =>
                    type.Assembly != typeof(Elsa.Dashboard.Areas.Elsa.Controllers.WorkflowInstanceController).Assembly;
            });
    
        }
        
    
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11