3 export class OperationParameter {
11 constructor(param?: any) {
13 this.name = param.name;
14 this.type = param.type;
15 this.inputId = param.inputId ;
16 this.required = param.required;
17 this.property = param.property;
18 this.mandatory = param.mandatory;
23 export interface IOperationParamsList {
24 listToscaDataDefinition: Array<OperationParameter>;
27 export class WORKFLOW_ASSOCIATION_OPTIONS {
30 static EXISTING = 'EXISTING';
31 static EXTERNAL = 'EXTERNAL';
34 export class BEOperationModel {
39 inputs: IOperationParamsList;
40 outputs: IOperationParamsList;
42 workflowAssociationType: string;
44 workflowVersionId: string;
51 constructor(operation?: any) {
53 this.name = operation.name;
54 this.description = operation.description;
55 this.uniqueId = operation.uniqueId;
57 this.inputs = operation.inputs;
58 this.outputs = operation.outputs;
60 this.workflowAssociationType = operation.workflowAssociationType;
61 this.workflowId = operation.workflowId;
62 this.workflowVersionId = operation.workflowVersionId;
63 this.implementation = operation.implementation || {};
67 public createInputsList(inputs: Array<OperationParameter>): void {
69 listToscaDataDefinition: inputs
73 public createOutputsList(outputs: Array<OperationParameter>): void {
75 listToscaDataDefinition: _.map(outputs, output => {
76 delete output.inputId;
83 export class OperationModel extends BEOperationModel{
84 interfaceType: string;
86 operationType: string;
89 artifactFileName?: string;
92 inputParams: IOperationParamsList;
93 outputParams: IOperationParamsList;
96 workflowVersionId: string;
98 protected OperationTypeEnum: Array<String> = [
106 constructor(operation?: any) {
109 this.interfaceId = operation.interfaceId;
110 this.interfaceType = operation.interfaceType;
111 this.description = operation.description;
112 this.inputParams = operation.inputParams;
113 this.operationType = operation.operationType;
114 this.outputParams = operation.outputParams;
115 this.uniqueId = operation.uniqueId;
116 this.workflowId = operation.workflowId;
117 this.workflowVersionId = operation.workflowVersionId;
118 this.artifactFileName = operation.artifactFileName;
119 this.artifactData = operation.artifactData;
123 public displayType(): string {
124 return displayType(this.interfaceType);
127 public createInputParamsList(inputParams: Array<OperationParameter>): void {
129 listToscaDataDefinition: inputParams
133 public createOutputParamsList(outputParams: Array<OperationParameter>): void {
134 this.outputParams = {
135 listToscaDataDefinition: outputParams
140 export interface CreateOperationResponse extends OperationModel {
141 artifactUUID: string;
144 export class InterfaceModel {
147 operations: Array<OperationModel>;
149 constructor(interf?: any) {
151 this.type = interf.type;
152 this.uniqueId = interf.uniqueId;
153 this.operations = interf.operations;
157 public displayType(): string {
158 return displayType(this.type);
162 const displayType = (type:string) => type && type.substr(type.lastIndexOf('.') + 1);