Commit graph

6 commits

Author SHA1 Message Date
Robin Sue 237e476ed4
Cache CSharp scripts (#6130)
- Following the same scheme as the JavaScript engine does
- Also cleans up some duplication in the JavaScript engine
- Change Caching from AbsoluteExpiration to SlidingExpiration. Absolute expiration does not make sense here, as the cached value does not become stale. Instead, the goal is to only keep relevant data cached, for which the inactivity timeout of a sliding expiration is more suited.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-11-22 21:36:48 +01:00
Sipke Schoorstra 02f4dc9b8c
Add Variable Name Validation and Wrapper Control (#6117)
* Refactor directory structure and add variable wrappers option

Renamed TypeDefinitions/Providers to Providers for better clarity. Added a new configuration option to disable generating variable wrappers for scenarios requiring invalid JavaScript variable names.

* Add variable name validation and wrapper control

Introduced methods to validate variable names and filter invalid ones. Integrated `DisableWrappers` option to control the generation of variable wrappers, enhancing flexibility in variable management.

* Remove unused item group from project file

The item group containing the "TypeDefinitions\Providers\" folder was removed from the Elsa.JavaScript.csproj file. This folder was not serving any purpose and its removal helps in cleaning up the project structure.
2024-11-13 19:58:00 +01:00
Sipke Schoorstra cf3cab2fba Add non-generic variable accessor method
Added a non-generic version of the GetVariable method to the ExecutionContextProxy and GenerateWorkflowVariableAccessors classes in Elsa.CSharp module. Also, extended the CSharpOptions class to include additional namespaces and assemblies related to System.Text.Json. These adjustments provide a more flexible way to access workflow variables and extend the usability of JSON serialization within workflows.
2023-12-31 09:53:00 +01:00
Sipke Schoorstra 023ef267b5 Add System.Runtime to CSharpOptions
The System.Runtime assembly and namespace has been added to CSharpOptions. This extends the functionality capabilities within the Elsa.CSharp module by providing access to the Guid class and its related methods and properties.
2023-12-30 19:29:55 +01:00
Sipke Schoorstra 683f0ee6d8
Add Bulk Dispatch Workflow activity (#4683)
* Initial version of BulkDispatchWorkflow

* Update comments

* Refactor options models for running workflows and add Properties

* Fix resumption

* Add ability to provide arguments when evaluating expressions

* Update args syntax for JS

* Fix ProtoActor Runtime Properties mapping

* Use default constructor

* Provide completed workflow instance ID as input to BulkDispatchWorkflows

* Implement ChildFaulted port

* Switch to Publish to make Memory service bus work

* Update input evaluation and activity output retrieval

Refined the input evaluation process to only consider inputs with AutoEvaluate set to true. Added a comment to clarify the purpose of the GetActivitiesWithOutputs method. Removed the unnecessary check for AutoEvaluate from the EvaluateInputPropertyAsync method.
2023-12-06 22:32:08 +01:00
Sipke Schoorstra 5d1a1aaf86
Add C# expression support (#4594)
* Initial version of c# expressions

* Add support for strongly-typed workflow variable accessors

* Fix type casting

* Rename c# to C# in XML comments

* Rename Globals.Context to ExecutionContext and Variables to Context

* Move RunJavaScript activity to Elsa.JavaScript

* Add RunCSharp activity

* Add CSharpOptions

* Add common workflow properties and methods
2023-11-03 20:28:10 +01:00