#1432 - Added new system outcome : Start Process (#1453)

* #1432 - Added system outcome for start process

* 1432 - improved condition for system outcome check

* #1432 - fix test for start process system outcome
This commit is contained in:
Vito
2017-01-13 04:46:40 -08:00
committed by Mario Romano
parent 0fa87bb17d
commit fcdc628d35
5 changed files with 43 additions and 6 deletions

View File

@@ -15,7 +15,16 @@
* limitations under the License.
*/
import { Component, OnInit, AfterViewChecked, OnChanges, SimpleChanges, Input, Output, EventEmitter } from '@angular/core';
import {
Component,
OnInit,
AfterViewChecked,
OnChanges,
SimpleChanges,
Input,
Output,
EventEmitter
} from '@angular/core';
import { LogService } from 'ng2-alfresco-core';
import { EcmModelService } from './../services/ecm-model.service';
import { FormService } from './../services/form.service';
@@ -79,6 +88,7 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
static SAVE_OUTCOME_ID: string = '$save';
static COMPLETE_OUTCOME_ID: string = '$complete';
static START_PROCESS_OUTCOME_ID: string = '$startProcess';
static CUSTOM_OUTCOME_ID: string = '$custom';
@Input()
@@ -185,6 +195,9 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
if (outcome.name === FormOutcomeModel.SAVE_ACTION) {
return this.showSaveButton;
}
if (outcome.name === FormOutcomeModel.START_PROCESS_ACTION) {
return false;
}
return true;
}
return false;
@@ -247,6 +260,11 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
return true;
}
if (outcome.id === ActivitiForm.START_PROCESS_OUTCOME_ID) {
this.completeTaskForm();
return true;
}
if (outcome.id === ActivitiForm.CUSTOM_OUTCOME_ID) {
this.formSaved.emit(this.form);
this.storeFormAsMetadata();
@@ -421,7 +439,7 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
*/
getFormDefinitionOutcomes(form: FormModel): FormOutcomeModel[] {
return [
new FormOutcomeModel(form, {id: '$custom', name: FormOutcomeModel.SAVE_ACTION, isSystem: true})
new FormOutcomeModel(form, { id: '$custom', name: FormOutcomeModel.SAVE_ACTION, isSystem: true })
];
}