Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .claude/skills/mendix/write-lint-rules/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ def count_not(node):
| `microflow_qualified_name` | string | `"Sales.ACT_Customer_Create"` |
| `module_name` | string | `"Sales"` |
| `entity_ref` | string | Referenced entity qualified name |
| `service_ref` | string | Called service document (REST / web service / OData client); empty when the activity calls none |
| `action_ref` | string | Operation or action within that service; empty when the activity calls none |

### permission

Expand Down
14 changes: 12 additions & 2 deletions mdl/linter/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1147,14 +1147,20 @@ type Activity struct {
MicroflowQualifiedName string
ModuleName string
EntityRef string
// ServiceRef is the called service document (REST/web service/OData
// client); ActionRef the operation or action within it. Both are stored
// by the catalog builder and are empty for activities that call neither.
ServiceRef string
ActionRef string
}

// ActivitiesFor returns an iterator over all activities for a given microflow.
func (ctx *LintContext) ActivitiesFor(microflowQualifiedName string) iter.Seq[Activity] {
return func(yield func(Activity) bool) {
rows, err := ctx.db.Query(`
SELECT Id, Name, Caption, ActivityType, ActionType,
MicroflowId, MicroflowQualifiedName, ModuleName, EntityRef
MicroflowId, MicroflowQualifiedName, ModuleName, EntityRef,
ServiceRef, ActionRef
FROM activities
WHERE MicroflowQualifiedName = ?
ORDER BY Sequence
Expand All @@ -1168,8 +1174,10 @@ func (ctx *LintContext) ActivitiesFor(microflowQualifiedName string) iter.Seq[Ac
for rows.Next() {
var a Activity
var name, caption, actionType, entityRef sql.NullString
var serviceRef, actionRef sql.NullString
err := rows.Scan(&a.ID, &name, &caption, &a.ActivityType, &actionType,
&a.MicroflowID, &a.MicroflowQualifiedName, &a.ModuleName, &entityRef)
&a.MicroflowID, &a.MicroflowQualifiedName, &a.ModuleName, &entityRef,
&serviceRef, &actionRef)
if err != nil {
ctx.recordQueryError("ActivitiesFor (row scan)", err)
continue
Expand All @@ -1178,6 +1186,8 @@ func (ctx *LintContext) ActivitiesFor(microflowQualifiedName string) iter.Seq[Ac
a.Caption = caption.String
a.ActionType = actionType.String
a.EntityRef = entityRef.String
a.ServiceRef = serviceRef.String
a.ActionRef = actionRef.String

if !yield(a) {
return
Expand Down
2 changes: 2 additions & 0 deletions mdl/linter/starlark.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,8 @@ func activityToStarlark(a Activity) starlark.Value {
"microflow_qualified_name": starlark.String(a.MicroflowQualifiedName),
"module_name": starlark.String(a.ModuleName),
"entity_ref": starlark.String(a.EntityRef),
"service_ref": starlark.String(a.ServiceRef),
"action_ref": starlark.String(a.ActionRef),
})
}

Expand Down