Add Elsa.CSharp project reference and enhance JavaScript usage
The Elsa.Samples.AspNet.MassTransitActivities.csproj file now includes a reference to Elsa.CSharp.csproj. Moreover, the use of JavaScript in the MassTransitActivities sample project has been improved. Clr access granting has been enabled and specific types have been registered to the engine options. Additionally, C# usage is now set, adding required assembly and namespaces.
This commit is contained in:
parent
c1201484b4
commit
39788fb8eb
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\bundles\Elsa\Elsa.csproj" />
|
||||
<ProjectReference Include="..\..\..\modules\Elsa.CSharp\Elsa.CSharp.csproj" />
|
||||
<ProjectReference Include="..\..\..\modules\Elsa.EntityFrameworkCore\Elsa.EntityFrameworkCore.csproj" />
|
||||
<ProjectReference Include="..\..\..\modules\Elsa.Http\Elsa.Http.csproj" />
|
||||
<ProjectReference Include="..\..\..\modules\Elsa.Identity\Elsa.Identity.csproj" />
|
||||
|
|
|
|||
|
|
@ -29,8 +29,25 @@ builder.Services.AddElsa(elsa =>
|
|||
// Add services for HTTP activities and workflow middleware.
|
||||
elsa.UseHttp();
|
||||
|
||||
// Use JavaScript and Liquid.
|
||||
elsa.UseJavaScript();
|
||||
// Use JavaScript.
|
||||
elsa.UseJavaScript(javaScript =>
|
||||
{
|
||||
javaScript.AllowClrAccess = true;
|
||||
javaScript.ConfigureEngine(options =>
|
||||
{
|
||||
options.RegisterType<OrderCompleted>();
|
||||
options.RegisterType<OrderCreated>();
|
||||
});
|
||||
});
|
||||
|
||||
// Use C#.
|
||||
elsa.UseCSharp(csharp =>
|
||||
{
|
||||
csharp.Assemblies.Add(typeof(OrderCreated).Assembly);
|
||||
csharp.Namespaces.Add(typeof(OrderCreated).Namespace!);
|
||||
});
|
||||
|
||||
// Use Liquid.
|
||||
elsa.UseLiquid();
|
||||
|
||||
// Configure identity so that we can create a default admin user.
|
||||
|
|
|
|||
Loading…
Reference in a new issue