diff --git a/lib/process-services-cloud/src/lib/i18n/en.json b/lib/process-services-cloud/src/lib/i18n/en.json index 8bb3ee9acbe..5bce112575b 100644 --- a/lib/process-services-cloud/src/lib/i18n/en.json +++ b/lib/process-services-cloud/src/lib/i18n/en.json @@ -253,6 +253,7 @@ "SUSPENDED_DATE": "Suspended Date", "STARTED_BY": "Started by", "COMPLETED_DATE": "Completed Date", + "MAIN_PROCESS_ID": "Main process id", "DATE_RANGE": { "NO_DATE": "No Date", "TODAY": "Today", diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts index 4c045f4633f..5a6aa9c8782 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts @@ -691,6 +691,11 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges { key: 'appVersion', value: 'appVersion' }, + { + label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.MAIN_PROCESS_ID', + key: 'parentId', + value: 'parentId' + }, { label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.PROCESS_INS_ID', key: 'processInstanceId', @@ -767,6 +772,12 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges { key: 'processInstanceId', value: filterModel.processInstanceId || '' }, + { + label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.MAIN_PROCESS_ID', + type: 'text', + key: 'parentId', + value: filterModel.parentId + }, { label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.PROCESS_NAME', type: 'text', diff --git a/lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts b/lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts index 7a5bee22c20..7f64b88d30f 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts @@ -30,6 +30,7 @@ export class ProcessFilterCloudModel { index: number; appName: string; appVersion?: number | number[]; + parentId?: string; processName: string; processInstanceId: string; initiator: string; @@ -80,6 +81,7 @@ export class ProcessFilterCloudModel { } this.processInstanceId = obj.processInstanceId || null; + this.parentId = obj.parentId || ''; this.processName = obj.processName || null; this.initiator = obj.initiator || null; this.status = obj.status || null; diff --git a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts index 05be96706a0..ecd2f8e9bd0 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts @@ -179,6 +179,23 @@ describe('ProcessListCloudComponent', () => { expect(component.requestNode.appVersion).toEqual(''); }); + it('should the payload contain the parentId if it is defined', () => { + spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); + component.parentId = 'fake-parent-id'; + component.ngAfterContentInit(); + component.reload(); + + expect(component.requestNode.parentId).toEqual('fake-parent-id'); + }); + + it('should the payload contain an empty parentId if it is NOT defined', () => { + spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); + component.ngAfterContentInit(); + component.reload(); + + expect(component.requestNode.parentId).toEqual(''); + }); + it('should return the results if an application name is given', (done) => { spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); const appName = new SimpleChange(null, 'FAKE-APP-NAME', true); diff --git a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts index 672f3d20504..3f3df7891d8 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts @@ -109,6 +109,10 @@ export class ProcessListCloudComponent @Input() name: string = ''; + /** Filter the processes to display only the ones with this parentId. */ + @Input() + parentId: string = ''; + /** Filter the processes to display only the ones with this process definition ID. */ @Input() processDefinitionId: string = ''; @@ -598,6 +602,7 @@ export class ProcessListCloudComponent id: this.id, environmentId: this.environmentId, name: this.name, + parentId: this.parentId, processDefinitionId: this.processDefinitionId, processDefinitionName: this.processDefinitionName, processDefinitionKey: this.processDefinitionKey, diff --git a/lib/process-services-cloud/src/lib/process/process-list/models/process-cloud-query-request.model.ts b/lib/process-services-cloud/src/lib/process/process-list/models/process-cloud-query-request.model.ts index 42060fa7ac0..88436422a2a 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/models/process-cloud-query-request.model.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/models/process-cloud-query-request.model.ts @@ -27,6 +27,7 @@ export class ProcessQueryCloudRequestModel { id?: string; environmentId?: string; name?: string; + parentId?: string; processDefinitionId?: string; processDefinitionName?: string; processDefinitionKey?: string; @@ -56,6 +57,7 @@ export class ProcessQueryCloudRequestModel { this.id = obj.id; this.environmentId = obj.environmentId; this.name = obj.name; + this.parentId = obj.parentId; this.processDefinitionId = obj.processDefinitionId; this.processDefinitionName = obj.processDefinitionName; this.processDefinitionKey = obj.processDefinitionKey;