[ADF-2188] Start Process - Change processDefinition property and fix bug (#2884)

* Change processDefinition property and fix bug

* Fix unit test

* Fix async

* Fix id
This commit is contained in:
Maurizio Vitale
2018-01-25 17:52:05 +01:00
committed by Eugenio Romano
parent abca6e481d
commit 657c28491a
7 changed files with 43 additions and 32 deletions

View File

@@ -50,7 +50,7 @@ export class StartProcessInstanceComponent implements OnChanges {
appId: number;
@Input()
processDefinition: string;
processDefinitionName: string;
@Input()
variables: ProcessInstanceVariable[];
@@ -106,16 +106,12 @@ export class StartProcessInstanceComponent implements OnChanges {
(processDefinitionRepresentations: ProcessDefinitionRepresentation[]) => {
this.processDefinitions = processDefinitionRepresentations;
if (this.processDefinitions.length === 1 || !this.processDefinition) {
if (this.hasSingleProcessDefinition()) {
this.selectedProcessDef = this.processDefinitions[0];
} else {
this.selectedProcessDef = this.processDefinitions.find((currentProcessDefinition) => {
return currentProcessDefinition.name === this.processDefinition;
return currentProcessDefinition.name === this.processDefinitionName;
});
if (!this.selectedProcessDef) {
this.selectedProcessDef = this.processDefinitions[0];
}
}
},
() => {
@@ -124,6 +120,10 @@ export class StartProcessInstanceComponent implements OnChanges {
}
hasSingleProcessDefinition(): boolean {
return this.processDefinitions.length === 1;
}
getAlfrescoRepositoryName(): string {
let alfrescoRepositoryName = this.appConfig.get<string>('alfrescoRepositoryName');
if (!alfrescoRepositoryName) {