Skip to content
Open
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
1 change: 1 addition & 0 deletions cmd/mxcli/lsp_completions_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions mdl/ast/ast_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ type WorkflowUserTaskNode struct {
func (n *WorkflowUserTaskNode) workflowActivityNode() {}

// WorkflowTargetingNode represents user targeting strategy.
// Kind: "microflow", "xpath", "group_microflow", "group_xpath", or ""
type WorkflowTargetingNode struct {
Kind string // "microflow", "xpath", or ""
Microflow QualifiedName // for microflow targeting
XPath string // for xpath targeting
Kind string // "microflow", "xpath", "group_microflow", "group_xpath", or ""
Microflow QualifiedName // for microflow targeting (user or group)
XPath string // for xpath targeting (user or group)
}

// WorkflowUserTaskOutcomeNode represents an outcome of a user task.
Expand Down
8 changes: 8 additions & 0 deletions mdl/catalog/builder_references.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,14 @@ func (b *Builder) extractWorkflowFlowRefs(stmt *sql.Stmt, flow *workflows.Flow,
refCount++
}
}
if us, ok := a.UserSource.(*workflows.MicroflowGroupSource); ok && us.Microflow != "" {
_, err := stmt.Exec("WORKFLOW", sourceID, sourceQN,
"MICROFLOW", "", us.Microflow,
RefKindCall, moduleName, projectID, snapshotID)
if err == nil {
refCount++
}
}
}
for _, outcome := range a.Outcomes {
refCount += b.extractWorkflowFlowRefs(stmt, outcome.Flow, sourceID, sourceQN, moduleName, projectID, snapshotID)
Expand Down
8 changes: 8 additions & 0 deletions mdl/executor/cmd_workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,14 @@ func formatUserTask(a *workflows.UserTask, indent string) []string {
if us.XPath != "" {
lines = append(lines, fmt.Sprintf("%s TARGETING XPATH '%s'", indent, us.XPath))
}
case *workflows.MicroflowGroupSource:
if us.Microflow != "" {
lines = append(lines, fmt.Sprintf("%s TARGETING GROUPS MICROFLOW %s", indent, us.Microflow))
}
case *workflows.XPathGroupSource:
if us.XPath != "" {
lines = append(lines, fmt.Sprintf("%s TARGETING GROUPS XPATH '%s'", indent, us.XPath))
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions mdl/executor/cmd_workflows_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ func buildUserTask(n *ast.WorkflowUserTaskNode) *workflows.UserTask {
task.UserSource = &workflows.XPathBasedUserSource{
XPath: n.Targeting.XPath,
}
case "group_microflow":
task.UserSource = &workflows.MicroflowGroupSource{
Microflow: n.Targeting.Microflow.Module + "." + n.Targeting.Microflow.Name,
}
case "group_xpath":
task.UserSource = &workflows.XPathGroupSource{
XPath: n.Targeting.XPath,
}
}

// Outcomes
Expand Down
1 change: 1 addition & 0 deletions mdl/grammar/MDLLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ ACTIVITY: A C T I V I T Y;
CONDITION: C O N D I T I O N;
OFF: O F F;
USERS: U S E R S;
GROUPS: G R O U P S;

// Workflow microflow action tokens
DATA: D A T A;
Expand Down
8 changes: 4 additions & 4 deletions mdl/grammar/MDLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -2638,17 +2638,17 @@ workflowActivityStmt
workflowUserTaskStmt
: USER TASK IDENTIFIER STRING_LITERAL
(PAGE qualifiedName)?
(TARGETING MICROFLOW qualifiedName)?
(TARGETING XPATH STRING_LITERAL)?
(TARGETING (USERS | GROUPS)? MICROFLOW qualifiedName)?
(TARGETING (USERS | GROUPS)? XPATH STRING_LITERAL)?
(ENTITY qualifiedName)?
(DUE DATE_TYPE STRING_LITERAL)?
(DESCRIPTION STRING_LITERAL)?
(OUTCOMES workflowUserTaskOutcome+)?
(BOUNDARY EVENT workflowBoundaryEventClause+)?
| MULTI USER TASK IDENTIFIER STRING_LITERAL
(PAGE qualifiedName)?
(TARGETING MICROFLOW qualifiedName)?
(TARGETING XPATH STRING_LITERAL)?
(TARGETING (USERS | GROUPS)? MICROFLOW qualifiedName)?
(TARGETING (USERS | GROUPS)? XPATH STRING_LITERAL)?
(ENTITY qualifiedName)?
(DUE DATE_TYPE STRING_LITERAL)?
(DESCRIPTION STRING_LITERAL)?
Expand Down
5 changes: 4 additions & 1 deletion mdl/grammar/parser/MDLLexer.interp

Large diffs are not rendered by default.

153 changes: 77 additions & 76 deletions mdl/grammar/parser/MDLLexer.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -498,79 +498,80 @@ ACTIVITY=497
CONDITION=498
OFF=499
USERS=500
DATA=501
RECORDS=502
NOTIFY=503
PAUSE=504
UNPAUSE=505
ABORT=506
RETRY=507
RESTART=508
LOCK=509
UNLOCK=510
REASON=511
OPEN=512
COMPLETE_TASK=513
NOT_EQUALS=514
LESS_THAN_OR_EQUAL=515
GREATER_THAN_OR_EQUAL=516
EQUALS=517
LESS_THAN=518
GREATER_THAN=519
PLUS=520
MINUS=521
STAR=522
SLASH=523
PERCENT=524
MOD=525
DIV=526
SEMICOLON=527
COMMA=528
DOT=529
LPAREN=530
RPAREN=531
LBRACE=532
RBRACE=533
LBRACKET=534
RBRACKET=535
COLON=536
AT=537
PIPE=538
DOUBLE_COLON=539
ARROW=540
QUESTION=541
HASH=542
MENDIX_TOKEN=543
STRING_LITERAL=544
DOLLAR_STRING=545
NUMBER_LITERAL=546
VARIABLE=547
IDENTIFIER=548
HYPHENATED_ID=549
QUOTED_IDENTIFIER=550
'<='=515
'>='=516
'='=517
'<'=518
'>'=519
'+'=520
'-'=521
'*'=522
'/'=523
'%'=524
';'=527
','=528
'.'=529
'('=530
')'=531
'{'=532
'}'=533
'['=534
']'=535
':'=536
'@'=537
'|'=538
'::'=539
'->'=540
'?'=541
'#'=542
GROUPS=501
DATA=502
RECORDS=503
NOTIFY=504
PAUSE=505
UNPAUSE=506
ABORT=507
RETRY=508
RESTART=509
LOCK=510
UNLOCK=511
REASON=512
OPEN=513
COMPLETE_TASK=514
NOT_EQUALS=515
LESS_THAN_OR_EQUAL=516
GREATER_THAN_OR_EQUAL=517
EQUALS=518
LESS_THAN=519
GREATER_THAN=520
PLUS=521
MINUS=522
STAR=523
SLASH=524
PERCENT=525
MOD=526
DIV=527
SEMICOLON=528
COMMA=529
DOT=530
LPAREN=531
RPAREN=532
LBRACE=533
RBRACE=534
LBRACKET=535
RBRACKET=536
COLON=537
AT=538
PIPE=539
DOUBLE_COLON=540
ARROW=541
QUESTION=542
HASH=543
MENDIX_TOKEN=544
STRING_LITERAL=545
DOLLAR_STRING=546
NUMBER_LITERAL=547
VARIABLE=548
IDENTIFIER=549
HYPHENATED_ID=550
QUOTED_IDENTIFIER=551
'<='=516
'>='=517
'='=518
'<'=519
'>'=520
'+'=521
'-'=522
'*'=523
'/'=524
'%'=525
';'=528
','=529
'.'=530
'('=531
')'=532
'{'=533
'}'=534
'['=535
']'=536
':'=537
'@'=538
'|'=539
'::'=540
'->'=541
'?'=542
'#'=543
4 changes: 3 additions & 1 deletion mdl/grammar/parser/MDLParser.interp

Large diffs are not rendered by default.

Loading
Loading