diff --git a/doc/wiki/bpmn-workflows.md b/doc/wiki/bpmn-workflows.md index 15e6a2fcd..4fee8e06c 100644 --- a/doc/wiki/bpmn-workflows.md +++ b/doc/wiki/bpmn-workflows.md @@ -11,13 +11,29 @@ Elsa supports running BPMN 2.0 processes as first-class workflow activities. Two ```csharp // Execution support only (use when you build BpmnProcess in code). -elsa.AddBpmn(); +elsa.UseBpmn(); // Execution + XML interchange (use when importing .bpmn files). -elsa.AddBpmnInterchange(); +elsa.UseBpmnInterchange(); ``` -`BpmnInterchangeFeature` depends on `BpmnFeature`; calling `AddBpmnInterchange()` pulls in both. +`BpmnInterchangeFeature` depends on `BpmnFeature`; calling `UseBpmnInterchange()` pulls in both. + +### Trying it + +The sample host `src/apps/Elsa.Server.Web` has BPMN interchange enabled (`.UseBpmnInterchange()` in its `Program.cs`), so it can be used to try the analyze endpoint against a real server. If you have not already trusted the local ASP.NET Core development certificate, run `dotnet dev-certs https --trust` once, otherwise the `curl` calls below will fail TLS verification. Sign in with one of the development users (e.g. `admin`/`password`, see `appsettings.Development.json`) to obtain a bearer token, then call the endpoint: + +```bash +TOKEN=$(curl -s -X POST https://localhost:5001/elsa/api/identity/login \ + -H "Content-Type: application/json" \ + -d '{"username":"admin","password":"password"}' | jq -r .accessToken) + +curl -s -X POST https://localhost:5001/elsa/api/bpmn/analyze \ + -H "Authorization: Bearer $TOKEN" \ + -F "file=@test/integration/Elsa.Bpmn.Interchange.IntegrationTests/Assets/camunda-order-process.bpmn" +``` + +This returns a JSON body of process ids, element counts, and findings (e.g. informational notes about unbound service tasks or retained vendor extensions). ## BpmnProcess Activity diff --git a/src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj b/src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj index ba9dce4c4..0781af803 100644 --- a/src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj +++ b/src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj @@ -1,6 +1,7 @@ + diff --git a/src/apps/Elsa.Server.Web/Program.cs b/src/apps/Elsa.Server.Web/Program.cs index 8336e96d5..eccc813b0 100644 --- a/src/apps/Elsa.Server.Web/Program.cs +++ b/src/apps/Elsa.Server.Web/Program.cs @@ -100,6 +100,7 @@ services .UseFluentStorageProvider() .UseElsaScriptBlobStorage() .UseScheduling() + .UseBpmnInterchange() .UseCSharp(options => { configuration.GetSection("Scripting:CSharp").Bind(options);