LMY.Workflow 1.0.1

dotnet add package LMY.Workflow --version 1.0.1
NuGet\Install-Package LMY.Workflow -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LMY.Workflow" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LMY.Workflow --version 1.0.1
#r "nuget: LMY.Workflow, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LMY.Workflow as a Cake Addin
#addin nuget:?package=LMY.Workflow&version=1.0.1

// Install LMY.Workflow as a Cake Tool
#tool nuget:?package=LMY.Workflow&version=1.0.1

lmy.workflow

LMY.workflow is a powerful workflow engine that simplifies simple and complex workflow problems.

LMY.workflow provides a simple and efficient way to develop workflows in your system.

Whether you are dealing with simple or complex workflows, LMY.workflow can handle it all.

it is built using .net 6

How To Use

1 - Include LMY.WorkFlow in your project.

2 - build your workflow configuration file (check workflow sample wf.config.json).

3 - add below to program.cs

builder.Services
.AddLMYWFEngineMSSQL()
.AddLMYWFEngine();

builder.UseLMYWFEngine(o =>
{
    o.WorkFlowsConfigFilePath = @"C:\wf.config.json";
    o.DBConnectionString = @"Server=.\SQLEXPRESS;Database=testdb;Integrated Security=SSPI;";
});

4 - once you have included the LMYEngine, you can now inject the ILMYWFEngine whenever you need it, making it available for use throughout your application

ILMYWFEngine lmyWFEngine;
public TestController(ILMYWFEngine _lmyWFEngine)
{
    lmyWFEngine= _lmyWFEngine;
}

5 - now you can start work flow like below

var result = lmyWFEngine.StartNew("LeaveRequestWF", "user1");
var LMYWFEngineRequestID = result.MethodResult;//started worklfow id

6 -you can get available transitions for specific workflow (you need to pass workflowid and current user groups )

var transitions =lmyWFEngine.GetAvailableTransitions("LeaveRequestWF", LMYWFEngineRequestID, "user1", new string[] { "DataEntry", "Leader" });

var LMYWFEngineRequestID = result.MethodResult;

7 - process taken transition

var moveNextResult = lmyWFEngine.MoveNext("LeaveRequestWF", LMYWFEngineRequestID, transitions.MethodResult[0].LMYWFEngineTransitionID, transitions.MethodResult[0].LMYWFEngineRequestVersionID, "user1", new string[] { "DataEntry", "Leader" }, true, "{you can include here whatever data you want}");

8 - you can get current user tasks (based on provided user groups)

int total = 0;

var tasks = lmyWFEngine.GetTasks("LeaveRequestWF", "user1", new string[] { "DataEntry", "Leader" }, 1, 10, out total);

0 - sample for a work flow drawing

{
  "WorkFlows": [
    {
      "WorkFlowName": "LeaveRequestWF",
      "Transitions": [
        {
          "UserGroups": [
            "DataEntry"
          ],
          "TransitionName": "Save As Draft",
          "CurrentStatuses": [
            null,
            "DataEntryDraft",
            "ReturnedFromLeader",
            "ReturnedByManagerToDataEntry"
          ],
          "NextStatus": "DataEntryDraft",
          "TransitionPageName": "SavePage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "DataEntry"
          ],
          "TransitionName": "Send To Leader",
          "CurrentStatuses": [
            null,
            "DataEntryDraft",
            "ReturnedFromLeader",
            "ReturnedByManagerToDataEntry"
          ],
          "NextStatus": "SentToLeader",
          "TransitionPageName": "SavePage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Leader"
          ],
          "TransitionName": "Return",
          "CurrentStatuses": [
            "SentToLeader",
            "LeaderDraft"
          ],
          "NextStatus": "ReturnedFromLeader",
          "TransitionPageName": "LeaderApprovalPage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Leader"
          ],
          "TransitionName": "Reject",
          "CurrentStatuses": [
            "SentToLeader",
            "LeaderDraft"
          ],
          "NextStatus": "RejectedByLeader",
          "TransitionPageName": "LeaderApprovalPage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Leader"
          ],
          "TransitionName": "Edit And Save",
          "CurrentStatuses": [
            "SentToLeader",
            "LeaderDraft",
            "ReturnedByManagerToLeader"
          ],
          "NextStatus": "LeaderDraft",
          "TransitionPageName": "LeaderApprovalPage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Leader"
          ],
          "TransitionName": "Approve",
          "CurrentStatuses": [
            "SentToLeader",
            "LeaderDraft",
            "ReturnedByManagerToLeader"
          ],
          "NextStatus": "SentToManager",
          "TransitionPageName": "LeaderApprovalPage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Manager"
          ],
          "TransitionName": "Edit And Save",
          "CurrentStatuses": [
            "SentToManager",
            "ManagerDraft"
          ],
          "NextStatus": "ManagerDraft",
          "TransitionPageName": "ManagerApprovalPage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Manager"
          ],
          "TransitionName": "Return To Leader",
          "CurrentStatuses": [
            "SentToManager",
            "ManagerDraft"
          ],
          "NextStatus": "ReturnedByManagerToLeader",
          "TransitionPageName": "ManagerApprovalPage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Manager"
          ],
          "TransitionName": "Return To Data Entry",
          "CurrentStatuses": [
            "SentToManager",
            "ManagerDraft"
          ],
          "NextStatus": "ReturnedByManagerToDataEntry",
          "TransitionPageName": "ManagerApprovalPage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Manager"
          ],
          "TransitionName": "Reject",
          "CurrentStatuses": [
            "SentToManager",
            "ManagerDraft"
          ],
          "NextStatus": "RejectedByManager",
          "TransitionPageName": "ManagerApprovalPage",
          "TransitionCustomData": {}
        },
        {
          "UserGroups": [
            "Manager"
          ],
          "TransitionName": "Approve",
          "CurrentStatuses": [
            "SentToManager",
            "ManagerDraft"
          ],
          "NextStatus": "ApprovedByManager",
          "TransitionPageName": "ManagerApprovalPage",
          "TransitionCustomData": {}
        }
      ]
    }
  ]
}
 
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 141 6/14/2023
1.0.0 159 3/29/2023