You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
....
builder.Services.AddElsa(elsa =>
{
var connString = ""Server=localhost\\SQLExpress;Database=elsa_engine;User=*****;Password=*****;TrustServerCertificate=True";
// Configure Management layer to use EF Core.
elsa.UseWorkflowManagement(management => management.UseEntityFrameworkCore(ef => ef.UseSqlServer(connString)));
// Configure Runtime layer to use EF Core.
elsa.UseWorkflowRuntime(runtime => runtime.UseEntityFrameworkCore(ef => ef.UseSqlServer(connString)));
.....
Then I have a simple Razor page that creates a workflow of given workflow definition id (created a dummy one with just a WriteLine activity):
public class IndexModel(ILogger<IndexModel> logger, IWorkflowRuntime wfRuntime,
IWorkflowDefinitionService wfDefinitionService) : PageModel
{
private readonly ILogger<IndexModel> _logger = logger;
public async void OnGet(string wfDefId)
{
var result = await wfRuntime.StartWorkflowAsync(wfDefId, pars);
Debug.WriteLine(result.WorkflowInstanceId);
}
}
On calling the wfRuntime.StartWorkflowAsync it throws an exception
'Cannot access a disposed object.
Object name: 'IServiceProvider'.'
Attachments:
Workflow JSON: it is not specific to a single workflow definition
Reproduction Rate: 100%
Additional Configuration:
When I use the default database SqlLite then all works as expected.
Expected Behavior
The workflow starts and an instance is created in DB.
Actual Behavior
The workflow does not start and the workflow instance is not created.
Screenshots
If possible, add screenshots or screen recordings to help explain the problem.
Environment
Elsa Package Version: Specify the version. If you've cloned the repo, mention if you are using the latest source code from the main branch.
Operating System: Include your OS version (e.g., Windows 10, macOS Big Sur, Ubuntu 18.04).
Browser and Version: If applicable, include your browser and version (e.g., Chrome 92).
Log Output
Include any relevant log output or error messages that might help diagnose the issue.
The text was updated successfully, but these errors were encountered:
Description
When starting a workflow from C# rather than from Elsa studio, I am getting a "" message on wfRuntime.StartWorkflowAsync(). See code snippet below.
Steps to Reproduce
I started with an example from https://v3.elsaworkflows.io/docs/installation/elsa-server
and added UseSqlServer option to the builder:
Then I have a simple Razor page that creates a workflow of given workflow definition id (created a dummy one with just a WriteLine activity):
On calling the wfRuntime.StartWorkflowAsync it throws an exception
'Cannot access a disposed object.
Object name: 'IServiceProvider'.'
Attachments:
Reproduction Rate: 100%
Additional Configuration:
When I use the default database SqlLite then all works as expected.
Expected Behavior
The workflow starts and an instance is created in DB.
Actual Behavior
The workflow does not start and the workflow instance is not created.
Screenshots
If possible, add screenshots or screen recordings to help explain the problem.
Environment
Log Output
Include any relevant log output or error messages that might help diagnose the issue.
The text was updated successfully, but these errors were encountered: