3 export class OperationParameter {
9 constructor(param?: OperationParameter) {
11 this.name = param.name;
12 this.type = param.type;
13 this.inputId = param.inputId;
14 this.required = param.required;
19 export interface IOperationParamsList {
20 listToscaDataDefinition: Array<OperationParameter>;
23 export class WORKFLOW_ASSOCIATION_OPTIONS {
26 static EXISTING = 'EXISTING';
29 export class BEOperationModel {
34 inputs: IOperationParamsList;
35 outputs: IOperationParamsList;
37 workflowAssociationType: string;
39 workflowVersionId: string;
41 implementation?: { artifactUUID: string; };
43 constructor(operation?: any) {
45 this.name = operation.name;
46 this.description = operation.description;
47 this.uniqueId = operation.uniqueId;
49 this.inputs = operation.inputs;
50 this.outputs = operation.outputs;
52 this.workflowAssociationType = operation.workflowAssociationType;
53 this.workflowId = operation.workflowId;
54 this.workflowVersionId = operation.workflowVersionId;
55 this.implementation = operation.implementation;
59 public createInputsList(inputs: Array<OperationParameter>): void {
61 listToscaDataDefinition: inputs
65 public createOutputsList(outputs: Array<OperationParameter>): void {
67 listToscaDataDefinition: _.map(outputs, output => {
68 delete output.inputId;
75 export class OperationModel extends BEOperationModel {
76 interfaceType: string;
79 constructor(operation?: any) {
82 this.interfaceId = operation.interfaceId;
83 this.interfaceType = operation.interfaceType;
87 public displayType(): string {
88 const lastDot = this.interfaceType ? this.interfaceType.lastIndexOf('.') : -1;
89 return lastDot === -1 ? this.interfaceType : this.interfaceType.substr(lastDot + 1);
93 export class InterfaceModel {
96 operations: Array<OperationModel>;
98 constructor(interf?: any) {
100 this.type = interf.type;
101 this.uniqueId = interf.uniqueId;
102 this.operations = interf.operations;
106 public displayType(): string {
107 const lastDot = this.type ? this.type.lastIndexOf('.') : -1;
108 return lastDot === -1 ? this.type : this.type.substr(lastDot + 1);