AAE-42658 Remove check for outcome.id as name based outcomes are valid (#11685)

This commit is contained in:
Enrico Hilgendorf
2026-02-25 15:23:25 +01:00
committed by GitHub
parent 1061e762f8
commit 4cc56421ee
3 changed files with 27 additions and 1 deletions
@@ -223,7 +223,7 @@ export abstract class FormBaseComponent {
} }
} else { } else {
// Note: Activiti is using NAME field rather than ID for outcomes // 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); this.completeTaskForm(outcome.name, outcome.id);
return true; return true;
} }
@@ -610,6 +610,19 @@ describe('FormCloudComponent', () => {
expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, outcomeId); 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', () => { it('should save form on [save] outcome click', () => {
const formModel = new FormModel(); const formModel = new FormModel();
const outcome = new FormOutcomeModel(formModel, { const outcome = new FormOutcomeModel(formModel, {
@@ -350,6 +350,19 @@ describe('FormComponent', () => {
expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, outcome.id); 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', () => { it('should save form on [save] outcome click', () => {
const formModel = new FormModel(); const formModel = new FormModel();
const outcome = new FormOutcomeModel(formModel, { const outcome = new FormOutcomeModel(formModel, {