๐๏ธ Cases
Owned, case management & back-office workflows.
A complete case management product the client deploys on their own infrastructure. Case types are the base unit: each one is a JSON Schema form, a set of checkpoints (the states a case moves through) and an Elsa workflow that decides who acts next. Customers submit cases from their own apps, back-office staff open cases on a customer's behalf, and both kinds run through the same assignment, edit, approval and notification pipeline โ with a strict split between what the customer sees and what stays internal.
- A deployed system, not a SaaS โ your databases, your workflows, your operations.
- Customer and back office on one record โ the
myAPI serves customers, themanageAPI serves staff; one case, two views.
๐ Where it fits
- Customer requests & applications โ forms customers submit from web or mobile apps (the
Externalchannel). - Staff-initiated cases โ branch or call-centre staff open a case on a customer's behalf (the
Managedchannel). - Approval-heavy processes โ assignment, maker-checker approval, rejection reasons, custom business actions.
- Regulated back offices โ every state change, data version and comment is a row; a PDF of the case is one call away.
- Any form-driven process โ a new process is a case type (schema + layout + checkpoints) plus a workflow, not a code change.
| ๐ The product | ๐ ๏ธ For developers |
|---|---|
| 1. Core features & capabilities | 4. Architecture & hosting |
| 2. Flows | 5. Feature internals & integration |
| 3. Where Cases shines | 6. Configuration |
1. Core features & capabilities
โก Case types โ the base unit
Every case belongs to a case type, and the case type carries everything that makes a process different from the next one.
CaseTypeโCode,Title,Description,Category,Order,Tags.DataSchemaโ a JSON Schema; case data is validated against it on the server (CasesJsonSchemaValidator).Layoutโ a JSON Forms UI schema that the back-office SPA (and your customer apps) render.- Translations โ
Translationsfor titles and descriptions,LayoutTranslationsfor the form, applied per request language (IJsonTranslationService). Configโ free-form JSON per case type, e.g.PdfOptions(portrait, digitally signed, QR code).CanCreateRolesโ which roles may open a case of this type;IsMenuItemโ the type gets its own list in the back-office menu, shaped byGridFilterConfig/GridColumnConfig.CheckpointTypesโ the states a case of this type goes through.
A case type is "this form, these states, this process". A new process is data plus a workflow definition published from the designer.
๐ Checkpoints & status
A case's history is its list of checkpoints; its status is whatever the current checkpoint says.
CheckpointTypeโCode(unique per case type), title, description, translations, aStatus(SubmittedยทInProgressยทCompletedยทDeleted) and aPrivateflag.Checkpointโ one row per transition, withCreatedBy,CompletedDateandDueDate.- Public vs private โ a private checkpoint is visible to the back office only; the customer keeps seeing the last
public one (
PublicCheckpointId). "Pending second approval" stays internal while the customer sees "In progress". - Completion โ moving to a
Completedcheckpoint stampsCompletedBy, publishes the latest data to the customer and clears the assignment.
๐๏ธ Cases, data & versions
CaseโOwner(ContactMeta: user id, reference such as a customer code, name, TIN),GroupId(branch or team),Priority(Urgent/Normal),Channel, aMetadatadictionary,Draftflag andReferenceNumber.- Draft โ submit โ a case starts as a draft; its data can be prefilled (
ICaseDataInitializer), edited and given attachments, then it is submitted and the workflow starts. - Data versions โ every edit writes a new
CaseDatarow;Datais the current version andPublicDatais the one the customer sees.publish-private-datareleases the current version on demand. - Reference numbers โ
ReferenceNumberEnableddraws numbers from a database sequence (case.ReferenceNumberSequence). - Channels โ
External(created through themyAPI),Managed(through themanageAPI), or any name up to 128 characters; legacyCustomer/Agentvalues count asExternal/Managed(next release). - Comments, attachments, timeline โ private or public comments with replies; attachments stored with the case;
a timeline that merges checkpoints and comments; related cases that share an
ExternalCorrelationKeymetadata value.
๐ Workflows โ Elsa 2
Each case type's process is an Elsa workflow, tagged with the case type's code and started when a case is submitted.
- Start on submit โ
CaseSubmittedEventstarts the published workflow definition whose tag list contains the case type code. - Blocking activities โ Await Assignment, Await Edit, Await Approval (
Approve/Rejectoutcomes) and Await Action (a custom button with label, style, optional input and success message). Each waits as an Elsa bookmark until a back-office user acts, and each can be limited to anAllowedRole. - Case activities โ Send Message (move to a checkpoint, update data, attach a file, comment), Assign case to user, Remove assignment, Get case details, Get channel, Notify customer (bilingual EN/EL text over SMS/Viber).
- Approval activities โ Auto approve, Block previous approver (four-eyes), Remove previous approval, Reject reasons, Get rejected reason.
- HTTP Endpoint with validation โ external systems call into a running workflow with a schema-validated payload.
- Elsa built-ins โ timers (Quartz), HTTP, email (SMTP), user tasks, JavaScript/Liquid expressions, and your own
activities from
GetWorkflowAssembly. - Designer โ the Elsa 2 visual designer at
/workflow; operators edit and publish workflows without a redeploy.
The case engine never hard-codes a process. It knows checkpoints, data and actions; the workflow decides which checkpoint comes next and who may act.
๐ฑ๏ธ Actions โ what the back office can do right now
- Asked, not assumed โ
GET manage/cases/{id}/actionsasks the workflow which blocking activities are waiting and returnsCaseActions:HasAssignment,HasUnassignment,HasEdit,HasApprovaland the list ofCustomActions. - Rendered as-is โ the SPA shows exactly those: assign-to-me, the edit form, approve / reject with reject reasons, one button per custom action.
- Resumed by the API โ
manage/cases/{id}/assign | edit | approve | trigger-actionresumes the matching bookmark.
The buttons a user sees are a function of the case's live position in its workflow and the user's role โ no UI code per process.
๐ Access control
Three layers: what your role allows, which records you were granted, and what you own.
- Roles โ system access โ
CasesUserreads,CasesManagermanages,CasesAdministratoradministers (case types, checkpoint types, access rules); admins and system clients pass. - Access rules โ record access โ a rule grants a member (a user, a group or a role) an access level on a case,
a case type, a checkpoint type, or a case at a given checkpoint. Managed through
manage/access-rulesand in the SPA. - Ownership โ customer endpoints serve only the caller's own cases, and a customer cannot open a
Managedcase. - Elevated bypass โ
ByPassAccessRulesForElevatedUsers(defaulttrue) lets administrators see every case without rules.
๐งพ Customer surface โ the my API
my/case-typesโ the case types a customer can open, with translated schema and layout.my/casesโ create a draft, update it, upload attachments, submit, list, get, download the PDF.- Public view only โ the customer sees the public checkpoint, the published data and, on rejection, the reason; never internal steps or back-office comments.
- Same pipeline โ a customer-submitted case starts the same workflow as a staff-created one.
๐ฅ Back-office surface โ the manage API
- Case list โ filters (reference number, customer id / name, TIN, group, date range, case types, checkpoint types) and configurable columns; per-case-type lists for menu-item case types.
- Saved queries โ each user saves their own filters (
manage/queries). - Case detail โ data form, timeline, related cases, comments, attachments, PDF and the available actions.
- Cases on behalf of a customer โ contact search through
IContactProvider(Identity Server-backed or your own), data prefill throughICaseDataInitializer. - Lookups โ named
ILookupServiceimplementations feed form dropdowns from your systems (manage/lookups/{name}). - Notification subscriptions โ staff subscribe to case types; a workflow fetches the subscribers through the integration API, so it can email them.
๐ Dashboard & reports
manage/dashboard/metricsโ counts per status, open cases assigned to me, unassigned, stale (open and untouched for N days), new this week vs the previous week, and daily intake โ over the cases the user can see.manage/reportsโ cases grouped by case type, status or group; optionally limited to one channel (next release).- SPA dashboard โ status and workload cards, intake chart, and a by-type / by-status row per channel in
DashboardChannels(next release).
๐จ๏ธ PDF output
- Two endpoints โ
manage/cases/{id}.pdffor staff,my/cases/{id}/downloadfor customers. - Per case type โ
Config.PdfOptions:IsPortrait,DigitallySigned,RequiresQrCode. - Audited โ every download raises
CaseDownloadedEventwith the channel it came from.
๐ฅ๏ธ Back-office UI โ Angular SPA
A full operator surface, compiled into Cases.UI and served embedded from the API host.
- Screens โ dashboard, cases list, per-case-type lists, case detail, new case and saved queries side panes, notifications; for administrators also case types, checkpoint types and access rules.
- Own JSON Forms renderers โ text, textarea, number / currency, date / date-time, select, checkbox / toggle, slider,
file upload, lookup, rich text, links, nested objects, arrays and tables, list-with-detail, categorization,
oneOf/anyOf/allOf; read-only cases render as a label / value list (next release). - Per-channel fields โ the
case-channelUI schema option shows a field only for cases of one channel. - JSON editor โ case type schema, layout, translations and config are edited in a code editor with inline JSON errors (next release).
- Localized โ English and Greek, switchable at runtime; strings come from server resources at
{prefix}/cases-i18n.{lang}.jsonand can be overridden withAddTranslationsResource(seei18n.md).
2. Flows
๐ From draft to running workflow
Whether a customer submits from their app or a staff member opens a case on their behalf, the road is the same.
flowchart LR
Cust["Customer<br/>POST my/cases"] --> Draft["Draft case<br/>data ยท attachments"]
Staff["Back office<br/>POST manage/cases"] --> Draft
Draft --> Submit["Submit"]
Submit --> Event["CaseSubmittedEvent"]
Event --> Start["Start workflow<br/>tag = case type code"]
Start --> First["First checkpoint"]A draft is invisible to the workflow engine: nothing runs until submit. Every data save is validated against the case
type's schema and kept as a new version. Submit clears the draft flag, raises CaseSubmittedEvent, and the workflow
engine starts the published definition tagged with the case type's code. From then on the workflow owns the case's position.
๐ The back-office action loop
Every step that needs a person is a blocking activity; the SPA asks what is waiting and the user's click resumes it.
%%{init: {"themeVariables": {"fontSize": "10px"}}}%%
flowchart TD
Wait["Workflow reaches a blocking activity<br/>bookmark saved"] --> Ask["SPA: GET actions"]
Ask --> Act["User acts<br/>assign ยท edit ยท approve ยท custom"]
Act --> Resume["API resumes the bookmark"]
Resume --> Step["Send Message<br/>checkpoint ยท data ยท comment"]
Step --> Next{"Completed?"}
Next -- no --> Wait
Next -- yes --> Done["Case completed<br/>data published ยท assignment cleared"]๐ Example: a maker-checker workflow
Built only from the shipped activities: one user prepares the case, a different user approves it.
flowchart LR
A["Await Assignment"] --> E["Await Edit"]
E --> AA["Auto approve<br/>as the editor"]
AA --> P["Await Approval<br/>block previous approver"]
P -- Approve --> C["Send Message<br/>Completed checkpoint"]
C --> N["Notify customer"]
P -- Reject --> R["Get rejected reason"]
R --> S["Send Message<br/>Rejected checkpoint"]
S --> NAuto approve records the editor as the first approver; Block previous approver on the next Await Approval stops that same user from approving again. The four-eyes rule is part of the workflow definition, not a convention. Reject reasons supplies the list the approver picks from, translated for the customer.
3. Where Cases shines
Two things set Cases apart. A process is data (a schema, checkpoints and a workflow) rather than code; and the line between what the customer sees and what the back office works on is built into the model rather than left to each screen. The two pillars below expand each.
๐งญ Processes as data
A new process does not need a new screen, a new table or a new deployment.
- Schema-driven forms โ JSON Schema + JSON Forms layout, validated on the server, rendered by the SPA.
- Checkpoints as states โ public and private states per case type, each mapped to a status.
- Workflows in a designer โ Elsa 2 with case-aware activities; publish without a redeploy.
- Actions from the workflow โ the back office's buttons come from the waiting activities, not from UI code.
- Translated end to end โ case types, checkpoints, forms and UI strings per language.
๐ก๏ธ Built for customer-facing back offices
- Public / private split โ customers see public checkpoints and published data only.
- Three-layer access โ role, record-level access rules, ownership.
- Four-eyes approvals โ Block previous approver and role-limited Await Approval in the workflow definition.
- Full history โ checkpoints, data versions, comments and approvals are rows; the timeline is a query.
- Two channels, one pipeline โ self-service and staff-assisted cases share workflows, reports and the dashboard.
โ Capability summary
One grid to take to your team โ the capability on the left, the mechanism that delivers it on the right.
| Capability | How it's delivered |
|---|---|
| Schema-driven case forms | โ JSON Schema + JSON Forms layout per case type |
| Public / private states and data | โ
Private checkpoints, PublicData versions |
| Visual workflow designer | โ
Elsa 2 at /workflow |
| Assignment, edit, approval, custom actions | โ
blocking activities + CaseActions |
| Four-eyes approval | โ Block previous approver |
| Reject reasons, translated | โ Reject reasons / Get rejected reason |
| Customer self-service API | โ
my/cases, my/case-types |
| Staff-created cases for a customer | โ
manage/cases + IContactProvider |
| Record-level access rules | โ case ยท case type ยท checkpoint type ยท user / group / role |
| Role-based access levels | โ
CasesUser ยท CasesManager ยท CasesAdministrator |
| Human-readable reference numbers | โ
DB sequence (ReferenceNumberEnabled) |
| Data versions, comments, attachments, timeline | โ
rows in CasesDb |
| Saved queries | โ per user |
| Dashboard metrics and grouped reports | โ
manage/dashboard/metrics, manage/reports |
| PDF per case type | โ
Razor template + pluggable ICasePdfService |
| Customer notification | โ Notify customer (SMS / Viber), Elsa email |
| Lookups from your systems | โ
named ILookupService |
| Embedded back-office SPA | โ
UseCasesUI |
| English / Greek UI, runtime switch | โ
server-side resources + cases-i18n endpoint |
4. Architecture & hosting
- Built on
Indice.PlatformโIndice.Features.Cases.{Core, Server, Workflows, UI}. - Standard foundations โ ASP.NET Core Minimal APIs, EF Core (SQL Server), Elsa Workflows 2, JSON Schema + JSON Forms.
๐๏ธ 4.1 High-level architecture
Composable feature libraries in one host; the case engine and the workflow engine talk to each other over an HTTP contract.
flowchart LR
Customer["Customer apps<br/>my API"] --> API["Cases API<br/>Server"]
BO["Back-office SPA<br/>manage API"] --> API
API --> Core["Core<br/>case types ยท cases ยท checkpoints ยท access rules"]
Core --> Db[("CasesDb<br/>schema case")]
Core -- "case submitted" --> WF["Workflows<br/>Elsa 2"]
WF -- "workflow-integration API" --> API
WF --> WfDb[("WorkflowDb<br/>Elsa")]
WF --> Notify["SMS / Viber ยท Email"]๐ญ 4.2 What's deployed in production
- One host โ API + back-office SPA + Elsa workflow server and designer in a single ASP.NET Core app.
- Two databases โ
CasesDb(schemacase) for cases,WorkflowDbfor Elsa definitions, instances and bookmarks. - An HTTP seam between the engines โ the case engine calls
api/workflow-actions/*, the workflow engine calls{prefix}/manage/workflow-integration/*, both with client-credentials tokens, even inside one process.Endpoints:ServerLoopbackUrioverrides the address they use. - Hosted services โ database initializers for both contexts, the Elsa retention sweep, and Quartz for workflow timers.
- Workflow designer at
/workflowโ the Elsa 2 designer behind OIDC (cases-uiclient), open to admins,CasesAdministratorand system clients. - Distributed cache โ memory by default, Redis when
ConnectionStrings:Redisis set; holds per-user access decisions.
One deployable, two stores: cases and workflow state are separate databases with separate migrations, so a workflow upgrade never touches case data.
๐ง 4.3 Composition + reference template
// Indice.Cases/Program.cs
builder.AddCaseServer(options => {
options.PathPrefix = "/api";
options.ReferenceNumberEnabled = true; // human-readable case numbers from a DB sequence
// options.ConfigureDbContext = โฆ; // defaults to ConnectionStrings:CasesDb (SQL Server)
// options.UseContactProviderIdentity(o => โฆ); // search customers in your Identity Server
});
builder.AddCasesWorkflow(options => {
options.RegisterAuthentication = true; // OIDC sign-in for the workflow designer
options.ConfigureSmtp = builder.Configuration.GetSection("Elsa:Smtp").Bind;
// options.GetWorkflowAssembly = () => typeof(Program).Assembly; // code-first workflows + custom activities
});
var app = builder.Build();
app.UseCasesWorkflow(); // Elsa HTTP activities, designer (/workflow), workflow-actions API
app.UseCasesUI(); // embedded back-office SPA
app.MapCases(); // my + manage + workflow-integration + translation endpoints
5. Feature internals & integration
๐ Access control
- Pluggable โ
AddCaseAuthorizationService<T>()adds your ownICaseAuthorizationServiceto filter lists and decide membership. - Cached โ per-user, per-case access decisions are cached for five minutes (sliding).
๐จ๏ธ PDF output
- Template โ
ICaseTemplateServicerenders the Razor viewCases/Pdf/{CaseTypeCode}throughIHtmlRenderingEngine. - Engine โ
ICasePdfService.HtmlToPdfAsyncturns the HTML into a PDF. The default is a no-op; the host plugs in its engine.
๐ฅ๏ธ Back-office UI โ Angular SPA
- Served in-process โ
UseCasesUI()streams the packaged bundle; OIDC clientcases-ui, scopecases. - Redesigned โ Tailwind 4 + daisyUI 5, Lucide icons, Angular signals (next release).
๐งฉ Events & integration
- Platform events โ
CaseSubmittedEvent,CaseMessageCreatedEvent,CaseMessageSentEvent,CaseDownloadedEvent; subscribe withAddCaseEventHandler<TEvent, THandler>(). - Workflow integration API โ
manage/workflow-integration/*: get a case, patch data (merge or JSON Patch) and metadata, attach files, add or roll back approvals, assign, send messages, publish data, list subscribers. ICasesManagerโ the workflow-side client of that API, for your own activities.
6. Configuration
Everything that can be a setting is a setting. Code is for the seams: contacts, lookups, PDF, authorization, activities.
| Section | What it controls |
|---|---|
ConnectionStrings | CasesDb (SQL Server, schema case), WorkflowDb (Elsa), optional Redis |
General:Authority / General:Api | identity server, cases resource, introspection secret, loopback ClientId / ClientSecret |
Endpoints:ServerLoopbackUri | the address the case and workflow engines use to call each other |
Elsa:Smtp | SMTP for Elsa's email activity |
CaseServerOptions | path prefix, scope, claim types, reference numbers, access-rule bypass, upload limits, translations |
CasesWorkflowOptions | workflow database, SMTP, retention, HTTP activities path, designer authentication, code-first workflows |
CasesUIOptions | list columns and filters, dashboard tags and channels, language |
๐ Server
builder.AddCaseServer(options => {
options.PathPrefix = "/api";
options.RequiredScope = "cases";
options.ReferenceNumberEnabled = true;
options.ByPassAccessRulesForElevatedUsers = true;
options.GroupIdClaimType = "group_id"; // branch / team of the back-office user
options.DatabaseSchema = "case";
options.MapTranslations = true; // {prefix}/cases-i18n.{lang}.json + {prefix}/languages
options.ConfigureLimitUpload = o => {
o.DefaultMaxFileSizeBytes = 10 * 1024 * 1024;
o.DefaultAllowedFileExtensions = [".pdf", ".jpg", ".png"];
o.EnableMagicByteValidation = true;
};
options.UseContactProviderIdentity(o => { o.ClientId = "โฆ"; o.ClientSecret = "โฆ"; });
});
- Reference numbers give staff and customers something to say on the phone instead of a GUID.
- Group claim ties a back-office user to a branch or team, which access rules and filters use.
- Upload limits โ size, extension allow-list and magic-byte checks on every attachment.
๐ Workflows
builder.AddCasesWorkflow(options => {
options.ConfigureSmtp = builder.Configuration.GetSection("Elsa:Smtp").Bind;
options.RetentionServicesEnabled = true; // default: completed instances, 30-day TTL, swept every 4 days
options.ConfigureRetentionServices = o => o.TimeToLive = Duration.FromDays(90);
options.ServerHttpActivitiesBasePath = "/http-activities";
options.RegisterAuthentication = true; // OIDC for the designer
options.WorkflowUIClientId = "cases-ui";
options.GetWorkflowAssembly = () => typeof(Program).Assembly;
});
- Retention keeps
WorkflowDbbounded; completed workflow instances are swept on a schedule. - Code-first or designer โ workflows can be authored in the designer or shipped in your assembly with custom activities.
- SMS โ Notify customer sends through
ISmsService; the default is a no-op, so register a provider in the host.
๐ฅ๏ธ Back-office UI
app.UseCasesUI(o => {
o.CaseListColumns = [CaseListColumn.ReferenceNumber, CaseListColumn.CustomerName, CaseListColumn.CaseType,
CaseListColumn.CheckpointType, CaseListColumn.AssignedTo, CaseListColumn.SubmitDate];
o.CaseListFilters = [CaseListFilter.ReferenceNumber, CaseListFilter.CustomerName,
CaseListFilter.DateRange, CaseListFilter.CaseTypeCodes];
o.DashboardChannels = ["Managed", "External"]; // (next release) one report row per channel; [] hides them
});
- Shape the list per deployment โ a bank shows TIN and customer id; an internal helpdesk hides them.
- Per case type โ menu-item case types get their own columns and filters from
GridColumnConfig/GridFilterConfig.
๐ Identity provisioning
- API resource
caseswith the claimsrole,email,name,sub,given_name,family_name. - Client
cases-ui(authorization code) for the back-office SPA and the workflow designer; identity resourcesopenid,profile,email,role, pluscasesandoffline_access. - Roles โ
CasesUser,CasesManager,CasesAdministrator;Adminpasses everything. - Loopback client โ a client-credentials client with the
casesscope (General:Api:Secrets:ClientId/ClientSecret).
๐๏ธ Databases & migrations
- Two contexts โ
CasesDbContextand Elsa'sElsaContext, each with its own migrations history table. - Your migrations assembly โ the template's
README.mdshows theMigrationsAssembly/MigrationsHistoryTablesetup and thedotnet ef migrations add --context โฆcommands. - Upgrade scripts โ schema changes between versions ship as SQL in the Cases changelogs.
๐งฐ Extensibility
The C# seams where your code plugs into the product without forking anything.
IContactProvider customer search for staff-created cases (Identity Server built in)
ICaseDataInitializer prefill a new case's data from your systems
ILookupService named dropdown sources (AddLookupService<T>("name"))
ICaseAuthorizationService extra list filtering and membership (AddCaseAuthorizationService<T>())
ICasePdfService your HTML-to-PDF engine
ICaseTemplateService your PDF template rendering (default: Razor view per case type)
IPlatformEventHandler<TEvent> react to submitted / message / downloaded events (AddCaseEventHandler)
CasesMessageDescriber override the product's messages (AddCasesMessageDescriber<T>())
Elsa activities + bookmarks custom workflow steps from your assembly (GetWorkflowAssembly)
AddTranslationsResource override or extend the back-office UI strings
- C# interfaces, not a DSL โ the team that writes ASP.NET Core writes the extensions.
- In-process โ extensions run in your host, debuggable with the rest of your app.
- Safe defaults โ every seam ships a no-op, so a fresh host runs before any of them is implemented.