Msm.Workflow.Lib.Api.Controllers
1.2.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Msm.Workflow.Lib.Api.Controllers --version 1.2.0
NuGet\Install-Package Msm.Workflow.Lib.Api.Controllers -Version 1.2.0
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="Msm.Workflow.Lib.Api.Controllers" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Msm.Workflow.Lib.Api.Controllers" Version="1.2.0" />
<PackageReference Include="Msm.Workflow.Lib.Api.Controllers" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Msm.Workflow.Lib.Api.Controllers --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Msm.Workflow.Lib.Api.Controllers, 1.2.0"
#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.
#:package Msm.Workflow.Lib.Api.Controllers@1.2.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Msm.Workflow.Lib.Api.Controllers&version=1.2.0
#tool nuget:?package=Msm.Workflow.Lib.Api.Controllers&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Msm.Workflow.Lib.Api.Controllers
Pre-built REST API controllers cho MSM Workflow Engine - cung cấp CRUD endpoints sẵn có.
📦 Installation
<PackageReference Include="Msm.Workflow.Lib.Api.Controllers" Version="1.0.0" />
dotnet add package Msm.Workflow.Lib.Api.Controllers
📋 Overview
Package này cung cấp pre-built API controllers để tích hợp nhanh workflow engine vào ASP.NET Core application. Có thể sử dụng trực tiếp hoặc inherit để customize.
Contents
- WorkflowProcessesController: CRUD operations cho workflow processes
- WorkflowInstancesController: CRUD operations và workflow execution
- WorkflowTriggerController: Trigger workflow instances
- TenantsController: Multi-tenancy management
🎯 Usage
Register Controllers
using Msm.Workflow.Lib.Api.Controllers;
// In Program.cs or Startup.cs
services.AddWorkflowApiControllers();
Use Controllers Directly
Controllers sẽ tự động được map với routes:
GET /api/WorkflowProcesses- List all processesPOST /api/WorkflowProcesses- Create new processGET /api/WorkflowInstances/{id}- Get instance detailsPOST /api/WorkflowInstances/{id}/approve- Approve workflow itemPOST /api/WorkflowTrigger- Trigger new workflow instance
Inherit and Customize
[ApiController]
[Route("api/[controller]")]
public class MyWorkflowController : BaseWorkflowController
{
public MyWorkflowController(
IWorkflowProcessService processService,
IWorkflowInstanceService instanceService)
: base(processService, instanceService)
{
}
// Add custom endpoints
[HttpPost("custom-action")]
public async Task<IActionResult> CustomAction()
{
// Your custom logic
}
}
Example API Calls
# Create workflow process
POST /api/WorkflowProcesses
{
"name": "Purchase Order Approval",
"code": "PO_APPROVAL",
"objectType": "PURCHASE_ORDER"
}
# Trigger workflow instance
POST /api/WorkflowTrigger
{
"processCode": "PO_APPROVAL",
"objectId": "po-123",
"objectType": "PURCHASE_ORDER",
"submitterId": "user123"
}
# Approve workflow item
POST /api/WorkflowInstances/{instanceId}/approve
{
"itemId": "item-123",
"approverId": "user456",
"comment": "Approved"
}
🔗 Dependencies
Msm.Workflow.Lib.Application(required)Microsoft.AspNetCore.App(framework reference)
📚 Related Packages
Msm.Workflow.Lib.Application- Required dependencyMsm.Workflow.Lib.Infrastructure- Required for data accessMsm.Workflow.Lib.Domain- Required for domain entities
🔒 Multi-Tenancy
Controllers hỗ trợ multi-tenancy qua x-tenant header:
# Request với tenant header
curl -H "x-tenant: tenant1" \
-H "Content-Type: application/json" \
http://localhost:5000/api/WorkflowProcesses
📖 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Msm.Workflow.Lib.Application (>= 1.2.0)
-
net8.0
- Msm.Workflow.Lib.Application (>= 1.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.