diff --git a/lib/core/src/lib/form/components/form-base.component.ts b/lib/core/src/lib/form/components/form-base.component.ts index 40607575e9..0b44e6e2f1 100644 --- a/lib/core/src/lib/form/components/form-base.component.ts +++ b/lib/core/src/lib/form/components/form-base.component.ts @@ -223,7 +223,7 @@ export abstract class FormBaseComponent { } } else { // Note: Activiti is using NAME field rather than ID for outcomes - if (outcome.name && outcome.id) { + if (outcome.name) { this.completeTaskForm(outcome.name, outcome.id); return true; } diff --git a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts index 94cff8d9cf..496586b024 100644 --- a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts @@ -610,6 +610,19 @@ describe('FormCloudComponent', () => { expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, outcomeId); }); + it('should complete form on custom outcome click when id is null (APS)', () => { + const formModel = new FormModel(); + const outcomeName = 'Custom Action'; + const outcome = new FormOutcomeModel(formModel, { name: outcomeName, id: null }); + + formComponent.form = formModel; + spyOn(formComponent, 'completeTaskForm').and.stub(); + + const result = formComponent.onOutcomeClicked(outcome); + expect(result).toBeTruthy(); + expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, null); + }); + it('should save form on [save] outcome click', () => { const formModel = new FormModel(); const outcome = new FormOutcomeModel(formModel, { diff --git a/lib/process-services/src/lib/form/form.component.spec.ts b/lib/process-services/src/lib/form/form.component.spec.ts index 8fdfbb90bf..106bda3f5c 100644 --- a/lib/process-services/src/lib/form/form.component.spec.ts +++ b/lib/process-services/src/lib/form/form.component.spec.ts @@ -350,6 +350,19 @@ describe('FormComponent', () => { expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, outcome.id); }); + it('should complete form on custom outcome click when id is null (APS)', () => { + const formModel = new FormModel(); + const outcomeName = 'Custom Action'; + const outcome = new FormOutcomeModel(formModel, { name: outcomeName, id: null }); + + formComponent.form = formModel; + spyOn(formComponent, 'completeTaskForm').and.stub(); + + const result = formComponent.onOutcomeClicked(outcome); + expect(result).toBeTruthy(); + expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, null); + }); + it('should save form on [save] outcome click', () => { const formModel = new FormModel(); const outcome = new FormOutcomeModel(formModel, {