[ADF-4001] StartProcessCloud - Fix payload with name (#4241)

* Fix the startProcess payload

* fix unit test
This commit is contained in:
Maurizio Vitale
2019-02-03 21:52:22 +00:00
committed by Eugenio Romano
parent fec2b89b2d
commit bf832f0b1c
4 changed files with 6 additions and 8 deletions

View File

@@ -196,7 +196,7 @@ describe('StartProcessCloudComponent', () => {
component.ngOnChanges({});
fixture.detectChanges();
fixture.whenStable().then(() => {
expect(component.processPayloadCloud.processInstanceName).toBeNull();
expect(component.processPayloadCloud.name).toBeNull();
});
}));

View File

@@ -169,8 +169,7 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
startProcess() {
this.isLoading = true;
this.processPayloadCloud.processInstanceName = this.processInstanceName.value;
this.processPayloadCloud.payloadType = 'StartProcessPayload';
this.processPayloadCloud.name = this.processInstanceName.value;
if (this.variables) {
this.processPayloadCloud.variables = this.variables;
}

View File

@@ -50,6 +50,6 @@ export let fakeProcessDefinitions: ProcessDefinitionCloud[] = [
export let fakeProcessPayload = new ProcessPayloadCloud({
processDefinitionKey: 'NewProcess:1',
processInstanceName: 'NewProcess 1',
name: 'NewProcess 1',
payloadType: 'string'
});

View File

@@ -17,16 +17,15 @@
export class ProcessPayloadCloud {
processDefinitionKey: string;
processInstanceName: string;
name: string;
businessKey: string;
variables: Map<string, object>[];
payloadType: string;
payloadType: string = 'StartProcessPayload';
constructor(obj?: any) {
this.processDefinitionKey = obj && obj.processDefinitionKey ? obj.processDefinitionKey : null;
this.processInstanceName = obj && obj.processInstanceName ? obj.processInstanceName : null;
this.name = obj && obj.name ? obj.name : null;
this.businessKey = obj && obj.businessKey ? obj.businessKey : null;
this.variables = obj && obj.variables ? obj.variables : null;
this.payloadType = obj && obj.valueUrl ? obj.payloadType : null;
}
}