Increase speed
This commit is contained in:
@@ -9,5 +9,6 @@
|
|||||||
<add key="Windows Package source" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages" />
|
<add key="Windows Package source" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages" />
|
||||||
<add key="Workflow package source" value="D:\NugetPackageRepository\WorkflowPackages" />
|
<add key="Workflow package source" value="D:\NugetPackageRepository\WorkflowPackages" />
|
||||||
<add key="Shared Package source" value="D:\NugetPackageRepository\SharedPackages" />
|
<add key="Shared Package source" value="D:\NugetPackageRepository\SharedPackages" />
|
||||||
|
<add key="San package source" value="D:\NugetPackageRepository\SanPackages" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -8,6 +8,9 @@ using San.MongoLogger;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Caspian.WorkflowFramework.Sample.Controllers;
|
namespace Caspian.WorkflowFramework.Sample.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("[controller]")]
|
||||||
public class WorkflowController : Controller, ILoggable
|
public class WorkflowController : Controller, ILoggable
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
@@ -26,7 +29,7 @@ public class WorkflowController : Controller, ILoggable
|
|||||||
|
|
||||||
#region Start
|
#region Start
|
||||||
[HttpPost("Start")]
|
[HttpPost("Start")]
|
||||||
public async Task<IActionResult> Start(CreateAndExecuteWorkflowModel input)
|
public async Task<IActionResult> Start([FromBody] CreateAndExecuteWorkflowModel input)
|
||||||
{
|
{
|
||||||
_logger.Log("Start of StartWorkflow action", JsonConvert.SerializeObject(input));
|
_logger.Log("Start of StartWorkflow action", JsonConvert.SerializeObject(input));
|
||||||
|
|
||||||
@@ -46,7 +49,7 @@ public class WorkflowController : Controller, ILoggable
|
|||||||
|
|
||||||
#region Do
|
#region Do
|
||||||
[HttpPost("Do")]
|
[HttpPost("Do")]
|
||||||
public async Task<IActionResult> Do(PublishEventModel input)
|
public async Task<IActionResult> Do([FromBody] PublishEventModel input)
|
||||||
{
|
{
|
||||||
_logger.Log("Start of Do action", WFInstanceId: input.WorkflowInstanceId, JsonConvert.SerializeObject(input));
|
_logger.Log("Start of Do action", WFInstanceId: input.WorkflowInstanceId, JsonConvert.SerializeObject(input));
|
||||||
|
|
||||||
@@ -61,7 +64,7 @@ public class WorkflowController : Controller, ILoggable
|
|||||||
|
|
||||||
#region GetState
|
#region GetState
|
||||||
[HttpPost("GetState")]
|
[HttpPost("GetState")]
|
||||||
public async Task<IActionResult> GetState(InquiryStateModel input)
|
public async Task<IActionResult> GetState([FromBody] InquiryStateModel input)
|
||||||
{
|
{
|
||||||
_logger.Log("Start of GetState action", WFInstanceId: input.WorkflowInstanceId, JsonConvert.SerializeObject(input));
|
_logger.Log("Start of GetState action", WFInstanceId: input.WorkflowInstanceId, JsonConvert.SerializeObject(input));
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
"reloadConfigOnChange": true
|
"reloadConfigOnChange": true
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Data Source=.;Initial Catalog=WfDb;User ID=sa;Password=123456;Integrated Security=false;TrustServerCertificate=True;"
|
//"DefaultConnection": "Data Source=.;Initial Catalog=WfDb;User ID=sa;Password=123456;Integrated Security=false;TrustServerCertificate=True;"
|
||||||
|
"DefaultConnection": "Server=.;Database=WfDb;User Id=sa;Password=123456;TrustServerCertificate=True;"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
|
||||||
@@ -17,5 +18,5 @@ public class PublishEventModel
|
|||||||
public string EventName { get; set; }
|
public string EventName { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string? EventData { get; set; }
|
public JsonElement EventData { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Dynamic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -14,12 +16,13 @@ using Elsa.Workflows.Management.Filters;
|
|||||||
using Elsa.Workflows.Models;
|
using Elsa.Workflows.Models;
|
||||||
using Elsa.Workflows.Runtime;
|
using Elsa.Workflows.Runtime;
|
||||||
using Elsa.Workflows.Runtime.Messages;
|
using Elsa.Workflows.Runtime.Messages;
|
||||||
|
using FastEndpoints;
|
||||||
using Microsoft.CodeAnalysis.Operations;
|
using Microsoft.CodeAnalysis.Operations;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using San.MongoLogger;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Diagnostics;
|
using Newtonsoft.Json.Converters;
|
||||||
|
using San.MongoLogger;
|
||||||
|
|
||||||
namespace Caspian.WorkflowFramework.Services;
|
namespace Caspian.WorkflowFramework.Services;
|
||||||
public class WorkflowService : IWorkflowService, ILoggable
|
public class WorkflowService : IWorkflowService, ILoggable
|
||||||
@@ -165,7 +168,18 @@ public class WorkflowService : IWorkflowService, ILoggable
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _eventPublisher.PublishAsync(input.EventName, null, input.WorkflowInstanceId, null, input.EventData);
|
var json = input.EventData.GetRawText();
|
||||||
|
|
||||||
|
var settings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
Converters = { new ExpandoObjectConverter() }
|
||||||
|
};
|
||||||
|
|
||||||
|
// تبدیل JSON به object داینامیک
|
||||||
|
dynamic payload = JsonConvert.DeserializeObject<ExpandoObject>(json, settings);
|
||||||
|
|
||||||
|
//await _eventPublisher.PublishAsync(input.EventName, null, input.WorkflowInstanceId, null, input.EventData, asynchronous: true);
|
||||||
|
await _eventPublisher.PublishAsync(input.EventName, null, input.WorkflowInstanceId, null, payload);
|
||||||
|
|
||||||
var variables = await _workflowInstanceVariableManager.GetVariablesAsync(input.WorkflowInstanceId);
|
var variables = await _workflowInstanceVariableManager.GetVariablesAsync(input.WorkflowInstanceId);
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"Sqlite": "", //"Data Source=App_Data/elsa.sqlite.db;Cache=Shared;",
|
"Sqlite": "", //"Data Source=App_Data/elsa.sqlite.db;Cache=Shared;",
|
||||||
//"SqlServer": "Server=localhost,1433;Initial Catalog=Elsa;User=sa;Password=!Elsa2025@;Encrypt=false;PersistSecurityInfo=false",
|
//"SqlServer": "Server=localhost,1433;Initial Catalog=Elsa;User=sa;Password=!Elsa2025@;Encrypt=false;PersistSecurityInfo=false",
|
||||||
"SqlServer": "Server=.;Database=WorkflowDb_3-5-0_2;User Id=sa;Password=123456;TrustServerCertificate=True;",
|
"SqlServer": "Server=.;Database=WfDb;User Id=sa;Password=123456;TrustServerCertificate=True;",
|
||||||
"MySql": "", //"Server=localhost;Database=elsa;Uid=admin;Pwd=password;",
|
"MySql": "", //"Server=localhost;Database=elsa;Uid=admin;Pwd=password;",
|
||||||
"PostgreSql": "", //"Server=localhost;Username=elsa;Database=elsa;Port=5432;Password=elsa;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60",
|
"PostgreSql": "", //"Server=localhost;Username=elsa;Database=elsa;Port=5432;Password=elsa;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60",
|
||||||
"Citus": "", //"Server=localhost;Username=citus;Database=citus;Port=9700;Password=citus;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60",
|
"Citus": "", //"Server=localhost;Username=citus;Database=citus;Port=9700;Password=citus;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60",
|
||||||
@@ -173,11 +173,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "Staging",
|
"Name": "Staging",
|
||||||
"ServerUrl": "https://staging.acme.com/elsa/api"
|
"ServerUrl": "https://localhost:5001/elsa/api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "Production",
|
"Name": "Production",
|
||||||
"ServerUrl": "https://production.acme.com/elsa/api"
|
"ServerUrl": "https://localhost:5001/elsa/api"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
"Sqlite": "", //"Data Source=elsa.sqlite.db;Cache=Shared;",
|
"Sqlite": "", //"Data Source=elsa.sqlite.db;Cache=Shared;",
|
||||||
"RabbitMq": "", //"rabbitmq://guest:guest@localhost:5672",
|
"RabbitMq": "", //"rabbitmq://guest:guest@localhost:5672",
|
||||||
"MySql": "", //"Server=localhost;Database=elsa;Uid=user;Pwd=password;",
|
"MySql": "", //"Server=localhost;Database=elsa;Uid=user;Pwd=password;",
|
||||||
"SqlServer": "Server=.;Database=WorkflowDb_3-5-0;User Id=sa;Password=123456;TrustServerCertificate=True;",
|
"SqlServer": "Server=.;Database=WfDb;User Id=sa;Password=123456;TrustServerCertificate=True;",
|
||||||
"PostgreSql": "" //"Server=localhost;Username=elsa;Database=elsa;Port=5432;Password=elsa;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60"
|
"PostgreSql": "" //"Server=localhost;Username=elsa;Database=elsa;Port=5432;Password=elsa;SSLMode=Prefer;MaxPoolSize=2000;Timeout=60"
|
||||||
},
|
},
|
||||||
"DatabaseProvider": "SqlServer", //"Sqlite",
|
"DatabaseProvider": "SqlServer", //"Sqlite",
|
||||||
|
|||||||
Reference in New Issue
Block a user