All Versions
17
Latest Version
4.1
Avg Release Cycle
-
Latest Release
-

Changelog History
Page 1

  • v4.1

    • πŸ‘Œ Support for multi-tenant applications.

      • TenantId has been added to processes. When creating a process, one can specify TenantId and use its value when working with the process. TenantId is stored in the WorkflowProcessInstance table in the TenantId column. Passing TenantId to a process:
      var createInstanceParams = new CreateInstanceParams(schemeCode, processId) { TenantId = "tenantId" };
      workflowRuntime.CreateInstance(createInstanceParams);
      

      After creating a process with TenantId indicated, the access to it inside Actions, Conditions and Rules can be arranged as follows.

      string tenantId = processInstance.TenantId;
      
      • For schemes one can specify tags, and then, search for schemes where these tags are indicated. Tags are set in the scheme designer by clicking on the Process Info button. Tags are stored in the WorkflowScheme table in the Tags column. A list of codes for the schemes where the corresponding tags are indicated can be received using the following code:
       List<string> schemeCodes =  workflowRuntime.Builder.SearchSchemesByTags(new List<string> {"Tag1","Tag2"});
      

    The search is performed using an OR expression.

    • πŸ”Œ Plugin System and the Basic Plugin. The plugin for WorkflowEngine.NET is a class that is necessary to implement the IWorkflowPlugin interface, and optional to implement the IWorkflowActionProvider, IWorkflowRuleProvider, IDesignerParameterFormatProvider, IDesignerAutocompleteProvider interfaces (in any combination). In fact, the plugin is a class that adds functionality to be used when creating process schemes. The plugin connects to WorkflowEngine.NET when configuring WorkflowRuntime.
      WorkflowRuntime workflowRuntime = workflowRuntime.WithPlugin(new BasicPlugin());
    

    Simultaneously, any number of plugins can be connected to WorkflowEngine.NET. The Basic Plugin OptimaJet.Workflow.Core.Plugins.BasicPlugin has been added to the WorkflowEngine.NET package; it implements the following basic functions:

    • Actions:
      • SendEmail - sending email.
      • CreateProcess - creating a process from a process.
      • HTTPRequest - sending a request to a third-party web service.
      • SetParameter - setting a process parameter.
    • Conditions:
      • IsProcessFinalized - checking the finalization of the current process or a process with the Id specified.
      • CheckAllSubprocessesCompleted - checking the finalization (completion) of all the subprocesses.
      • CheckParameter - checking if the parameter is consistent to the given value (so far, only strings are supported).
      • IsArrovedByUsers - checking if the specified process was processed by all of the listed users.
      • IsArrovedByRoles - checking if the specified process was processed by all of the listed roles.
      • CheckHTTPRequest - conditional transition based on the result of a request to a third-party web service.
    • Authorization Rules (Security):

      • CheckRole - checking access to the command for a specific role. Warning: to perform operations related to the roles checking, BasicPlugin must have the delegate handler basicPlugin.UsersInRoleAsync installed.
      • Now, implicit (that is, not explicitly specified in the scheme) parameters passed when creating a process, executing a command, or setting a new state to a process can be persistent.
    • When creating a process, use the following code:

      var createInstanceParams = new CreateInstanceParams(schemeCode, processId)
        .AddPersistentParameter("Parameter1Name", 100)
        .AddPersistentParameter("ParameterName2", parameterValue);
      workflowRuntime.CreateInstance(createInstanceParams);
      
    • When passing parameters with a command, use the following code:

      WorkflowCommand command = ...
      command.SetParameter("ParameterName", parameterValue, persist: true);
      workflowRuntime.ExecuteCommand(command, ... );
      
    • When passing a parameter with a command, use the following code:

      var setStateParams = new SetStateParams(processId,"StateName")
        .AddPersistentParameter("Parameter1Name", 100)
        .AddPersistentParameter("ParameterName2", parameterValue);
      workflowRuntime.SetState(setStateParams);
      
      • πŸ‘Œ Support for dynamic parameters has been added. To perform the task, the DynamicParameter class, which can be cast into dynamic, has been developed. For example:

    Creating a parameter:

      var dynamicParameter = new
      {
        Name = "Dynamic",
        ObjectValue = new
        {
            Name = "Object",
            Value = 100
        },
        ListValue = new List<object> {
            new {Id = 1, Name = "ObjectInList1"},
            new {Id = 2, Name = "ObjectInList2"}
        }
      }
      processInstance.SetParameter("Dynamic", dynamicParameter, ParameterPurpose.Persistence);
    

    Getting a parameter:

      var dynamicParameter = processInstance.GetParameter<DynamicParameter>("Dynamic") as dynamic;
      string name = dynamicParameter.Name;
      string objectValueName = dynamicParameter.ObjectValue.Name;
      string firstItemName = (dynamicParameter.ListValue as List<dynamic>).First().Name;
    
    • The following aggregating providers are available: AggregatingActionProvider, AggregatingRuleProvider, AggregatingDesignerAutocompleteProvider, AggregatingDesignerParameterFormatProvider. An aggregating provider is a provider to which other providers can be added.
    • πŸ”’ IWorkflowRuleProvider - supports asynchronous authorization (security) rules.
    • The scheme code is passed to all methods of all providers. Here are these methods
      • IWorkflowActionProvider.GetActions
      • IWorkflowActionProvider.GetConditions
      • IWorkflowActionProvider.IsActionAsync
      • IWorkflowActionProvider.IsConditionAsync
      • IWorkflowRuleProvider.GetRules
      • IWorkflowRuleProvider.IsCheckAsync
      • IWorkflowRuleProvider.IsGetIdentitiesAsync
      • IDesignerParameterFormatProvider.GetFormat
      • IDesignerAutocompleteProvider.GetAutocompleteSuggestions

    string schemeCode has been added as the last parameter to all these methods.

    • A unified and correct error output when accessing the Designer API has been added.
    • Intellisense has been added in the Code Actions (code in schemes) editor.
    • A new type TextArea has been added to the forms where parameter (for Actions, Conditions or rules) values are edited.
    • In any of the persistence providers, one can optionally turn off the history of transitions and set the history of subprocesses to be written in the history of the main process. For example:
      var provider = new MSSQLProvider(connectionString, writeToHistory:false);
      var provider = new MSSQLProvider(connectionString, writeSubProcessToRoot:true);
    

    ⬆️ The following additional actions must be taken to upgrade to Workflow Engine 4.1:

    • Run the SQL script update_2_7_to_2_8.sql for all relative databases.
    • ⚑️ Update all files related to the Designer. They are available here.
    • ⚑️ Update packages or dll to version 4.1.
    • If the IWorkflowActionProvider interface is implemented in your project, the last parameterstring schemeCode shall be added to the following methods:
      • IWorkflowActionProvider.GetActions
      • IWorkflowActionProvider.GetConditions
      • IWorkflowActionProvider.IsActionAsync
      • IWorkflowActionProvider.IsConditionAsync
    • If the IWorkflowRuleProvider interface is implemented in your project, the following methods shall be added to your provider:
      public Task<bool> CheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName,string parameter, CancellationToken token)
      {
          throw new NotImplementedException();
      }
    
      public Task<IEnumerable<string>> GetIdentitiesAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter, CancellationToken token)
      {
          throw new NotImplementedException();
      }
    
      public bool IsCheckAsync(string ruleName, string schemeCode)
      {
          return false;
      }
    
      public bool IsGetIdentitiesAsync(string ruleName, string schemeCode)
      {
          return false;
      }
    

    The last parameter string schemeCode shall be also added to the following method:

    • IWorkflowRuleProvider.GetRules

      • If the IDesignerParameterFormatProvider interface is implemented in your project, the last parameter string schemeCode shall be added to the following method:
    • IDesignerParameterFormatProvider.GetFormat

      • If the IDesignerAutocompleteProvider interface is implemented in your project, the last parameter string schemeCode shall be added to the following method:
    • IDesignerAutocompleteProvider.GetAutocompleteSuggestions

      • πŸ”€ IMPORTANT! Incorrect behavior was fixed when the subprocess was merged in the parent process via the set state of the parent process mechanism. Previously, the parent process parameters were OVERWRITTEN. Now, the parent process parameters won't be changed. Only new parameters from the subprocess will be written to the parent process automatically. The same way the merge via calculating conditions always works. If you consciously exploited this behavior, then the best way to get parameters from the subprocess is to use a property processInstance.MergedSubprocessParameters when merge occurs.
      • IMPORTANT! If in your project the Action Provider has changed (after the first initialization) using the method workflowRuntime.WithActionProvider(...) replace this code with the following call workflowRuntime.ClearActionProvider().WithActionProvider(...)
      • IMPORTANT! If in your project the Rule Provider has changed (after the first initialization) using the method workflowRuntime.WithRuleProvider(...) replace this code with the following call workflowRuntime.ClearRuleProvider().WithRuleProvider(...)
      • IMPORTANT! If in your project the Designer Autocomplete Provider has changed (after the first initialization) using the method workflowRuntime.WithDesignerAutocompleteProvider(...) replace this code with the following call workflowRuntime.ClearDesignerAutocompleteProvider().WithDesignerAutocompleteProvider(...)
      • IMPORTANT! If in your project the Designer Parameter Format Provider has changed (after the first initialization) using the method workflowRuntime.WithDesignerParameterFormatProvider(...) replace this code with the following call workflowRuntime.ClearDesignerParameterFormatProvider().WithDesignerParameterFormatProvider(...)
      • It is not necessary but suggested to change the Designer Controller the following way
      public ActionResult API()
      {
        ...
        var res = WorkflowInit.Runtime.DesignerAPI(pars, out bool hasError, filestream, true);
        var operation = pars["operation"].ToLower();
    
        if (operation == "downloadscheme" && !hasError)
          return File(Encoding.UTF8.GetBytes(res), "text/xml", "scheme.xml");
        else if (operation == "downloadschemebpmn" &&  !hasError)
          return File(UTF8Encoding.UTF8.GetBytes(res), "text/xml", "scheme.bpmn");
    
        return Content(res);
      }
    

    See complete controller code

      wfdesigner.create(schemecode);
    

    See complete view code

  • v4.0

    • Designer usability improvement. Transition info will now be displayed in a fuller, more comprehensive form. You can now switch between full screen and normal edit window display modes. Toolbars design has been changed.
    • you can customize Activity ΠΈ Transition rendering in the Designer.
    • 🏁 you can customize Designer windows.
    • 🐎 Designer performance has been optimized.
    • πŸ‘ Scheme inlining. Now you can check a scheme as a scheme that can be inlined and embed it into another scheme. Thus you can re-use typical parts of your processes many times, without copying them between schemes. Multi-layered inlining is supported.
    • πŸ–¨ Process Info window has been added into the specific process view mode. It allows you to view this process parameters, transition history, launched timers. Here full information on subprocesses is also displayed.
    • You can specify annotations for Activity and Transition. Annotations are a dictionary (key - value) which you can set in the Designer individually for each Activity ot Transition. You can read annotation value in the code, using the following methods: activityDefinition.GetAnnotation<T>(name), transitionDefinition.GetAnnotation<T>(name), processInstance.ProcessScheme.GetActivityAnnotation<T>(activityName, name), processInstance.ProcessScheme.GetTransitionAnnotation<T>(transitionName, name)
    • πŸ”§ For the string parameter, which is transferred into Actions, Conditions and Rules, you can specify the structure which will define the form in which this parameter will be displayed in edit mode in the Designer. Form field contents can be specified in the Designer in the CodeActions section. Or you can create a class implementing IDesignerParameterFormatProvider interface on the server and configure your WorkflowRuntime in the following way: workflowRuntime.WithDesignerParameterFormatProvider(new YourDesignerParameterFormatProvider()). Thus you can specify the appearance of the string parameter which is transferred into Action, Condition or Rule.
    • πŸ‘» In the event handler workflowRuntime.OnWorkflowError you can now cancel exception throwing, using event arguments args.SuppressThrow = true;. Also you can specify the Activity, which will be set after error processing. For example, it can be initial activity: args.ActivityToSet = args.ProcessInstance.ProcessScheme.InitialActivity;
    • For simple execution of complex business cases in WorkflowRuntime use two of the following methods: workflowRuntime.GetAvailableCommandsWithConditionCheck(...) - get the list of available commands with additional conditions check, and workflowRuntime.ExecuteCommandWithRestrictionCheck(...) - execution of the command with additional restrictions check.
    • πŸ”€ Correct merging of the subprocess ΠΈ parent process has been added, when a subprocess is merged with its parent process immediately after launch. In other words, if a subprocess contains only Auto triggered transitions. Now merge will be correct, and the subprocess will wait till the parent process is unlocked.
    • πŸ”§ Process execution can be cancelled using CancellationToken. Such cancellation will be activated automatically if you configure your WorkflowRuntime in the following way: workflowRuntime.SetCancellationTokenHandling(CancellationTokenHandling.Throw).

    ⬆️ The following additional actions must be taken to upgrade to Workflow Engine 4.0:

    • Run the SQL script update_4_0.sql for all relative databases. You will find this script in your provider's archive.
    • πŸš€ If you have used process status change (for example args.ProcessStatus = ProcessStatus.Idled;) to cancel exception release after the event has been processed workflowRuntime.OnWorkflowError, you will need to use the following code args.SuppressThrow = true;. Status change hack won't work, custom status will be installed, but the exception will still be thrown.
  • v3.5

    • 🚚 Moving the canvas (in the Move mode) with arrows was added to the designer.
    • Explicit passing of CultureInfo was added to methods GetInitialCommands, GetInitialState, GetCurrentState and GetAvailableCommands of the WorkflowRuntime class
    • 🌐 Full samples (Vacation request approval) for all supported databases for ASP.NET Core and ASP.NET MVC. Full samples for MSSQL, Postgres and Oracle database for Web Forms.
  • v3.4

    • βž• Added automatic size increase for background in designer.
    • βž• Added designer localization files for German, French, Spanish, Italian, Portuguese, Turkish, and Russian languages.
    • πŸ“¦ .NET Core NuGet packages come with .NET Standard 1.6 and .NET Standard 2.0 libraries. This allows you to use these packages with any .NET Core version, including 2.1.
    • 0️⃣ The OptimaJet.Workflow.Core.Logging.ILogger interface was added; it can be initializes with your own logger in the WorkflowRuntime object. It is used to integrate with the Workflow Server logging system, but you can use it to integrate with your own system. Bear in mind that the logger in the WorkflowRuntime object is not initialized by anything by default.
  • v3.3

    • MongoDB provider for Workflow Engine .NET Core was added.
    • ⚑️ MongoDB driver was updated to version 2.7. You can now connect to CosmosDB through a MongoDB connection.
    • The following hotkeys were added to the Workflow Designer:
      • Ctrl + A - Select all
      • Ctrl + C - Copy selected items
      • Ctrl + E - New Activity
      • Ctrl + I - Extended info
      • Ctrl + Y - Redo
      • Ctrl + Z - Undo
      • Arrows - Move selected items
      • Delete - Delete
      • Alt + Enter - Full-screen mode
      • Ctrl + M - Move mode

    ⬆️ The following additional actions must be taken to upgrade to Workflow Engine 3.3 if you are using MongoDB:

    • ⚑️ Only for MongoDB users: it is necessary to apply the update_3_2_to_3_3.js script to your database.
  • v3.2

    • βž• Added providers for MySQL and Oracle, running under .NET Core
    • βž• Added class AggregatingRuleProvider, designed to combine several IWorkflowRuleProvider into one IWorkflowRuleProvider.
    • βž• Added class AggregatingActionProvider, designed to combine several IWorkflowActionProvider into one IWorkflowActionProvider.
  • v3.1

    • ⚑️ Workflow Engine's relational database storage system has been optimized. Additional indices have been built; obsolete indices have been removed; the size of some columns has been changed. Generally, these changes should result in the improvement of Workflow Engine's performance, especially for Microsoft SQL Server. All these changes have already been included into installation scripts; use the update_3_1.sql script to update the existing databases.
    • BulkCreateInstance now works for Microsoft SQL Server and .NET Core (version >= 2).

    ⚠ Warning

    ⚑️ The update_3_1.sql script contains a change of index and size of certain columns. Be particularly careful when applying it to the production database.

  • v3.0

    • The interface of Workflow Designer has been revamped to improve usability
      • The look and feel of the scheme has been changed
      • The library that renders popup windows and controls has been changed from jQuery UI to Semantic-UI. jQuery UI has been removed from the project completely. Autocomplete for lists has been implemented with jQuery-autoComplete
      • The Konva.js version has been updated to 2.0.2
      • The 'Extended Info' mode has been added to provide additional information needed when creating a workflow scheme
      • Undo and redo have been added
      • Current activity of subprocesses is now highlighted
      • Global CodeActions have been simplified
      • Scheme legend has been added
    • πŸ— Builds for .NET Core 2.0 and .NET Standard 2.0 have been included to .NET Core packages
    • 0️⃣ The order of search for Action, Condition and Rule in Code Actions and IWorkflowActionProvider(IWorkflowRuleProvider) has been changed. Earlier on, the order was as follows (highest to lowest priority): Global CodeAction, CodeAction in the scheme, IWorkflowActionProvider(IWorkflowRuleProvider). Now this order is the following by default: CodeAction in the scheme, Global CodeAction, IWorkflowActionProvider(IWorkflowRuleProvider). Thus, CodeAction in the scheme has the highest priority. Search priority can be set with the runtime.SetExecutionSearchOrder(ExecutionSearchOrder order) setting.
    • πŸ— Parameter type names used to be stored as an assembly qualified name (by specifying the version of the build and the public key token), which resulted in troubles when migrating schemes from the .NET Framework environment to the .NET Core environment. Now a simplified type name - the one that is displayed in Designer - is stored in the scheme. Old schemes are loaded without changes; type names will be replaced after the first save of the scheme in the Designer.
    • πŸ›  Errors that occur when there's a '-' in CodeAction names have been fixed.

    The following additional actions must be taken to uprgade to Workflow Engine 3.0:

    • ⚑️ It is not necessary to update to the new version of the Designer; however, we strongly advise it. The old version of the Designer shall work with the new versions of the Workflow Engine at least within the next half a year. If you are updating to the new version of the Designer, introduce the following changes to the pages where Designer is displayed.
      • Delete links to jquery-ui.min.css and jquery-ui.js `html <link href="/Content/themes/base/jquery-ui.min.css" rel="stylesheet" type="text/css"/> <script src="/Scripts/jquery-ui.js" type="text/javascript"/>
      • Add links to semantic.min.css, semantic.min.js, jquery.auto-complete.min.js html <link href="/Content/semantic.min.css" rel="stylesheet" type="text/css"/> <script src="/Scripts/semantic.min.js" type="text/javascript"/> <script src="/Scripts/jquery.auto-complete.min.js" type="text/javascript"/> `
    • If the new order of search for Action, Condition and Rule does not suit you, change it with the following setting:
    runtime = runtime.SetExecutionSearchOrder(ExecutionSearchOrder.GlobalLocalProvider);
    

    Then, everything shall work the same way it did in the previous versions.

    • πŸ‘» Workflow Engine's reaction to the scenario where it could not find an Action, Condition or Rule in CodeActions or IWorkflowActionProvider(IWorkflowRuleProvider) has been changed. Earlier on, Workflow Engine ignored this scenario which made it difficult to debug schemes. Now, the NotImplementedException exception is thrown, specifying the name of the object which was not found. If this behavior does not suit you, use the following setting:
    runtime = runtime.SetIgnoreMissingExecutionItems(true);
    
  • v2.3

    • A 'Refresh' button and its functionality have been added to Designer
    • A 'Full Screen' button and its functionality have been added to Designer
    • 🐎 BulkCreateInstance and TimerManager performance has been enhanced
    • Scroll-based scaling has been added to Designer
  • v2.2

    • Now it is possible to create asynchronous Actions and Conditions. You can call asynchronous methods from Actions and Conditions using the await keyword. Such methods will be the most effective if you use asynchronous methods of the WorkflowRuntime object, for example, ExecuteCommandAsync instead of ExecuteCommand, or SetStateAsync instead of SetState, etc. You can create asynchronous Actions in Designer. To do that you simply need to check the Async checkbox in the Action or Condition where you're going to call asynchronous methods from. If you use IWorkflowActionProvider, then you will need to implement 4 additional methods. bool IsActionAsync(string name) and bool IsConditionAsync(string name) should return true so that the Action or Condition are called asynchronously. The execution of an asynchronous Action or Condition is done in the Task ExecuteActionAsync(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter, CancellationToken token) and Task<bool> ExecuteConditionAsync(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter, CancellationToken token) methods.
    • Parameters conveyed to the process with the command no longer need to be described as command parameters. IΠ° such a parameter is described in the scheme, it will be a Temporary or a Persistence one, depending on which Purpose is specified in the scheme. If the parameter is not described in the scheme, it will be a Temporary one.
    • The ExecuteCommand and ExecuteCommandAsync methods return information on whether the command has been executed (it may not be executed under certain conditions) and the ProcessInstance state after the execution of a command.

    The following additional actions must be taken to uprgade to Workflow Engine 2.2:

    • If you use IWorkflowActionProvider, you will need to add 4 new methods to it: IsActionAsync, IsConditionAsync, ExecuteActionAsync, ExecuteConditionAsync. If you do not yet intend to use asynchronous Actions, then the IsActionAsync and IsConditionAsync methods should always return false, whereas ExecuteActionAsync and ExecuteConditionAsync can throw a NotImplementedException.
    public bool IsActionAsync(string name)
    {
        return false;
    }
    
    public bool IsConditionAsync(string name)
    {
        return false;
    }
    
    public async Task ExecuteActionAsync(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter, CancellationToken token)
    {
        throw new NotImplementedException();
    }
    
     public async Task<bool> ExecuteConditionAsync(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter, CancellationToken token)
    {
        throw new NotImplementedException();
    }