Skip to content

feat(catalog): workflow activities with their kind and slots for lint rules (#1295) - #2164

Merged
ako merged 1 commit into
mainfrom
feature/1295-workflow-activities
Nov 12, 2026
Merged

ako merged 1 commit into
mainfrom
feature/1295-workflow-activities

Conversation

@ako

@ako ako commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Part of #1295 (mendixlabs#1269). This adds the workflow row of the issue's table. The published web services row is still open; see Not covered.

Problem

The issue's last row asks for a rule like "microflows used in workflows must use a prefix per role (user task, system task, …)". After the first round (#1314 and the workflow refs fix), the catalog still couldn't answer it:

  • refs records only WORKFLOW → MICROFLOW call, not which activity, or which slot of it, runs the microflow;
  • workflows_data only counts activities;
  • no Starlark builtin read either table.

Change

  • CATALOG.WORKFLOW_ACTIVITIES (mdl/catalog/builder_workflow_activities.go): one row per activity, in walk order: the main flow, each activity followed by the paths of its boundary events, then the event sub-processes. This is the same walk the activity counts and refs use.
    • Activity kind (ActivityType): the kind workflows_data counts. Two pairs that share a Go type are told apart: MultiUserTask from UserTask, and AIAgentTask from CallMicroflow.
    • Slots, one column each: Microflow (system task, call microflow, AI agent task), UserSourceMicroflow, OnCreatedMicroflow, CompletionMicroflow, Page, UserTaskEntity and CalledWorkflow.
    • An empty slot is NULL, the rule since schema 47 (Catalog: store an absent reference or optional value as NULL, not '' #2093).
    • Every build writes it, fast included, as it does workflows_data; model-quality rules run on a fast catalog.
    • Catalog schema 48.
  • Starlark (mdl/linter):
    • workflows() returns the user's workflows, with parameter entity and activity counts;
    • workflow_activities() returns the activities above;
    • both skip System and Marketplace modules and honour --document;
    • both are documented in the write-lint-rules skill, which the skill-coverage tests require.

Evidence

  • Tests:

    • TestWorkflowActivityRows_KindAndSlots_Issue1295: runs on the fixture with a distinct target in every slot. The 12 rows come out in walk order, each kind and slot as expected, boundary-event paths and the event sub-process included.
    • TestTestApp_WorkflowActivitiesInFastBuild_Issue1295: a real fast build of TestApp. workflow.UserTaskEventHandle is the on-created microflow of a user task; no slot stores ''; and each workflow's ActivityCount equals its number of rows.
    • TestWorkflowActivities_PrefixPerRole_Issue1295: the issue's rule, written in Starlark against workflows() and workflow_activities(). It flags the system task's BookOrder and the on-created Notify, and passes WF_SYS_Mail and WF_TGT_Managers.
    • TestIterators_ExcludePlatformModules: now also covers both iterators. It includes its own control that the iterators return the user's rows.
    • Mode guard: the two builtins are registered as fast-catalog builtins, and TestBuiltinModesCoverEveryPredeclared / TestDetectedModeMatchesBuiltinModes pass.
  • Control: with the builder call removed, the TestApp test fails with "no activity has workflow.UserTaskEventHandle as its on-created microflow".

  • On TestApp through the CLI: select ActivityType, count(*) from CATALOG.WORKFLOW_ACTIVITIES group by ActivityType gives:

    ActivityType Rows
    EndWorkflow 3
    AIAgentTask 3
    StartWorkflow 2
    MultiUserTask 2
    UserTask 1
    InterruptingNotificationEventSubProcessStart 1

    The user task shows workflow.UserTaskPage and its on-created microflow, and each AI agent task its workflow.InvokeAgent.

  • Docs:

    • docs-site/src/tools/catalog-tables.md gains a section for the table, with an example query; the query runs on TestApp;
    • the skill's catalog-tables.md documents the workflow and workflow_activity fields;
    • the changelog has an entry under Added.
  • Local checks: make fmt-check lint pass. make ci-local passes apart from check-skill-pack-js, which needs node (not installed here). check-skill-mdl, check-conformance, check-migration-reference and check-mdl pass.

Not covered

  • Published (SOAP) web services and their operations (the issue's fourth row). Nothing in mxcli reads them yet. None of the projects I have contains one; I checked the 10 local test projects for WebServices$PublishedWebService. The generated types exist (modelsdk/gen/webservices), but without a document Studio Pro wrote, I can't check what the reader would decode. A small .mpr, or a module export with one published web service of two operations, would unblock it.

🤖 Generated with Claude Code

… rules (#1295)

A lint rule could not ask which kind of workflow activity runs a microflow
— "a system task's microflow is prefixed WF_SYS_", "a user task's
targeting microflow WF_TGT_" — because refs records only that the workflow
calls the microflow, and workflows_data only counts activities.

CATALOG.WORKFLOW_ACTIVITIES holds one row per activity of a workflow,
boundary-event paths and event sub-processes included, with its kind
(MultiUserTask and AIAgentTask told apart from UserTask and CallMicroflow)
and the microflow, page or workflow each slot names; an empty slot is NULL.
It is written by every build. workflows() and workflow_activities() expose
workflows_data and the new table to Starlark rules. Catalog schema 48.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ako
ako merged commit 2123fb5 into main Nov 12, 2026
21 checks passed
@ako
ako deleted the feature/1295-workflow-activities branch November 12, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant