3 export class OperationParameter {
9 constructor(param?: any) {
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';
27 static EXTERNAL = 'EXTERNAL';
30 export class BEOperationModel {
35 inputs: IOperationParamsList;
36 outputs: IOperationParamsList;
38 workflowAssociationType: string;
40 workflowVersionId: string;
42 implementation?: { artifactUUID: string; };
44 constructor(operation?: any) {
46 this.name = operation.name;
47 this.description = operation.description;
48 this.uniqueId = operation.uniqueId;
50 this.inputs = operation.inputs;
51 this.outputs = operation.outputs;
53 this.workflowAssociationType = operation.workflowAssociationType;
54 this.workflowId = operation.workflowId;
55 this.workflowVersionId = operation.workflowVersionId;
56 this.implementation = operation.implementation;
60 public createInputsList(inputs: Array<OperationParameter>): void {
62 listToscaDataDefinition: inputs
66 public createOutputsList(outputs: Array<OperationParameter>): void {
68 listToscaDataDefinition: _.map(outputs, output => {
69 delete output.inputId;
76 export class OperationModel extends BEOperationModel {
77 interfaceType: string;
82 constructor(operation?: any) {
85 this.interfaceId = operation.interfaceId;
86 this.interfaceType = operation.interfaceType;
90 public displayType(): string {
91 const lastDot = this.interfaceType ? this.interfaceType.lastIndexOf('.') : -1;
92 return lastDot === -1 ? this.interfaceType : this.interfaceType.substr(lastDot + 1);
96 export class InterfaceModel {
99 operations: Array<OperationModel>;
101 constructor(interf?: any) {
103 this.type = interf.type;
104 this.uniqueId = interf.uniqueId;
105 this.operations = interf.operations;
109 public displayType(): string {
110 const lastDot = this.type ? this.type.lastIndexOf('.') : -1;
111 return lastDot === -1 ? this.type : this.type.substr(lastDot + 1);