Msm.Workflow.Lib.Application
1.9.2
dotnet add package Msm.Workflow.Lib.Application --version 1.9.2
NuGet\Install-Package Msm.Workflow.Lib.Application -Version 1.9.2
<PackageReference Include="Msm.Workflow.Lib.Application" Version="1.9.2" />
<PackageVersion Include="Msm.Workflow.Lib.Application" Version="1.9.2" />
<PackageReference Include="Msm.Workflow.Lib.Application" />
paket add Msm.Workflow.Lib.Application --version 1.9.2
#r "nuget: Msm.Workflow.Lib.Application, 1.9.2"
#:package Msm.Workflow.Lib.Application@1.9.2
#addin nuget:?package=Msm.Workflow.Lib.Application&version=1.9.2
#tool nuget:?package=Msm.Workflow.Lib.Application&version=1.9.2
Msm.Workflow.Lib.Application
Application layer cho MSM Workflow Engine - chứa business logic, services, DTOs, và interfaces.
📦 Installation
<PackageReference Include="Msm.Workflow.Lib.Application" Version="1.0.0" />
dotnet add package Msm.Workflow.Lib.Application
📋 Overview
Package này chứa business logic layer của workflow engine. Bao gồm services, DTOs, và các interfaces để customize workflow behavior.
Contents
- Services:
WorkflowProcessService- Quản lý workflow processesWorkflowInstanceService- Quản lý workflow instances và executionTenantService- Quản lý multi-tenancy
- DTOs: Data Transfer Objects cho API
- Interfaces:
IUserProvider- Customize user resolutionIApproverResolver- Customize approver resolutionICriteriaEvaluator- Customize criteria evaluationIWorkflowActionHandler- Customize action handlers
🎯 Usage
Register Services
using Msm.Workflow.Lib.Application;
// In Program.cs or Startup.cs
services.AddApplication();
Configure Custom Providers
services.AddApplication()
.ConfigureWorkflow(options =>
{
// Customize UserProvider
options.UseUserProvider<MyUserProvider>();
// Customize ApproverResolver
options.UseApproverResolver<MyApproverResolver>();
// Customize CriteriaEvaluator
options.UseCriteriaEvaluator<MyCriteriaEvaluator>();
});
Use Services
public class MyController : ControllerBase
{
private readonly IWorkflowProcessService _processService;
private readonly IWorkflowInstanceService _instanceService;
public MyController(
IWorkflowProcessService processService,
IWorkflowInstanceService instanceService)
{
_processService = processService;
_instanceService = instanceService;
}
[HttpPost("create-process")]
public async Task<IActionResult> CreateProcess(CreateWorkflowProcessDto dto)
{
var process = await _processService.CreateWorkflowProcessFromDtoAsync(dto);
return Ok(process);
}
[HttpPost("trigger")]
public async Task<IActionResult> TriggerWorkflow(Guid workflowProcessId, string objectId)
{
var instance = await _instanceService.SubmitWorkflowInstanceAsync(
workflowProcessId: workflowProcessId,
targetRecordId: objectId,
targetObjectType: "PURCHASE_ORDER",
submittedBy: "user123",
contextData: null
);
return Ok(instance);
}
}
Implement Custom Interfaces
// Custom UserProvider
public class MyUserProvider : IUserProvider
{
public Task<UserInfo?> GetUserAsync(string userId, CancellationToken cancellationToken = default)
{
// Your implementation
}
// ... other methods
}
// Custom Action Handler
using Msm.Workflow.Lib.Domain.Entities.Workflow;
public class MySmsHandler : IWorkflowActionHandler
{
public string ActionType => "SMS_ALERT";
public Task ExecuteAsync(
WorkflowInstance request,
WorkflowStepAction action,
CancellationToken cancellationToken = default)
{
// Your implementation
return Task.CompletedTask;
}
}
🔗 Dependencies
Msm.Workflow.Lib.Domain(required)Msm.Workflow.Lib.Infrastructure(required)Microsoft.Extensions.Hosting.Abstractions(10.0.1)
📚 Related Packages
Msm.Workflow.Lib.Domain- Required dependencyMsm.Workflow.Lib.Infrastructure- Required dependencyMsm.Workflow.Lib.Api.Controllers- Uses this package
📖 Documentation
For more information, see the main README.md and GETTING_STARTED.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AutoMapper (>= 16.1.1)
- FluentValidation (>= 11.11.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.11.0)
- MailKit (>= 4.7.1)
- MediatR (>= 12.4.1)
- Microsoft.EntityFrameworkCore (>= 8.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Msm.Workflow.Lib.Domain (>= 1.9.2)
- Msm.Workflow.Lib.Infrastructure (>= 1.9.2)
-
net8.0
- AutoMapper (>= 16.1.1)
- FluentValidation (>= 11.11.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.11.0)
- MailKit (>= 4.7.1)
- MediatR (>= 12.4.1)
- Microsoft.EntityFrameworkCore (>= 8.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Msm.Workflow.Lib.Domain (>= 1.9.2)
- Msm.Workflow.Lib.Infrastructure (>= 1.9.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Msm.Workflow.Lib.Application:
| Package | Downloads |
|---|---|
|
Msm.Workflow.Lib.Api.Controllers
Pre-built API controllers for MSM Workflow Engine. Includes CRUD endpoints for workflow processes, instances, and tasks. Can be used directly or inherited for customization. Requires Msm.Workflow.Lib.Application. |
GitHub repositories
This package is not used by any popular GitHub repositories.