Skip to content
Merged
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: 1 addition & 1 deletion lib/core/src/lib/form/components/form-base.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
13 changes: 13 additions & 0 deletions lib/process-services/src/lib/form/form.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
Loading