From cd391ce69de9a1fd23805cc322ec0c280725ad84 Mon Sep 17 00:00:00 2001 From: Scott Aslan Date: Wed, 2 Oct 2024 16:09:01 -0600 Subject: [PATCH] =?UTF-8?q?[NIFI-13821]=20add=20Max=20Concurrent=20Tasks?= =?UTF-8?q?=20and=20Stateless=20Flow=20Timeout=20form=E2=80=A6=20(#9328)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [NIFI-13821] add Max Concurrent Tasks and Stateless Flow Timeout form fields when PG Execute Engine is STATELESS * make fields conditionally required This closes #9328 --- .../edit-process-group.component.html | 27 +++++++++++++++- .../edit-process-group.component.ts | 31 ++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/process-group/edit-process-group/edit-process-group.component.html b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/process-group/edit-process-group/edit-process-group.component.html index 0a424efabd..03620cc921 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/process-group/edit-process-group/edit-process-group.component.html +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/process-group/edit-process-group/edit-process-group.component.html @@ -68,7 +68,8 @@
Execution Engine - + @for (option of executionEngineOptions; track option) {
+ @if (editProcessGroupForm.get('executionEngine')?.value === STATELESS) { +
+ + Max Concurrent Tasks + + +
+
+ + Stateless Flow Timeout + + +
+ }
Process Group FlowFile Concurrency diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/process-group/edit-process-group/edit-process-group.component.ts b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/process-group/edit-process-group/edit-process-group.component.ts index b81104fef8..f3a32ccd9f 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/process-group/edit-process-group/edit-process-group.component.ts +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/process-group/edit-process-group/edit-process-group.component.ts @@ -84,6 +84,9 @@ export class EditProcessGroup extends TabbedDialog { @Output() editProcessGroup: EventEmitter = new EventEmitter(); protected readonly TextTip = TextTip; + protected readonly STATELESS: string = 'STATELESS'; + private initialMaxConcurrentTasks: number; + private initialStatelessFlowTimeout: string; editProcessGroupForm: FormGroup; readonly: boolean; @@ -102,7 +105,7 @@ export class EditProcessGroup extends TabbedDialog { }, { text: 'Stateless', - value: 'STATELESS', + value: this.STATELESS, description: 'Run the dataflow using the Stateless Execution Engine. See the User Guide for additional details.' } @@ -189,6 +192,27 @@ export class EditProcessGroup extends TabbedDialog { logFileSuffix: new FormControl(request.entity.component.logFileSuffix), comments: new FormControl(request.entity.component.comments) }); + + this.initialMaxConcurrentTasks = request.entity.component.maxConcurrentTasks; + this.initialStatelessFlowTimeout = request.entity.component.statelessFlowTimeout; + + this.executionEngineChanged(request.entity.component.executionEngine); + } + + executionEngineChanged(value: string): void { + if (value == this.STATELESS) { + this.editProcessGroupForm.addControl( + 'maxConcurrentTasks', + new FormControl(this.initialMaxConcurrentTasks, Validators.required) + ); + this.editProcessGroupForm.addControl( + 'statelessFlowTimeout', + new FormControl(this.initialStatelessFlowTimeout, Validators.required) + ); + } else { + this.editProcessGroupForm.removeControl('maxConcurrentTasks'); + this.editProcessGroupForm.removeControl('statelessFlowTimeout'); + } } submitForm() { @@ -221,6 +245,11 @@ export class EditProcessGroup extends TabbedDialog { } }; + if (this.editProcessGroupForm.get('executionEngine')?.value === this.STATELESS) { + payload.component.maxConcurrentTasks = this.editProcessGroupForm.get('maxConcurrentTasks')?.value; + payload.component.statelessFlowTimeout = this.editProcessGroupForm.get('statelessFlowTimeout')?.value; + } + this.editProcessGroup.next(payload); }