All Versions
25
Latest Version
Avg Release Cycle
-
Latest Release
-

Changelog History
Page 1

  • v5.2.2

  • v5.2.1

  • v5.2

  • v5.1 Changes

    Designer

    • πŸ‘Œ Improved designer’s usability.
    • βž• Added creation of commands from the transition’s edit form.
    • It is possible to customize displayed activities and transitions, their templates are located in the templates/elements folder and are .svg files that can be changed.
    • It became possible to choose a color for displaying activity and transition.
    • For custom activities added on the server, it is now possible to specify the template for the edit form and .svg to be displayed on graph.
    • A new type of activity Decision has been added to the elements panel – it is used for convenience and to improve the visual perception of processes with conditional branches. It allows you to make a branch with one condition.
    • A new type of activity Decision Table has been added to the elements panel – it is used for convenience and to improve the visual perception of processes with conditional branches. It allows you to make a branch with any number of conditions.
    • The design of editing usings in Code Actions has been changed.

    πŸ”Œ Plugins

    • πŸ”Œ Extended the functionality of the Approval Plugin, now it fully allows you to implement the functionality of Inbox, Outbox, and the history of document changes. All examples implement this functionality using the Approval Plugin.
    • Methods for manipulating Inbox, Outbox and the history of document changes are added to Persistence Providers. The history of document changes, Inbox and Outbox are only filled when Approved Plugin is connected.
    • πŸ”Œ The ability to register Actors predefined on the server is added in the Basic Plugin. The basicPlugin.WithActors method and two delegates: basicPlugin.CheckPredefinedActorAsync and basicPlugin.GetPredefinedIdentitiesAsync are used for this.
    • πŸ”Œ You can now specify a delegate to update the status(state) of the document - basicPlugin.UpdateDocumentStateAsync in the Basic Plugin.
    • βœ‚ A DeleteSubprocesses action is added to the Basic Plugin, this action deletes all subprocesses.
    • πŸ”Œ Added the ability to customize HTTP requests headers in the Basic Plugin’s CheckHTTPRequest and HTTPRequest methods.
    • πŸ”Œ The ability to specify a username and password for all the methods that make HTTP requests has been added to the Basic Plugin.
    • πŸ”Œ The ability to download files by HTTP has been added to the File Plugin.
    • It is now possible to specify the ID of the created process in the CreateProcess method in the Basic Plugin.

    Core

    • You can now set common usings for all Code Actions of the scheme, at the same time you can configure usings individually for each Code Action. This makes usings managing easier.
    • πŸ“¦ Added process log. The sequence of actions that occurs during the execution of the process is now added to a process log. The log can be enabled for all processes created for a specific scheme or for a specific process. Attention: The Workflow Engine package includes a logger that stores the log in the memory. This is enough for debugging processes but if you want to make the log persistent, you have to implement the IProcessLogProvider and connect it to the Workflow Runtime by calling the runtime.WithProcessLogger(…) method.
    • GetProcessInstancesAsync(...) and GetSchemesAsync(...) methods that accept sorting and paging are added to the Persistence Provider. With their help you can access the list of schemes and processes.
    • The Activity in Expert mode in the Designer now has the ability to set the Execution Timeout, meaning it limits the execution time of all Actions of this Activity. Attention: This timeout with only work for asynchronous Actions that process the Cancellation Token passed to them. The timeout value is the same as the interval timer value. Possible reactions to timeout: Set Activity, Set State, Retry.
    • The Activity in Expert mode in the Designer now has the ability to set Idle Timeout, meaning it limits the time a process can be in this Activity without doing anything (i.e. Idled or Finalized status of the process). The timeout value is the same as the interval timer value. Possible reactions to timeout: Set Activity, Set State.
    • The Activity in Expert mode in the Designer now has the ability to set Error handling by listing the names of the exceptions that need to be handled. Possible reactions to the exception: Set Activity, Set State, Retry, Ignore.
    • The Activity in Expert mode in the Designer now has the ability to disable saving process state. This setting is called Disable persist.
    • πŸ–¨ Process Instance is passed to the HasExternalParameter,IsGetExternalParameterAsync, IsSetExternalParameterAsync of IWorkflowExternalParametersProvider methods.
    • Two time-stamps were added to Process Instance: CreationDate – date and time of process creation and LastTransitionDate – date and time of the last change of the process state.
    • StartTransitionTime – date and time of the beginning of the transition and TransitionDuration – the duration of the transition in milliseconds - were added to the Process Transition History.
    • An additional parameter NamesSearchType.All or NamesSearchType.NotExcluded is passed in the IWorkflowActionProvider.GetActions,IWorkflowActionProvider.GetConditions and IWorkflowRuleProvider.GetRules methods, this allows adding Actions, Conditions or Rules that are not seen the Designer but that are executed in the process.
  • v5.1._update Changes

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

    • ⚑️ Warning. If using Redis, please, contact our support for update instructions.
    • Run the SQL script update_5_0_to_5_1 for all relative databases and MongoDB.
    • Update all files related to the Designer. They are available here. Be mindful, that thΡƒ elements subfolder must be added to the templates folder.
    • If you are using Action or Rule Providers in the IWorkflowActionProvider.GetActions,IWorkflowActionProvider.GetConditions and IWorkflowRuleProvider.GetRules methods add the last NamesSearchType namesSearchType parameter. You don't need to change the code of these methods.
    • If you are using External Parameters Provider in the HasExternalParameter, IsGetExternalParameterAsync and IsSetExternalParameterAsync methods add the last ProcessInstance processInstance parameter. You don't need to change the code of these methods.
  • v5.0 Changes

    Designer

    • 🏁 Designer windows have been reworked to behave as non-modal which allows:
      • to keep them open while working with a scheme.
      • to open multiple windows, change their size and behavior.
    • 🏁 Customization of Designer windows is now simplified; each window is represented by a Vue.js template which can be now altered independently from the rest of the Designer.
    • Customization of Designer toolbars simplified.
    • A Designer library of typical schemes added which represent most frequently used blocks which can be dragged onto your schemas.
    • A library of custom activities added; these are single action activities whose settings are adjustable within the form.
    • 0️⃣ Forms to edit properties of activities and transitions now have two viewing modes - Default and Expert. The Default mode represents only the essential and most used settings, while the Expert mode combines all the settings.

    Sub-processes

    • Sub-processes can now be launched in a separate thread to allow for physical parallelism at the scheme level.
    • Methods to copy parameters into a sub-process can now be carried out using the following options:
      • copy all parameters (default option, previously available)
      • not to copy parameters
      • only copy specified parameters
      • ignore specified parameters.
    • πŸ†• New feature to specify a method to transfer sub-process parameters on to its parent process when merging. The following options are available:
      • transfer only the parameters absent in the parent process (default option, previously available)
      • transfer all parameters
      • only copy indicated parameters
      • ignore indicated parameters.
    • πŸ†• New feature to cleary indicate whether a particular transition starts a sub-process or finalizes it; previously identified automatically, the transition can be now obviously set.
    • πŸ†• New feature to specify a sub-process name which can be represented as a simple string or a calculated expression; expressions can consume parameters (this is syntactically similar to conditional expressions). In this way, new sub-processes can be created simply by changing paramater values used when a sub-process name is generated. As an example, consider creating an invoice approval scheme where the invoice will contain several product items. It is now possible to design a scheme in which approval of the items will be represented by a sub-process. Furthermore, by combining loops (in the plugin) and sub-process naming calculations a sub-process for each product item can be created.
    • πŸ†• New feature to specify a sub-process id, or calculate it based on the parameters; herein, substitutions are used - not expressions.

    Persistence Providers

    • All persistence providers are implemented as completely asynchronous. As a result, the WFE core operates in a completely asynchronous fashion suitable for scalability.
    • .NET Core provider for MsSql utilizes Microsoft.Data.SqlClient instead of System.Data.SqlClient.

    Workflow Runtime

    • Method Resume is added to API Workflow Runtime. Contrary to the SetSatate method, it does not execute a current activity, or a set one, but rather attempts to continue execution of the process. This method can be used to go on with a process execution after a failure, or in the case of changes in external conditions.
    • Restorer Restore Decision Resume added.
    • πŸ†• New in the ProcessInstance class:
      • Indexer for getting and setting paramater values
      • Methods to manipulate root process parameters from within a sub-process.
      • For all standard events, now exist their asynchronous counterparts.

    πŸ”Œ Plugins

    • πŸ“¦ FTP ΠΈ SFTP support added to the File Plugin. Attention. File Plugin is supplied as a seperate Nuget package/dll
    • πŸ”Œ New plugin, Loops Plugin, added for simple implementation of the for and foreach.
    • πŸ”Œ Within the action BasicPlugin.HttpRequest you can specify the name of the paramater which is to hold the result.
    • πŸ”Œ Within the action BasicPlugin.SetParameter, and the BasicPlugin.CheckParameter condition, you can set and verify the root process' paramaters.
    • πŸ”Œ Many new conditions added to BasicPlugin.CheckParameter ΠΈ BasicPlugin.CheckHTTPRequest.
    • πŸ†• New plugins added for interaction with Slack, Telegram, Twilio, Nexmo are provided as Nuget packages (dlls).
  • v5.0._update Changes

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

    • ⚑️ Warning. If using Redis, please, contact our support for update instructions.
    • Run the SQL script update_4_2_to_5_0 for all relative databases and MongoDB.
    • ⚑️ Update all files related to the Designer. They are available here.
    • Be mindful, that these files must be linked to the designer page:
      • workflowdesigner.min.css
      • workflowdesigner.min.js
      • jquery

    All the other javascript libraries previously required, do not need a separate attachement for they are now compiled inside workflowdesigner.min.js.

    • Pay attention to the new way of initializating a WorkflowDesigner object instance.
      wfdesigner = new WorkflowDesigner({
        name: 'simpledesigner',
        apiurl: '/Designer/API',
        renderTo: 'wfdesigner',
        templatefolder: '/templates/',
        graphwidth: graphwidth,
        graphheight: graphheight
      });
    
    • Indicating the path to the images folder is no longer required and the folder can be deleted.
    • Yet, the path to the templates folder must be specified as it contains templates for all the forms and the library of schemes.
    • It is advised to reimplement WorkflowDesigner initializations, as is shown here.

      • If you are using .NET Framework you may need to use Request.Unvalidated[key] instead of context.Request.Form[key] in the DesignerConroller.cs.
      • Attention. Event handlers OnSchemaWasChanged and OnSchemaWasChangedAsync are now initialized inside a locked process. That is, prior to releasing the Running status. The code, as described in the documentation will continue to work as expected without need to change it. Yet, if SetActivityWithoutExecution[Async] or SetActivityWithExecution[Async] are called in these handlers, it should be done using this flag doNotSetRunningStatus = true. In turn, if you utilized methods ExecuteCommand, SetSatate and similar, be aware that there methods which lock the process. Therefore, is might be best to use methods: SetActivityWithoutExecution[Async] or SetActivityWithExecution[Async]. If you have implemented a complicated logic for updating schemes which leads to a failed attempt at updating you WFE version because of this change, reach us at [email protected] and we'll help you.
  • v4.2 Changes

    • πŸ‘Œ Support for the timers in multi-server mode has been added. You can configure WorkflowRuntime to work in a single or multi-server environment. This affects the timers and the recovering from failure. You can configure the runtime with the following code:
      _runtime = new WorkflowRuntime()
        ...
        .AsSingleServer() //.AsMultiServer()
       .Start();
    

    WARNING. AsMultiServer () - works for Ultimate licenses only.

    • βš™ If an abnormal server shutdown has occurred, then part of the processes may remain frozen in the Running status. This status will be changed by the automatic recovery procedure; one of the two statuses - either Error or Terminated - will be set. You can also change the recovery procedure using Process Restorer. For example, as follows:
      public class ProcessRestorer : IProcessRestorer
      {
        ...
      }
      runtime.WithProcessRestorer(new ProcessRestorer())
    

    Please, note that Process Restorer is only used in a case of server shutdown. For the workflow errors, use the OnWorkflowError event handler.

    • The runtime.Shutdown() and runtime.ShutdownAsync() methods has been added. These methods provide the correct shutdown of the WorkflowRuntime. Using this method is very important for a multi-server environment.
    • The approach to the workflow execution has been changed. Now, the process is executed using a run loop. Therefore, you can create an endless workflow. One iteration of the loop is equivalent to one Activity. By default, the maximum number of iterations is limited by Int64.MaxValue. However, you can change it as follows:
      _runtime.WithRuntimeSettings(new WorkflowRuntimeSettings()
      {
        MaxNumberOfPerformedActivities = -1 //Infinite loop allowed
      });
    
    • Now, you can safely change the workflow state from the workflow itself during its operation. Use the following code:
      processInstance.SetActivityAfterActionExecution("ActivityName");
      processInstance.SetActivityAfterActivityExecution("ActivityName");
      processInstance.SetStateAfterActionExecution("StateName");
      processInstance.SetStateAfterActivityExecution("StateName");
    
    • If the complex object is stored in the process parameters, you can receive and set its properties on the fly, using partial parameters:
      processInstance.GetParameter<T>("ObjectParameter.Object.Value");
    
    • A new type of Expressions has been added. This is a simple expression that returns true or false. You can use them instead of Conditions. Here, you can use the process parameters values, as well as string formatting of these parameters. The syntax of these expressions is as follows:
      @ObjectParameter.BooleanProperty and @IntParameter <> 1"
    

    Here the 'ObjectParameter.BooleanProperty' and 'IntParameter' are Process parameters.

    • The parameters values ​​can be substituted into the values ​​of the Actions, Conditions, or Rules. The syntax is similar to the expressions:
      {
         JsonObject = "@ObjectParameter:json",
         Int = "@IntParameter:json",
         IntString = "@IntParameter",
         Guid = "@GuidParameter:json",
         GuidString = "@(GuidParameter:N)",
         DateTime = "@(DateTimeParameter:json)",
         DateTimeString = "Today is @(DateTimeParameter:dd-MM-yyyy HH:mm:ss)",
      }
    
    • You can connect the external parameter provider - IWorkflowExternalParametersProvider - to WorkflowRuntime. This allows you to access external data (for example, the document record which the process is linked to) as usual process parameters. It can be used in Expressions.

    • πŸ”Œ A plugin to work with files has been added - File Plugin.

    • πŸ”Œ A plugin to work with Inbox/Outbox has been added - Approval Plugin.

    • πŸ”Œ HTTPRequest and CheckHTTPRequest methods added by Basic Plugin can now send POST.

    • πŸ”Œ Methods to simplify work with parallel processes have been added to Basic Plugin.

    • In the Parameter edit forms you can use the Multiselect Dropdown.

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

    • ⚠ Warning. RavenDB provider is no longer supported.
    • ⚑️ Warning. If using Redis, please, contact our support for update instructions.
    • ⚠ Warning. If you are using MongoDB. The multi-server feature will work only with MongoDB version > 4.0
    • Run the SQL script update_4_1_to_4_2 for all relative databases and MongoDB.
    • ⚑️ Update all files related to the Designer. They are available here.
    • ⚑️ Update packages or dll to version 4.2. **If you connect the WFE with DLLs you must reference all DLLs from this archive in your solution.
    • βœ‚ Remove runtime.WithBus(...) call from your WorkflowRuntime configuration.
    • ⚠ At the point, where you configure WorkflowRuntime remove the .WithTimerManager (...) call. And add a call of .AsSingleServer() or .AsMultiServer(), depending on the mode you want to run the WorkflowRuntime. WARNING. AsMultiServer () - works for Ultimate licenses only.
    • πŸ”Œ The signature of the UsersInRoleAsync delegate for Basic Plugin has changed. The way, it was:
      public delegate Task<IEnumerable<string>> UsersInRoleAsyncDelegate(string roleName, Guid? processId = null);
    

    The way, it is now:

       public delegate Task<IEnumerable<string>> UsersInRoleAsyncDelegate(string roleName, ProcessInstance processInstance);
    
    • If you are using .Net Framework for your web application most likely you will must add the following lines in your web.config.
      <system.web>
        <compilation debug="true" targetFramework="4.5">
            <assemblies>
                <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
            </assemblies>
        </compilation>
        ...
      </system.web>
    
  • v4.1 Changes

    • πŸ‘Œ 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 Changes

    • 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:

    • ⚑️ Don't forget to update packages or dlls, and the Designer javascript, css and all designer related images.
    • 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.