modify rest taks config info, and enable edit rest task properties.component.css
Issue-ID: SDC-897
Change-Id: Icad8c1ee60d7572f311d5cba97cda6b2144a7469
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
import { ModalModule } from "ngx-bootstrap/modal";
import { WorkflowConfigService } from "./services/workflow-config.service";
import { RestTaskComponent } from "./components/property/rest-task/rest-task.component";
-import { RestTaskParametersComponent } from "./components/property/rest-task/rest-task-parameters/rest-task-parameters.component";
-import { ParameterTreeComponent } from "./components/parameter-tree/parameter-tree.component";
import { EditablePropertyComponent } from "./components/editable-property/editable-property.component";
import { SwaggerTreeConverterService } from "./services/swagger-tree-converter.service";
import { IntermediateCatchEventComponent } from "./components/property/intermediate-catch-event/intermediate-catch-event.component";
import { ContainerComponent } from './components/container/container.component';
import { RestService } from './services/rest.service';
import { ResizableDirective } from './directive/resizeable/resizable.directive';
+import { StartEventComponent } from './components/property/start-event/start-event.component';
+import { NodeParametersComponent } from './components/node-parameters/node-parameters.component';
+import { ParameterTreeComponent } from './components/node-parameters/parameter-tree/parameter-tree.component';
@NgModule({
declarations: [
MicroserviceDetailComponent,
MicroserviceListComponent,
NodeComponent,
+ NodeParametersComponent,
ParameterComponent,
ParameterTreeComponent,
PropertiesComponent,
RestTaskComponent,
- RestTaskParametersComponent,
ScriptTaskComponent,
+ StartEventComponent,
SequenceFlowComponent,
StartEventParametersComponent,
ToolbarComponent,
-->
<div class="btn-left">
- <p-splitButton [label]="currentWorkflow" icon="fa-arrows" (onClick)="showWorkflows()" [model]="getWorkflows()"></p-splitButton>
+ <p-splitButton [label]="getCurrentPlanName()" icon="fa-arrows" (onClick)="showWorkflows()" [model]="workflows"></p-splitButton>
</div>
<div class="btn-right">
<button type="button" class="btn white" (click)="save()">
export class MenusComponent {
@ViewChild(MicroserviceComponent) public microserviceComponent: MicroserviceComponent;
@ViewChild(WorkflowsComponent) public workflowsComponent: WorkflowsComponent;
- public currentWorkflow = 'Workflows';
+ public currentWorkflowId : number;
public workflows = [];
constructor(private broadcastService: BroadcastService, private workflowService: WorkflowService) {
if(wfs) {
wfs.forEach((value, key, map) => {
this.workflows.push({label: value.planName, command: () => {
- this.workflowSelected(value.planName, value.plan);
+ this.workflowSelected(key, value.plan);
}});
});
}
this.workflowsComponent.show();
}
- public getWorkflows() {
- const workflows = this.workflowService.getWorkflows();
- if(workflows) {
- const options = [];
- workflows.forEach((value, key, map) => {
- options.push({label: value.planName, command: () => {
- console.log(`${value.planName} selected`);
- this.workflowSelected(value.planName, value.plan);
- }});
- });
- return options;
- } else {
- return [];
- }
+ public workflowSelected(planId: number, planModel: PlanModel) {
+
+ this.broadcastService.broadcast(this.broadcastService.planModel, planModel);
+ this.broadcastService.broadcast(this.broadcastService.planId, planId);
}
- public workflowSelected(planName: string, workflow: PlanModel) {
- this.currentWorkflow = planName;
- this.broadcastService.broadcast(this.broadcastService.planModel, workflow);
+ public getCurrentPlanName() {
+ let planName = this.workflowService.getPlanName(this.currentWorkflowId);
+ return planName ? planName : 'Workflows'
}
public download() {
- const filename = this.currentWorkflow + '.json';
+ const filename = this.getCurrentPlanName() + '.json';
const content = JSON.stringify(this.workflowService.planModel);
var eleLink = document.createElement('a');
eleLink.download = filename;
--- /dev/null
+<!--\r
+/*******************************************************************************\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ * ZTE - initial API and implementation and/or initial documentation\r
+ *******************************************************************************/\r
+-->\r
+<b4t-parameter *ngFor="let param of pathParams" [param]="param" [valueSource]= "inputSources" [planItems]="planItems"></b4t-parameter>\r
+<hr *ngIf="pathParams.length > 0">\r
+<b4t-parameter *ngFor="let param of queryParams" [param]="param" [valueSource]= "inputSources" [planItems]="planItems"></b4t-parameter>\r
+\r
+<b4t-parameter-tree [restConfigId]="restConfigId" [parameters]="inputParams" [valueSource]="inputSources"\r
+ [planItems]="planItems"></b4t-parameter-tree>\r
+<b4t-parameter-tree [restConfigId]="restConfigId" [parameters]="outputParams" [valueSource]="outputSources"\r
+ [planItems]="planItems"></b4t-parameter-tree>\r
--- /dev/null
+/**\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ * ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+\r
+import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';\r
+import { TreeNode } from 'primeng/primeng';\r
+\r
+import { PlanTreeviewItem } from '../../model/plan-treeview-item';\r
+import { Swagger, SwaggerResponse } from '../../model/swagger';\r
+import { ValueSource } from '../../model/value-source.enum';\r
+import { RestParameter } from '../../model/workflow/rest-parameter';\r
+import { BroadcastService } from '../../services/broadcast.service';\r
+import { SwaggerTreeConverterService } from '../../services/swagger-tree-converter.service';\r
+import { RestService } from "../../services/rest.service";\r
+\r
+/**\r
+ * property component presents information of a workflow node.\r
+ * the presented information can be edit in this component.\r
+ * it may load information dynamically. the content may be different for different node type.\r
+ */\r
+@Component({\r
+ selector: 'b4t-node-parameters',\r
+ styleUrls: ['./node-parameters.component.css'],\r
+ templateUrl: 'node-parameters.component.html',\r
+})\r
+export class NodeParametersComponent implements OnChanges {\r
+ @Input() public swaggerInput: RestParameter[];\r
+ @Input() public swaggerOutput: SwaggerResponse[];\r
+ @Input() public restConfigId: string;\r
+ @Input() public planItems: PlanTreeviewItem[];\r
+\r
+ public inputSources: ValueSource[] = [ValueSource.String, ValueSource.Variable, ValueSource.Topology, ValueSource.Plan];\r
+ public outputSources: ValueSource[] = [ValueSource.Topology, ValueSource.Plan];\r
+ public valueSource = ValueSource;\r
+ public pathParams: any[] = [];\r
+ public queryParams: any[] = [];\r
+ public inputParams: TreeNode[] = [];\r
+ public outputParams: TreeNode[] = [];\r
+\r
+ private index = 1;\r
+\r
+ constructor(private broadcastService: BroadcastService,\r
+ private restService: RestService,\r
+ private swaggerTreeConverterService: SwaggerTreeConverterService) {\r
+ }\r
+\r
+ public ngOnChanges(changes: SimpleChanges): void {\r
+ if (changes.swaggerInput && changes.swaggerInput.currentValue) {\r
+ this.resetRequestParams(changes.swaggerInput.currentValue);\r
+ }\r
+ if (changes.swaggerOutput && changes.swaggerOutput.currentValue) {\r
+ this.resetResponseParams(changes.swaggerOutput.currentValue);\r
+ }\r
+ }\r
+\r
+ public resetRequestParams(parameters: RestParameter[]) {\r
+ this.pathParams = [];\r
+ this.queryParams = [];\r
+ this.inputParams = [];\r
+\r
+ parameters.forEach(param => {\r
+ if (param.position === 'path') {\r
+ this.pathParams.push(param);\r
+ } else if (param.position === 'query') {\r
+ this.queryParams.push(param);\r
+ } else if (param.position === 'body') {\r
+ const requestTreeNode = this.swaggerTreeConverterService\r
+ .schema2TreeNode(this.restService.getSwaggerInfo(this.restConfigId), 'Request Param', param.schema, param.value);\r
+ param.value = requestTreeNode.value;\r
+ this.inputParams.push(requestTreeNode);\r
+ } else {\r
+ // TODO others param types not supported\r
+ console.log('Unsupport parameter position(in):' + param.position);\r
+ }\r
+ });\r
+ }\r
+\r
+ public resetResponseParams(responses: SwaggerResponse[]) {\r
+ this.outputParams = [];\r
+ if (0 < responses.length && responses[0].schema) {\r
+ const treeNode = this.swaggerTreeConverterService\r
+ .schema2TreeNode(this.restService.getSwaggerInfo(this.restConfigId), 'Response Params', responses[0].schema, {});\r
+ this.outputParams.push(treeNode);\r
+ }\r
+ }\r
+}\r
--- /dev/null
+<p-tree *ngIf="parameters.length > 0" [value]="parameters">\r
+ <ng-template let-node pTemplate="default">\r
+ <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="valueSource" [planItems]="planItems"\r
+ [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)" (delete)="deleteTreeNode(node)"></b4t-parameter>\r
+ </ng-template>\r
+\r
+ <ng-template let-node pTemplate="array">\r
+ <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="getObjectValueSource()" [planItems]="planItems"\r
+ [canInsert]="canInsert(node)" [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)"\r
+ (insert)="addChildNode4ObjectArray(node)" (delete)="deleteTreeNode(node)"></b4t-parameter>\r
+ </ng-template>\r
+\r
+ <ng-template let-node pTemplate="object">\r
+ <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="getObjectValueSource()" [planItems]="planItems"\r
+ [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)" (delete)="deleteTreeNode(node)"></b4t-parameter>\r
+ </ng-template>\r
+\r
+ <ng-template let-node pTemplate="map">\r
+ <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="getObjectValueSource()" [planItems]="planItems"\r
+ [canInsert]="canInsert(node)" [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)"\r
+ (insert)="addChildNode4DynamicObject(node)" (delete)="deleteTreeNode(node)"></b4t-parameter>\r
+ </ng-template>\r
+</p-tree>\r
--- /dev/null
+/**\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ * ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+\r
+import { ChangeDetectionStrategy, Component, Input, OnChanges, Output, SimpleChange, SimpleChanges } from '@angular/core';\r
+import { TreeNode } from 'primeng/primeng';\r
+\r
+import { PlanTreeviewItem } from '../../../model/plan-treeview-item';\r
+import { ValueSource } from '../../../model/value-source.enum';\r
+import { ValueType } from '../../../model/value-type.enum';\r
+import { Parameter } from '../../../model/workflow/parameter';\r
+import { SwaggerTreeConverterService } from '../../../services/swagger-tree-converter.service';\r
+import { WorkflowUtil } from '../../../util/workflow-util';\r
+import { Swagger } from "../../../model/swagger";\r
+import { RestService } from "../../../services/rest.service";\r
+\r
+/**\r
+ * parameter tree presents parameter of task node's input or output parameters.\r
+ */\r
+@Component({\r
+ selector: 'b4t-parameter-tree',\r
+ styleUrls: ['./parameter-tree.component.css'],\r
+ templateUrl: 'parameter-tree.component.html',\r
+ changeDetection: ChangeDetectionStrategy.OnPush\r
+})\r
+export class ParameterTreeComponent implements OnChanges {\r
+ @Input() public parameters: TreeNode[];\r
+ @Input() public restConfigId: string;\r
+ @Input() public valueSource: ValueSource[];\r
+ @Input() public planItems: PlanTreeviewItem[];\r
+\r
+ constructor(private restService: RestService, private swaggerTreeConverterService: SwaggerTreeConverterService) { }\r
+\r
+ public ngOnChanges(changes: SimpleChanges) {\r
+ }\r
+\r
+ public getParameter(node: any): Parameter {\r
+ // console.log('Parameter init:' + node.label +'.'+ node.type+'.'+JSON.stringify(node.value.value)+'.'+node.value.valueSource);\r
+\r
+ return new Parameter(node.label, node.value.value, node.value.valueSource, node.definition.type, node.definition.reqquired);\r
+ }\r
+\r
+\r
+ public paramChange(param: Parameter, node: any) {\r
+ // console.log('Parameter change:' + param.name + ', Node label is:' + node.label);\r
+\r
+ node.value.valueSource = param.valueSource;\r
+ node.value.value = param.value;\r
+\r
+ this.objectParameterChange(node);\r
+\r
+ if (node.label !== param.name) {\r
+ delete node.parent.value.value[node.label];\r
+ node.label = param.name;\r
+ }\r
+ if (node.parent) {\r
+ node.parent.value.value[node.label] = node.value;\r
+ }else{\r
+ // this parameter is 'request param' or 'response param'\r
+ }\r
+\r
+ }\r
+\r
+ private objectParameterChange(node: any) {\r
+ if (node.value.valueSource === ValueSource[ValueSource.Definition]) { // value will be set by node defintion\r
+ const treeNode = this.swaggerTreeConverterService.schema2TreeNode(this.getSwagger(), node.label, node.definition, node.value);\r
+ node.value = treeNode.value;\r
+ node.children = treeNode.children;\r
+ } else { // parameter value will be set by param\r
+ node.children = [];\r
+ }\r
+ }\r
+\r
+ private getSwagger(): Swagger {\r
+ return this.restService.getSwaggerInfo(this.restConfigId);\r
+ }\r
+\r
+ public addChildNode4DynamicObject(node: any) {\r
+ const copyItem = WorkflowUtil.deepClone(node.definition.additionalProperties);\r
+ const key = Object.keys(node.value.value).length;\r
+\r
+ const childrenNode = this.swaggerTreeConverterService\r
+ .schema2TreeNode(this.getSwagger(), key, copyItem);\r
+\r
+ childrenNode.keyEditable = true;\r
+ node.value.value[key] = childrenNode.value;\r
+\r
+ node.children.push(childrenNode);\r
+ }\r
+\r
+ public addChildNode4ObjectArray(node: any) {\r
+ const copyItem = WorkflowUtil.deepClone(node.definition.items);\r
+\r
+ const childrenNode = this.swaggerTreeConverterService\r
+ .schema2TreeNode(\r
+ this.getSwagger(),\r
+ node.children.length,\r
+ copyItem);\r
+\r
+ node.value.value.push(childrenNode.value);\r
+ node.children.push(childrenNode);\r
+ }\r
+\r
+ public deleteTreeNode(node: any) {\r
+ if ('array' === node.parent.type) {\r
+ // delete data\r
+ node.parent.value.value.splice(node.label, 1);\r
+ node.parent.children.splice(node.label, 1);\r
+\r
+ // update node index\r
+ node.parent.children.forEach((childNode, index) => childNode.label = index);\r
+ } else if ('map' === node.parent.type) {\r
+ delete node.parent.value.value[node.label];\r
+ for (let index = 0; index < node.parent.children.length; index++) {\r
+ const element = node.parent.children[index];\r
+ if (element.label === node.label) {\r
+ node.parent.children.splice(index, 1);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ public canInsert(node: any) {\r
+ if (node.value.valueSource !== ValueSource[ValueSource.Definition]) {\r
+ return false;\r
+ } else {\r
+ return this.isArrayObject(node) || this.isDynamicObject(node);\r
+ }\r
+ }\r
+\r
+ public canDelete(node: any) {\r
+ const parent = node.parent;\r
+ if (parent &&\r
+ (this.isArrayObject(parent) || this.isDynamicObject(parent))) {\r
+ return true;\r
+ } else {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ public getObjectValueSource(): ValueSource[] {\r
+ const result = [];\r
+ this.valueSource.forEach(source => {\r
+ if (ValueSource.String != source) {\r
+ result.push(source);\r
+ }\r
+ });\r
+ result.push(ValueSource.Definition);\r
+ return result;\r
+ }\r
+\r
+ private isArrayObject(node: any): boolean {\r
+ return node.type === 'array';\r
+ }\r
+\r
+ private isDynamicObject(node: any): boolean {\r
+ return node.type === 'map';\r
+ }\r
+}\r
+++ /dev/null
-
-<p-tree *ngIf="parameters.length > 0" [value]="parameters">
- <ng-template let-node pTemplate="default">
- <div class="row">
- <div class="col-md-11">
-
- <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="valueSource" [planItems]="planItems"
- [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)" (delete)="deleteTreeNode(node)"></b4t-parameter>
- </div>
- </div>
- </ng-template>
-
- <ng-template let-node pTemplate="array">
- <div class="row">
- <div class="col-md-11">
- <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]= "getObjectValueSource()"
- [planItems]="planItems" [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)"
- (delete)="deleteTreeNode(node)"></b4t-parameter>
- </div>
- <div class="col-md-1">
- <i class="fa fa-plus-square-o" (click)="addChildNode4ObjectArray(node)"></i>
- </div>
- </div>
- </ng-template>
-
- <ng-template let-node pTemplate="object">
- <div class="row">
- <div class="col-md-11">
- <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]= "getObjectValueSource()"
- [planItems]="planItems" [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)"
- (delete)="deleteTreeNode(node)"></b4t-parameter>
- </div>
- <div *ngIf="canAdd(node)" class="col-md-1">
- <i class="fa fa-plus-square-o" (click)="addChildNode4DynamicObject(node)"></i>
- </div>
- </div>
-
- </ng-template>
-
- <ng-template let-node pTemplate="map">
- <div class="row">
- <div class="col-md-11">
- <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]= "getObjectValueSource()"
- [planItems]="planItems" [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)"
- (delete)="deleteTreeNode(node)"></b4t-parameter>
- </div>
- <div *ngIf="canAdd(node)" class="col-md-1">
- <i *ngIf="canAdd(node)" class="fa fa-plus-square-o" (click)="addChildNode4DynamicObject(node)"></i>
- </div>
- </div>
- </ng-template>
- </p-tree>
+++ /dev/null
-/**
- * Copyright (c) 2017 ZTE Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and the Apache License 2.0 which both accompany this distribution,
- * and are available at http://www.eclipse.org/legal/epl-v10.html
- * and http://www.apache.org/licenses/LICENSE-2.0
- *
- * Contributors:
- * ZTE - initial API and implementation and/or initial documentation
- */
-
-import { Component, Input, OnChanges, Output, SimpleChange, SimpleChanges } from '@angular/core';
-import { TreeNode } from 'primeng/primeng';
-
-import { PlanTreeviewItem } from '../../model/plan-treeview-item';
-import { ValueSource } from '../../model/value-source.enum';
-import { ValueType } from '../../model/value-type.enum';
-import { Parameter } from '../../model/workflow/parameter';
-import { RestTask } from '../../model/workflow/rest-task';
-import { SwaggerTreeConverterService } from '../../services/swagger-tree-converter.service';
-import { WorkflowUtil } from '../../util/workflow-util';
-import { Swagger } from "../../model/swagger";
-import { WorkflowConfigService } from "../../services/workflow-config.service";
-import { RestService } from '../../services/rest.service';
-
-/**
- * parameter tree presents parameter of task node's input and output parameters.
- */
-@Component({
- selector: 'b4t-parameter-tree',
- styleUrls: ['./parameter-tree.component.css'],
- templateUrl: 'parameter-tree.component.html',
-})
-export class ParameterTreeComponent implements OnChanges {
- @Input() public parameters: TreeNode[];
- @Input() public task: RestTask;
- @Input() public defaultValueSource: string;
- @Input() public valueSource: ValueSource[];
- @Input() public planItems: PlanTreeviewItem[];
- @Input() public restConfigId: string;
-
- constructor(private restService: RestService, private swaggerTreeConverterService: SwaggerTreeConverterService) { }
-
- public ngOnChanges(changes: SimpleChanges) {
- // const changeParameters = changes['parameters'];
- // if (changeParameters && 0 < changeParameters.currentValue.length) {
- // this.formatParam(changeParameters.currentValue);
- // }
- }
-
- public getParameter(node: any): Parameter {
- return new Parameter(node.label,node.value.value, node.value.valueSource, node.definition.type);
- }
-
-
- public paramChange(param: Parameter, node: any) {
- node.value.valueSource = param.valueSource;
- node.value.value = param.value;
-
- this.objectParameterChange(node);
-
- if (node.label !== param.name) {
- delete node.parent.value.value[node.label];
- node.label = param.name;
- }
- if (node.parent) {
- node.parent.value.value[node.label] = node.value;
- } else {
- console.warn('Node.parent does not exists!' + JSON.stringify(node));
- }
-
- }
-
- private objectParameterChange(node: any) {
- if(node.value.valueSource === ValueSource[ValueSource.Definition]) { // value will be set by node defintion
- const treeNode = this.swaggerTreeConverterService.schema2TreeNode(this.getSwagger(), node.label, node.definition, node.value);
- node.value = treeNode.value;
- node.children = treeNode.children;
- } else { // parameter value will be set by param
- node.children = [];
- }
- }
-
- private getSwagger(): Swagger {
- return this.restService.getSwaggerInfo(this.restConfigId);
- }
-
- public getKeyParameter(node: any) {
- return new Parameter('key', node.label, ValueSource[ValueSource.String], ValueType[ValueType.String]);
- }
-
- public keyParameterChange(node: any, parameter: Parameter) {
- node.label = parameter.value;
- this.propertyKeyChanged(node, parameter.value);
- }
-
- public getValueParameter(node: any, key: string) {
- const nodeValue = node[key] ? node[key] : {
- value: '',
- valueSource: ValueSource[ValueSource.String],
- };
- node[key] = nodeValue;
- return nodeValue;
- }
-
- public valueParameterChange(node: any, key: string, parameter: Parameter) {
- node[key].value = parameter.value;
- node[key].valueSource = parameter.valueSource;
- }
-
- public addChildNode4DynamicObject(node: any) {
- const copyItem = WorkflowUtil.deepClone(node.definition.additionalProperties);
- const key = Object.keys(node.value.value).length;
-
- const childrenNode = this.swaggerTreeConverterService
- .schema2TreeNode(this.getSwagger(), key, copyItem);
-
- childrenNode.keyEditable = true;
- node.value.value[key] = childrenNode.value;
-
- node.children.push(childrenNode);
- }
-
- public propertyKeyChanged(node: any, newKey: string) {
- const value = node.parent.value.value[node.label];
- node.parent.value.value[newKey] = value;
- delete node.parent.value.value[node.label];
-
- node.label = newKey;
- }
-
- public addChildNode4ObjectArray(node: any) {
- const copyItem = WorkflowUtil.deepClone(node.definition.items);
-
- const childrenNode = this.swaggerTreeConverterService
- .schema2TreeNode(
- this.getSwagger(),
- node.children.length,
- copyItem);
-
- node.value.value.push(childrenNode.value);
- node.children.push(childrenNode);
- }
-
- public deleteTreeNode(node: any) {
- if ('array' === node.parent.type) {
- // delete data
- node.parent.value.value.splice(node.label, 1);
- node.parent.children.splice(node.label, 1);
-
- // update node index
- node.parent.children.forEach((childNode, index) => childNode.label = index);
- } else if ('map' === node.parent.type) {
- delete node.parent.value.value[node.label];
- for (let index = 0; index < node.parent.children.length; index++) {
- const element = node.parent.children[index];
- if (element.label === node.label) {
- node.parent.children.splice(index, 1);
- break;
- }
- }
- }
- }
-
- public canEditValue(node: any): boolean {
- return node.children.length === 0;
- }
-
- public editNode(node: any) {
- node.editing = true;
- }
-
- public editComplete(node: any) {
- node.editing = false;
-
- const newValueObj = JSON.parse(node.tempValue);
- for (const key in node.value.value) {
- delete node.value.value[key];
- }
-
- for (const key in newValueObj) {
- node.value.value[key] = newValueObj[key];
- }
-
- // delete all children nodes
-
- // add new nodes by new value
-
- }
-
-
-
- public canDelete(node: any) {
- const parent = node.parent;
- if (parent &&
- (this.isArrayObject(parent) || this.isDynamicObject(parent))) {
- return true;
- } else {
- return false;
- }
- }
-
- public updateObjectValue(node: any, value: string) {
- node.tempValue = value;
- // const newValueObj = JSON.parse(value);
- // for (const key in node.parameter.value) {
- // delete node.parameter.value[key];
- // }
-
- // for (const key in newValueObj) {
- // node.parameter.value[key] = newValueObj[key];
- // }
- }
-
- public getObjectValue(node) {
- return JSON.stringify(node.value.value);
- }
-
- public getObjectValueSource(): ValueSource[] {
- const result = [];
- result.push(ValueSource.Definition);
- this.valueSource.forEach(source => result.push(source));
- return result;
- }
-
- public canAdd(node: any) {
- return this.isArrayObject(node) || this.isDynamicObject(node);
- }
-
- private isArrayObject(node: any): boolean {
- return node.type === 'array';
- }
-
- private isDynamicObject(node: any): boolean {
- return node.type === 'map';
- }
-
- public getWidth(node: any) {
- if(this.canAdd(node)) {
- return {
- 'col-md-11': true
- };
- } else {
- return {
- 'col-md-12': true
- };
- }
- }
-}
* Contributors:\r
* ZTE - initial API and implementation and/or initial documentation\r
*/\r
-.ui-treenode-label {\r
- width: calc(100% - 32px) !important;\r
+ .form-control-label{\r
+ margin-bottom: 0;\r
+ width: 100px;\r
+ vertical-align: middle;\r
+}\r
+\r
+.parameter-item{\r
+ display: inline;\r
+ margin-left: 5px;\r
+ vertical-align: middle;\r
+}\r
+\r
+.form-control-required{\r
+ color: red;\r
+ height: 30px;\r
+ line-height: 30px;\r
+}\r
+\r
+.form-control-input{\r
+ width: 120px;\r
+ vertical-align: middle;\r
+}\r
+\r
+.form-control-value{\r
+ width: 160px;\r
+ display: inline-block;\r
}\r
*/\r
-->\r
\r
-<div class="form-group row">\r
- <div *ngIf="showLabel" class="col-md-3 text-md-right">\r
- <input *ngIf="canEditName" class="form-control" type="text" [(ngModel)]="param.name">\r
+<div class="form-group">\r
+ <div *ngIf="showLabel" class="parameter-item" style="margin:0;">\r
+ <label *ngIf="true === param.required" class="form-control-required">*</label>\r
+ <input *ngIf="canEditName" class="form-control form-control-input" type="text" [ngModel]="param.name" (ngModelChange)="keyChange($event)">\r
<label *ngIf="!canEditName" class="form-control-label">{{param.name}}</label>\r
</div>\r
- <div [ngClass]="valueGroupClass">\r
- <div [ngSwitch]="param.valueSource">\r
- <input *ngSwitchCase="sourceEnum[sourceEnum.String]" [ngClass]="valueClass" class="form-control"\r
- type="text" [ngModel]="param.value" (ngModelChange)="valueChange($event)">\r
- <input *ngSwitchCase="sourceEnum[sourceEnum.Variable]" [ngClass]="valueClass" class="form-control"\r
- type="text" [ngModel]="param.value" (ngModelChange)="valueChange($event)">\r
- <!-- TODO add plan and Top parameters -->\r
- <tree-select *ngSwitchCase="sourceEnum[sourceEnum.Plan]" name="simpleSelect" [items]="planOptions"\r
- childrenField="children" #simpleSelect="ngModel" [ngClass]="valueClass" class="tree-select-class"\r
- [ngModel]="planValue" (ngModelChange)="valueChange($event)"></tree-select>\r
+ <div class="parameter-item">\r
+ <div *ngIf="showValue" [ngSwitch]="param.valueSource" class="parameter-item">\r
+ <input *ngSwitchCase="sourceEnum[sourceEnum.String]" class="form-control form-control-value" type="text" [ngModel]="param.value"\r
+ (ngModelChange)="valueChange($event)">\r
+ <input *ngSwitchCase="sourceEnum[sourceEnum.Variable]" class="form-control form-control-value" type="text" [ngModel]="param.value"\r
+ (ngModelChange)="valueChange($event)">\r
+ <tree-select *ngSwitchCase="sourceEnum[sourceEnum.Plan]" name="simpleSelect" style="vertical-align:top;" [items]="planOptions" childrenField="children"\r
+ #simpleSelect="ngModel" class="form-control-value" [ngModel]="planValue" (ngModelChange)="valueChange($event)"></tree-select>\r
+ <select *ngSwitchCase="sourceEnum[sourceEnum.Topology]" class="form-control form-control-value" type="text" [ngModel]="param.value"\r
+ (ngModelChange)="valueChange($event)">\r
+ <option *ngFor="let topology of topologyOptions" value="{{topology.value}}">{{topology.name}}</option>\r
+ </select>\r
</div>\r
- <select *ngIf="showValueSource" class="form-control col-md-4" type="text" [ngModel]="param.valueSource"\r
+ <select *ngIf="showValueSource" class="form-control parameter-item" style="width:auto;" type="text" [ngModel]="param.valueSource"\r
(ngModelChange)="valueSourceChange($event)">\r
<option *ngFor="let sourceType of valueSource" value="{{sourceEnum[sourceType]}}">{{sourceEnum[sourceType]}}</option>\r
</select>\r
</div>\r
- <div *ngIf="canDelete" class="col-md-2">\r
- <button type="button" class="btn oes-red-bg pull-right" (click)="deleteParam()">\r
+ <div *ngIf="canInsert" class="parameter-item">\r
+ <button type="button" class="btn blue1" (click)="insertParam()">\r
+ <i class="fa fa-plus"></i>\r
+ </button>\r
+ </div>\r
+ <div *ngIf="canDelete" class="parameter-item">\r
+ <button type="button" class="btn oes-red-bg" (click)="deleteParam()">\r
<i class="fa fa-minus"></i>\r
</button>\r
</div>\r
* ZTE - initial API and implementation and/or initial documentation\r
*/\r
\r
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\r
+import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\r
\r
+import { PlanTreeviewItem } from '../../model/plan-treeview-item';\r
import { ValueSource } from '../../model/value-source.enum';\r
import { Parameter } from '../../model/workflow/parameter';\r
-import { DataAccessService } from "../../services/data-access/data-access.service";\r
-import { PlanTreeviewItem } from "../../model/plan-treeview-item";\r
\r
/**\r
* this component contains in property component if the corresponding node has parameter properties\r
*/\r
@Component({\r
selector: 'b4t-parameter',\r
+ styleUrls: ['./parameter.component.css'],\r
templateUrl: 'parameter.component.html',\r
})\r
-export class ParameterComponent implements OnInit {\r
+export class ParameterComponent implements OnChanges, OnInit {\r
@Input() public param: Parameter;\r
@Input() public valueSource: ValueSource[];\r
@Input() public canEditName: boolean;\r
@Input() public showLabel = true;\r
+ @Input() public canInsert: boolean;\r
@Input() public canDelete: boolean;\r
@Input() public planItems: PlanTreeviewItem[];\r
@Output() public paramChange = new EventEmitter<Parameter>();\r
+ @Output() insert: EventEmitter<Parameter> = new EventEmitter<Parameter>();\r
@Output() delete: EventEmitter<Parameter> = new EventEmitter<Parameter>();\r
\r
public sourceEnum = ValueSource;\r
public valueGroupClass;\r
public valueClass;\r
- public showValueSource: boolean = true;\r
- public planValue: any = {};\r
+ public valueSourceClass;\r
public planOptions = [];\r
+ public topologyOptions: { name: string, value: string }[] = [];\r
+ public showValue = true;\r
+ public showValueSource = true;\r
+ public planValue: any = {};\r
\r
- constructor(private dataAccessService: DataAccessService) { }\r
+ constructor() { }\r
+\r
+ public ngOnChanges(changes: SimpleChanges): void {\r
+ // if (changes.canInsert && !changes.canInsert.isFirstChange()) {\r
+ // this.resetValueGroupClass(changes.canInsert.currentValue, this.canDelete);\r
+ // }\r
+ // if (changes.canDelete && !changes.canDelete.isFirstChange()) {\r
+ // this.resetValueGroupClass(this.canInsert, changes.canDelete.currentValue);\r
+ // }\r
+ }\r
\r
public ngOnInit(): void {\r
+ // console.warn('Parameter OnInit, parameter name is:' + this.param.name);\r
if (1 === this.valueSource.length) {\r
this.showValueSource = false;\r
}\r
- this.valueClass = {\r
- 'col-md-8': this.showValueSource,\r
- 'col-md-12': !this.showValueSource\r
- };\r
-\r
- this.valueGroupClass = {\r
- 'col-md-7': this.canDelete,\r
- 'col-md-9': !this.canDelete\r
- };\r
-\r
+ // this.valueClass = {\r
+ // 'col-md-7': this.showValueSource,\r
+ // 'col-md-12': !this.showValueSource\r
+ // };\r
+ // this.resetValueGroupClass(this.canInsert, this.canDelete);\r
+ this.updateValueSource(this.param.valueSource);\r
// trans plan options to tree view items.\r
this.initPlanTreeviewItems(this.planItems);\r
if (ValueSource[ValueSource.Plan] === this.param.valueSource) {\r
}\r
}\r
\r
- public deleteParam(): void {\r
- this.delete.emit();\r
- }\r
-\r
- public valueSourceChange(valueSource: string) {\r
- this.param.valueSource = valueSource;\r
- this.valueChange(null);\r
+ public keyChange(key: string) {\r
+ this.param.name = key;\r
+ this.paramChange.emit(this.param);\r
}\r
\r
public valueChange(value: any) {\r
if (ValueSource[ValueSource.Plan] === this.param.valueSource) {\r
- if (value !== null && 'object' === typeof (value)) {\r
+ if ('object' === typeof (value)) {\r
this.planValue = value;\r
+ this.param.value = value.id;\r
} else {\r
- this.planValue = {};\r
+ this.planValue = { id: '' };\r
+ this.param.value = '';\r
}\r
- this.param.value = this.planValue.id;\r
} else {\r
this.param.value = value;\r
}\r
this.paramChange.emit(this.param);\r
}\r
\r
+ public valueSourceChange(valueSource: string) {\r
+ this.updateValueSource(valueSource);\r
+ this.param.valueSource = valueSource;\r
+ this.valueChange('');\r
+ }\r
+\r
+ public insertParam(): void {\r
+ this.insert.emit();\r
+ }\r
+\r
+ public deleteParam(): void {\r
+ this.delete.emit();\r
+ }\r
+\r
+ private updateValueSource(valueSource: string):void{\r
+ if(ValueSource[ValueSource.Definition] === valueSource){\r
+ this.showValue = false;\r
+ }else{\r
+ this.showValue = true;\r
+ }\r
+ // this.resetValueSourceClass(this.showValue);\r
+ }\r
+\r
+ private resetValueGroupClass(canInsert: boolean, canDelete: boolean): void {\r
+ // this.valueGroupClass = {\r
+ // 'col-md-5': canInsert && canDelete,\r
+ // 'col-md-7': (canInsert && !canDelete) || (!canInsert && canDelete),\r
+ // 'col-md-9': !canInsert && !canDelete\r
+ // };\r
+ }\r
+\r
private initPlanTreeviewItems(planTreeviewItems: PlanTreeviewItem[]): void {\r
this.planOptions = this.getTreeviewChild(planTreeviewItems);\r
}\r
});\r
return treeviewItems;\r
}\r
-\r
}\r
* ZTE - initial API and implementation and/or initial documentation
*/
-.wm-properties-wrapper {
+ .wm-properties-wrapper {
background-color: white;
position: fixed;
width: 500px;
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
border-radius: 0;
- overflow-y: scroll;
+ overflow: auto;
}
.edit {
*/
-->
-<div class="wm-properties-wrapper" *ngIf="show">
+ <div class="wm-properties-wrapper" *ngIf="show">
<div class="form-group row">
<b4t-editable-property class="col-md-10" [(name)]="node.name"></b4t-editable-property>
<div class="col-md-2">
</button>
</div>
</div>
- <hr>
-
+ <!-- <hr>
<div class="form-group row">
- <label class="col-md-2 form-control-label text-md-right" for="nodeType">Type</label>
- <div class="col-md-10">
- <input class="form-control" name="nodeType" disabled type="text" value="{{node.type}}"/>
+ <label class="col-md-3 form-control-label text-md-right" for="nodeType">{{'WORKFLOW.NODE_TYPE' | translate}}</label>
+ <div class="col-md-9">
+ <select class="form-control" id="nodeType" [(ngModel)]="node.type">
+ <option *ngFor="let t of nodeTypes" value="{{t}}">{{t}}</option>
+ </select>
</div>
- </div>
+ </div> -->
- <!-- TODO add property for different node types -->
-
- <b4t-start-event-parameters *ngIf="'startEvent' == node.type" [node]="node"></b4t-start-event-parameters>
- <b4t-rest-task *ngIf="node.type == 'restTask'" [node]="node" [planItems]="planItems"></b4t-rest-task>
- <b4t-intermediate-catch-event *ngIf="'intermediateCatchEvent' == node.type" [node]="node"></b4t-intermediate-catch-event>
- <b4t-script-task *ngIf="node.type == 'scriptTask'" [node]="node"></b4t-script-task>
+ <hr>
+ <div [ngSwitch]="node.type">
+ <b4t-start-event *ngSwitchCase="nodeType[nodeType.startEvent]" [node]="node"></b4t-start-event>
+ <b4t-rest-task *ngSwitchCase="nodeType[nodeType.restTask]" [node]="node" [planItems]="planTreeviewItems"></b4t-rest-task>
+ <b4t-intermediate-catch-event *ngSwitchCase="nodeType[nodeType.intermediateCatchEvent]" [node]="node"></b4t-intermediate-catch-event>
+ <b4t-script-task *ngSwitchCase="nodeType[nodeType.scriptTask]" [node]="node"></b4t-script-task>
+ </div>
</div>
* ZTE - initial API and implementation and/or initial documentation
*/
-import { AfterViewInit, Component } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
+import { TreeNode } from 'primeng/primeng';
+import { PlanTreeviewItem } from '../../model/plan-treeview-item';
+import { ValueSource } from '../../model/value-source.enum';
+import { NodeType } from '../../model/workflow/node-type.enum';
+import { Parameter } from '../../model/workflow/parameter';
import { WorkflowNode } from '../../model/workflow/workflow-node';
import { BroadcastService } from '../../services/broadcast.service';
import { JsPlumbService } from '../../services/jsplumb.service';
-import { PlanTreeviewItem } from "../../model/plan-treeview-item";
-import { ModelService } from "../../services/model.service";
+import { ModelService } from '../../services/model.service';
/**
* property component presents information of a workflow node.
styleUrls: ['./properties.component.css'],
templateUrl: 'properties.component.html',
})
-export class PropertiesComponent implements AfterViewInit {
+export class PropertiesComponent implements OnInit {
public node: WorkflowNode;
+ public planTreeviewItems: PlanTreeviewItem[];
+ public nodeType = NodeType;
+ // public nodeTypes: string[] = WorkflowNodeType;
public show = false;
public titleEditing = false;
- public planItems: PlanTreeviewItem[];
+ public valueSource = [ValueSource.String];
constructor(private broadcastService: BroadcastService,
- private jsPlumbService: JsPlumbService,
- private modelService: ModelService) {
+ private modelService: ModelService,
+ private jsPlumbService: JsPlumbService) {
}
- public ngAfterViewInit() {
- this.broadcastService.showProperty$.subscribe(show => this.show = show);
- this.broadcastService.nodeProperty$.subscribe(node => {
- this.node = node;
- this.planItems = this.modelService.getPlanParameters(this.node.id);
+ public ngOnInit() {
+ this.broadcastService.showProperty$.subscribe(element => {
+ if (element && this.modelService.isNode(element)) {
+ this.node = element as WorkflowNode;
+ // temporarily, if config info not exists then close the property panel
+ // TODOS: 1) save config info in case config info no exists on a different environment.
+ // 2) display property panel even if config info not exists for it may be adjust.
+ try {
+ this.planTreeviewItems = this.modelService.getPlanParameters(this.node.id);
+ this.show = true;
+ } catch (error) {
+ this.show = false;
+ console.log(error);
+ }
+ } else {
+ this.show = false;
+ }
});
}
+++ /dev/null
-/**
- * Copyright (c) 2017 ZTE Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and the Apache License 2.0 which both accompany this distribution,
- * and are available at http://www.eclipse.org/legal/epl-v10.html
- * and http://www.apache.org/licenses/LICENSE-2.0
- *
- * Contributors:
- * ZTE - initial API and implementation and/or initial documentation
- */
-
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { TreeNode } from 'primeng/primeng';
-
-import { Swagger } from '../../../../model/swagger';
-import { RestTask } from '../../../../model/workflow/rest-task';
-import { BroadcastService } from '../../../../services/broadcast.service';
-import { RestParameter } from "../../../../model/workflow/rest-parameter";
-import { ValueSource } from "../../../../model/value-source.enum";
-import { SwaggerTreeConverterService } from "../../../../services/swagger-tree-converter.service";
-import { PlanTreeviewItem } from "../../../../model/plan-treeview-item";
-import { WorkflowConfigService } from "../../../../services/workflow-config.service";
-import { RestService } from '../../../../services/rest.service';
-
-/**
- * property component presents information of a workflow node.
- * the presented information can be edit in this component.
- * it may load information dynamically. the content may be different for different node type.
- */
-@Component({
- selector: 'b4t-rest-task-parameters',
- templateUrl: 'rest-task-parameters.component.html',
-})
-export class RestTaskParametersComponent implements OnInit {
- @Input() public task: RestTask;
- @Input() public planItems: PlanTreeviewItem[];
-
- public inputSources: ValueSource[] = [ValueSource.String, ValueSource.Variable, ValueSource.Plan];
- public requestParameters: RestParameter[] = []; // not include body parameter
- public bodyParameter: TreeNode[] = [];
- public responseParameter: TreeNode[] = [];
- public valueSource = ValueSource;
-
- private index = 1;
-
- constructor(private broadcastService: BroadcastService,
- private restService: RestService,
- private swaggerTreeConverterService: SwaggerTreeConverterService) {
- }
-
- public ngOnInit() {
- this.broadcastService.nodeTaskChange$.subscribe(() => {
- this.resetRequestParams();
- this.resetResponseParams();
- });
- }
-
- public resetRequestParams() {
- this.requestParameters = [];
- this.bodyParameter = [];
-
- this.task.parameters.forEach(param => {
- if (param.position === 'body') {
- const requestTreeNode = this.swaggerTreeConverterService
- .schema2TreeNode(this.restService.getSwaggerInfo(this.task.restConfigId), 'Request Param', param.schema, param.value);
- param.value = requestTreeNode.value;
- param.value = param.schema.value;
- this.bodyParameter.push(requestTreeNode);
- } else {
- this.requestParameters.push(param);
- }
- });
- }
-
- public resetResponseParams() {
- // TODO add response body handler
- }
-}
<div class="form-group row">
<label class="col-md-3 form-control-label text-md-right">Service</label>
<div class="col-md-9">
- <select class="form-control" [ngModel]="selectedMicroservice"
- (ngModelChange)="serviceChanged($event)">
- <option *ngFor="let microservice of microservices" [ngValue]=microservice>{{getText4Microservice(microservice)}}</option>
+ <select class="form-control" [ngModel]="node.restConfigId" (ngModelChange)="serviceChanged($event)">
+ <option *ngFor="let restConfig of restService.getRestConfigs()" value="{{restConfig.id}}">{{restConfig.id}}</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-md-3 form-control-label text-md-right">Path</label>
<div class="col-md-9">
- <select class="form-control" [ngModel]="node.url"
- (ngModelChange)="urlChanged($event)">
+ <select class="form-control" [ngModel]="node.path" (ngModelChange)="pathChanged($event)">
<option *ngFor="let interface of restInterfaces" value="{{interface}}">{{interface}}</option>
</select>
</div>
<div class="form-group row">
<label class="col-md-3 form-control-label text-md-right">Method</label>
<div class="col-md-9">
- <select class="form-control" [ngModel]="node.method"
- (ngModelChange)="methodChanged($event)">
+ <select class="form-control" [ngModel]="node.method" (ngModelChange)="methodChanged($event)">
<option *ngFor="let operation of restOperations" value="{{operation}}">{{operation}}</option>
</select>
</div>
<hr>
<div class="ui-fluid">
- <b4t-rest-task-parameters [task]="node" [planItems]="planItems"></b4t-rest-task-parameters>
+ <b4t-node-parameters [restConfigId]="this.node.restConfigId" [swaggerInput]="this.node.parameters" [swaggerOutput]="this.node.responses" [planItems]="planItems"></b4t-node-parameters>
</div>
this.restInterfaces.push(key);
}
this.loadOperations();
+ } else {
+ console.log('swagger not exist');
}
}
}
-<!--
-/*******************************************************************************
- * Copyright (c) 2017 ZTE Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and the Apache License 2.0 which both accompany this distribution,
- * and are available at http://www.eclipse.org/legal/epl-v10.html
- * and http://www.apache.org/licenses/LICENSE-2.0
- *
- * Contributors:
- * ZTE - initial API and implementation and/or initial documentation
- *******************************************************************************/
--->
-<b4t-parameter *ngFor="let param of requestParameters" [param]="param" [valueSource]= "inputSources" [planItems]="planItems"></b4t-parameter>
-
-<!-- body parameter -->
-<b4t-parameter-tree [task]="task" [parameters]="bodyParameter" [valueSource]="inputSources"
- [planItems]="planItems" [defaultValueSource]="valueSource[valueSource.String]"></b4t-parameter-tree>
+<!--\r
+/*******************************************************************************\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ * ZTE - initial API and implementation and/or initial documentation\r
+ *******************************************************************************/\r
+-->\r
+\r
+<div class="form-group row">\r
+ <div class="col-md-10"></div>\r
+ <div class="col-md-2">\r
+ <button (click)="create();" type="button" class="btn blue1 pull-right">\r
+ <i class="fa fa-plus"></i>\r
+ </button>\r
+ </div>\r
+</div>\r
+\r
+<b4t-parameter *ngFor="let param of node.parameters; let i = index;" [param]="param" [canEditName]="true"\r
+ [valueSource]="sources" [canDelete]="true" (delete)="delete(i)"></b4t-parameter>\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ * ZTE - initial API and implementation and/or initial documentation\r
+ *******************************************************************************/\r
+import { Component, Input } from '@angular/core';\r
+import { Subscription } from 'rxjs/Subscription';\r
+\r
+import { ValueSource } from '../../../model/value-source.enum';\r
+import { Parameter } from '../../../model/workflow/parameter';\r
+import { StartEvent } from '../../../model/workflow/start-event';\r
+import { BroadcastService } from '../../../services/broadcast.service';\r
+import { WorkflowUtil } from '../../../util/workflow-util';\r
+\r
+@Component({\r
+ selector: 'b4t-start-event',\r
+ templateUrl: 'start-event.component.html',\r
+})\r
+export class StartEventComponent {\r
+ @Input() public node: StartEvent;\r
+ public sources: ValueSource[] = [ValueSource.String];\r
+\r
+ public create(): void {\r
+ this.node.parameters.push(new Parameter('', '', ValueSource[ValueSource.String]));\r
+ }\r
+\r
+ public delete(index: number): void {\r
+ this.node.parameters.splice(index, 1);\r
+ }\r
+}\r
public workflows = new Subject<Map<number, any>>();
public workflows$ = this.workflows.asObservable();
+ public planId = new Subject<number>();
+ public planId$ = this.planId.asObservable();
+
public planModel = new Subject<PlanModel>();
public planModel$ = this.planModel.asObservable();
- public showProperty = new Subject<boolean>();
+ public showProperty = new Subject<WorkflowElement>();
public showProperty$ = this.showProperty.asObservable();
public updateModelRestConfig = new Subject<RestConfig[]>();
\r
-export const workflowFJH = {"id":"fjh","name":"fjh","nodes":[{"id":"node0","name":"startEvent","type":"startEvent","position":{"top":31,"left":31,"width":200,"height":100},"connection":[{"sourceRef":"node0","targetRef":"node23"}],"parameters":[{"name":"vlCount","value":"","valueSource":"String","type":"String"},{"name":"vnfCount","value":"","valueSource":"String","type":"String"},{"name":"sfcCount","value":"","valueSource":"String","type":"String"},{"name":"object_context","value":"","valueSource":"String","type":"String"},{"name":"nsInstanceId","value":"","valueSource":"String","type":"String"},{"name":"object_additionalParamForNs","value":"","valueSource":"String","type":"String"},{"name":"object_additionalParamForVnf","value":"","valueSource":"String","type":"String"},{"name":"jobId","value":"","valueSource":"String","type":"String"},{"name":"sdnControllerId","value":"","valueSource":"String","type":"String"},{"name":"templateid","value":"","valueSource":"String","type":"String"},{"name":"instanceid","value":"","valueSource":"String","type":"String"},{"name":"sdnolcmurl","value":"","valueSource":"String","type":"String"},{"name":"statusurl","value":"","valueSource":"String","type":"String"}]},{"id":"node1","name":"endEvent","type":"endEvent","position":{"top":668,"left":955,"width":200,"height":100},"connection":[]},{"id":"node2","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":120,"left":169,"width":200,"height":100},"connection":[{"sourceRef":"node2","targetRef":"node3","condition":"${ vl_index <= vlCount and vl_status='active' }","name":"未完成"},{"sourceRef":"node2","targetRef":"node4","condition":"!( vl_index <= vlCount and vl_status='active' )","name":"创建完成"}]},{"id":"node3","name":"createVL","type":"restTask","position":{"top":213,"left":142,"width":200,"height":100},"connection":[{"sourceRef":"node3","targetRef":"node11"}],"produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"body","valueSource":"String","type":"String","position":"body","schema":{"$ref":"#/definitions/VlPostRequest"}}],"responses":[{"description":"","schema":{"$ref":"#/definitions/VlPostResponse"}}],"restConfigId":"nslcm","path":"/ns/vls","method":"post"},{"id":"node4","name":"restTask","type":"restTask","position":{"top":115,"left":358,"width":200,"height":100},"connection":[{"sourceRef":"node4","targetRef":"node5"}],"produces":[],"consumes":[],"parameters":[],"responses":[],"restConfigId":"nslcm","path":"","method":""},{"id":"node5","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":212,"left":383,"width":200,"height":100},"connection":[{"sourceRef":"node5","targetRef":"node6","condition":"未完成"},{"sourceRef":"node5","targetRef":"node12","condition":"创建完成"}]},{"id":"node6","name":"createVNF","type":"restTask","position":{"top":306,"left":352,"width":200,"height":100},"connection":[{"sourceRef":"node6","targetRef":"node7"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node7","name":"intermediateCatchEvent","type":"intermediateCatchEvent","position":{"top":558,"left":443,"width":200,"height":100},"connection":[{"sourceRef":"node7","targetRef":"node8"}],"timerEventDefinition":{"type":"timeDuration"}},{"id":"node8","name":"query_vnf nslcm","type":"restTask","position":{"top":639,"left":216,"width":200,"height":100},"connection":[{"sourceRef":"node8","targetRef":"node9"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node9","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":539,"left":264,"width":200,"height":100},"connection":[{"sourceRef":"node9","targetRef":"node7","condition":"未完成"},{"sourceRef":"node9","targetRef":"node10","condition":"已完成"}]},{"id":"node10","name":"scriptTask","type":"scriptTask","position":{"top":303,"left":239,"width":200,"height":100},"connection":[{"sourceRef":"node10","targetRef":"node5"}]},{"id":"node11","name":"scriptTask","type":"scriptTask","position":{"top":207,"left":34,"width":200,"height":100},"connection":[{"sourceRef":"node11","targetRef":"node2"}]},{"id":"node12","name":"restTask","type":"restTask","position":{"top":205,"left":732,"width":200,"height":100},"connection":[{"sourceRef":"node12","targetRef":"node13"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node13","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":287,"left":757,"width":200,"height":100},"connection":[{"sourceRef":"node13","targetRef":"node14","condition":"未结束"},{"sourceRef":"node13","targetRef":"node18","condition":"已结束"}]},{"id":"node14","name":"createSfc","type":"restTask","position":{"top":440,"left":726,"width":200,"height":100},"connection":[{"sourceRef":"node14","targetRef":"node15"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node15","name":"intermediateCatchEvent","type":"intermediateCatchEvent","position":{"top":551,"left":754,"width":200,"height":100},"connection":[{"sourceRef":"node15","targetRef":"node16"}],"timerEventDefinition":{"type":"timeDuration"}},{"id":"node16","name":"restTask","type":"restTask","position":{"top":642,"left":589,"width":200,"height":100},"connection":[{"sourceRef":"node16","targetRef":"node17"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node17","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":551,"left":614,"width":200,"height":100},"connection":[{"sourceRef":"node17","targetRef":"node15","condition":"未结束"},{"sourceRef":"node17","targetRef":"node19","condition":"已结束"}]},{"id":"node18","name":"restTask","type":"restTask","position":{"top":282,"left":927,"width":200,"height":100},"connection":[{"sourceRef":"node18","targetRef":"node20"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node19","name":"scriptTask","type":"scriptTask","position":{"top":275,"left":588,"width":200,"height":100},"connection":[{"sourceRef":"node19","targetRef":"node13"}]},{"id":"node20","name":"Assign_all_status","type":"scriptTask","position":{"top":380,"left":928,"width":200,"height":100},"connection":[{"sourceRef":"node20","targetRef":"node21"}]},{"id":"node21","name":"post_do","type":"restTask","position":{"top":497,"left":929,"width":200,"height":100},"connection":[{"sourceRef":"node21","targetRef":"node22"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node22","name":"jobstatus","type":"restTask","position":{"top":586,"left":927,"width":200,"height":100},"connection":[{"sourceRef":"node22","targetRef":"node1"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node23","name":"scriptTask","type":"scriptTask","position":{"top":16,"left":143,"width":200,"height":100},"connection":[{"sourceRef":"node23","targetRef":"node2"}],"scriptFormate":"javascript","script":"execution.setVariable(\"vl_index\", 1);\nexecution.setVariable(\"vl_status\", \"active\");"}],"configs":{"microservices":[{"name":"nslcm","version":"v1","swaggerJson":"{\"info\":{\"version\":\"1.0.0\",\"contact\":{\"url\":\"https://gerrit.onap.org/r/#/admin/projects/vfc/nfvo/lcm\",\"name\":\"ONAP VFC team\",\"email\":\"onap-discuss@lists.onap.org\"},\"description\":\"VFC Network Service Lifecycle Management Rest API.\",\"title\":\"ONAP VFC Network Service Lifecycle Management API\"},\"paths\":{\"/ns/sfcs/{sfcInstId}\":{\"delete\":{\"responses\":{\"204\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/DeleteResponse\"}},\"404\":{\"description\":\"the sfc instance id is wrong\"},\"500\":{\"description\":\"the url is invalid\"}},\"description\":\"\",\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"\",\"in\":\"path\",\"name\":\"sfcInstId\"}],\"produces\":[\"application/json\"],\"tags\":[\"sfc\"],\"summary\":\"delete sfc\",\"consumes\":[\"application/json\"],\"operationId\":\"delete_sfc\"},\"get\":{\"responses\":{\"200\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/SfcInfo\"}},\"404\":{\"description\":\"the sfc instance id is wrong\"},\"500\":{\"description\":\"the url is invalid\"}},\"description\":\"\",\"parameters\":[{\"description\":\"sfc instance id\",\"required\":true,\"type\":\"string\",\"name\":\"sfcInstId\",\"in\":\"path\"}],\"produces\":[\"application/json\"],\"tags\":[\"sfc\"],\"summary\":\"query the specified sfc info\",\"consumes\":[\"application/json\"],\"operationId\":\"query_sfc\"}},\"/ns/{nsInstanceId}/postdeal\":{\"post\":{\"responses\":{\"202\":{\"description\":\"\"}},\"description\":\"\",\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"\",\"in\":\"path\",\"name\":\"nsInstanceId\"},{\"schema\":{\"$ref\":\"#/definitions/NSInstPostDetailRequest\"},\"description\":\"request param\",\"required\":true,\"name\":\"body\",\"in\":\"body\"}],\"produces\":[\"application/json\"],\"tags\":[\"postdeal\"],\"summary\":\"ns postdeal\",\"consumes\":[\"application/json\"],\"operationId\":\"ns_postdeal\"}},\"/ns/vnfs\":{\"post\":{\"responses\":{\"201\":{\"description\":\"\",\"schema\":{\"$ref\":\"#/definitions/VnfPostResponse\"}}},\"description\":\"\",\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/VnfPostRequest\"},\"description\":\"instantiate request param\",\"required\":true,\"name\":\"body\",\"in\":\"body\"}],\"produces\":[\"application/json\"],\"tags\":[\"vnf\"],\"summary\":\"vnf create\",\"consumes\":[\"application/json\"],\"operationId\":\"create_vnf\"}},\"/ns/{ns_instance_id}/heal\":{\"post\":{\"responses\":{\"202\":{\"description\":\"\",\"schema\":{\"$ref\":\"#/definitions/JobInfo\"}},\"500\":{\"description\":\"the url is invalid\"}},\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"Identifier of the NS instance.\",\"in\":\"path\",\"name\":\"ns_instance_id\"},{\"schema\":{\"$ref\":\"#/definitions/NsHealRequest\"},\"description\":\"healVnfData\",\"required\":true,\"name\":\"healVnfData\",\"in\":\"body\"}],\"tags\":[\"ns\"],\"description\":\"ns heal\",\"summary\":\"ns heal\",\"operationId\":\"ns_heal\"}},\"/jobs/{jobId}\":{\"post\":{\"responses\":{\"202\":{\"description\":\"\"}},\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"\",\"in\":\"path\",\"name\":\"jobId\"},{\"schema\":{\"$ref\":\"#/definitions/JobProgressRequest\"},\"description\":\"request param\",\"required\":true,\"name\":\"body\",\"in\":\"body\"}],\"tags\":[\"job\"],\"description\":\"\",\"summary\":\"jobstatus\",\"operationId\":\"post_jobprogress\"},\"get\":{\"responses\":{\"202\":{\"description\":\"\",\"schema\":{\"$ref\":\"#/definitions/JobDetailInfo\"}}},\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"job Id\",\"in\":\"path\",\"name\":\"jobId\"},{\"required\":true,\"type\":\"string\",\"description\":\"job response message id\",\"in\":\"query\",\"name\":\"responseId\"}],\"tags\":[\"job\"],\"description\":\"\",\"summary\":\"jobstatus\",\"operationId\":\"get_jobstatus\"}},\"/ns/vls/{vlId}\":{\"delete\":{\"responses\":{\"204\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/DeleteVlResponse\"}},\"404\":{\"description\":\"the vl instance id is wrong\"},\"500\":{\"description\":\"the url is invalid\"}},\"description\":\"\",\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"\",\"in\":\"path\",\"name\":\"vlId\"}],\"produces\":[\"application/json\"],\"tags\":[\"vl\"],\"summary\":\"delete vl\",\"consumes\":[\"application/json\"],\"operationId\":\"delete_vl\"},\"get\":{\"responses\":{\"200\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/VlInfo\"}},\"404\":{\"description\":\"the vl instance id is wrong\"},\"500\":{\"description\":\"the url is invalid\"}},\"description\":\"\",\"parameters\":[{\"description\":\"vl instance id\",\"required\":true,\"type\":\"string\",\"name\":\"vlId\",\"in\":\"path\"}],\"produces\":[\"application/json\"],\"tags\":[\"vl\"],\"summary\":\"query the specified vl info\",\"consumes\":[\"application/json\"],\"operationId\":\"query_vl\"}},\"/ns/vls\":{\"post\":{\"responses\":{\"201\":{\"description\":\"\",\"schema\":{\"$ref\":\"#/definitions/VlPostResponse\"}}},\"description\":\"\",\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/VlPostRequest\"},\"description\":\"instantiate request param\",\"required\":true,\"name\":\"body\",\"in\":\"body\"}],\"produces\":[\"application/json\"],\"tags\":[\"vl\"],\"summary\":\"vl create\",\"consumes\":[\"application/json\"],\"operationId\":\"create_vl\"}},\"/ns/sfcs\":{\"post\":{\"responses\":{\"201\":{\"description\":\"\",\"schema\":{\"$ref\":\"#/definitions/SfcPostResponse\"}}},\"description\":\"\",\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/SfcPostRequest\"},\"description\":\"request param\",\"required\":true,\"name\":\"body\",\"in\":\"body\"}],\"produces\":[\"application/json\"],\"tags\":[\"sfc\"],\"summary\":\"sfc create\",\"consumes\":[\"application/json\"],\"operationId\":\"create_sfc\"}},\"/ns/{ns_instance_id}\":{\"delete\":{\"responses\":{\"204\":{\"description\":\"The NS instance resource and the associated NS identifier were deleted successfully.\"}},\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"Identifier of the NS instance.\",\"in\":\"path\",\"name\":\"ns_instance_id\"}],\"tags\":[\"ns\"],\"description\":\"ns delete\",\"summary\":\"ns delete\",\"operationId\":\"ns_delete\"},\"get\":{\"responses\":{\"200\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/NsInstanceInfo\"}}},\"parameters\":[],\"tags\":[\"ns\"],\"description\":\"ns get\",\"summary\":\"ns get\",\"operationId\":\"ns_instance_get\"}},\"/ns/vnfs/{vnfInstId}\":{\"delete\":{\"responses\":{\"204\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/DeleteResponse\"}},\"404\":{\"description\":\"the vl instance id is wrong\"},\"500\":{\"description\":\"the url is invalid\"}},\"description\":\"\",\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"\",\"in\":\"path\",\"name\":\"vnfInstId\"}],\"produces\":[\"application/json\"],\"tags\":[\"vnf\"],\"summary\":\"delete vnf\",\"consumes\":[\"application/json\"],\"operationId\":\"delete_vnf\"},\"get\":{\"responses\":{\"200\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/VnfInfo\"}},\"404\":{\"description\":\"the vnf instance id is wrong\"},\"500\":{\"description\":\"the url is invalid\"}},\"description\":\"\",\"parameters\":[{\"description\":\"vnf instance id\",\"required\":true,\"type\":\"string\",\"name\":\"vnfInstId\",\"in\":\"path\"}],\"produces\":[\"application/json\"],\"tags\":[\"vnf\"],\"summary\":\"query the specified vnf info\",\"consumes\":[\"application/json\"],\"operationId\":\"query_vnf\"}},\"/ns\":{\"post\":{\"responses\":{\"200\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/NsCreateResponse\"}}},\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/NsCreateRequest\"},\"description\":\"NS Instance Create Request\",\"required\":true,\"name\":\"NSCreateRequest\",\"in\":\"body\"}],\"tags\":[\"ns\"],\"description\":\"ns create\",\"summary\":\"ns create\",\"operationId\":\"ns_create\"},\"get\":{\"responses\":{\"200\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/NsInstancesInfo\"}}},\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"job response message id\",\"in\":\"query\",\"name\":\"csarId\"}],\"tags\":[\"ns\"],\"description\":\"ns get\",\"summary\":\"ns get\",\"operationId\":\"ns_instantces_get\"}},\"/ns/{ns_instance_id}/terminate\":{\"post\":{\"responses\":{\"202\":{\"description\":\"\",\"schema\":{\"$ref\":\"#/definitions/JobInfo\"}},\"500\":{\"description\":\"the url is invalid\"}},\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"Identifier of the NS instance.\",\"in\":\"path\",\"name\":\"ns_instance_id\"},{\"schema\":{\"$ref\":\"#/definitions/NsTerminateRequest\"},\"description\":\"NsTerminateRequest\",\"required\":true,\"name\":\"NsTerminateRequest\",\"in\":\"body\"}],\"tags\":[\"ns\"],\"description\":\"ns terminate\",\"summary\":\"ns terminate\",\"operationId\":\"ns_terminate\"}},\"/ns/{nsInstanceId}/scale\":{\"post\":{\"responses\":{\"200\":{\"description\":\"\",\"schema\":{\"$ref\":\"#/definitions/JobInfo\"}},\"201\":{\"description\":\"Invalid Request\"}},\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"\",\"in\":\"path\",\"name\":\"nsInstanceId\"},{\"schema\":{\"$ref\":\"#/definitions/NsScaleRequest\"},\"description\":\"Scale NS Request Body\",\"required\":true,\"name\":\"ScaleNSRequest\",\"in\":\"body\"}],\"tags\":[\"ns\"],\"description\":\"ns scale\",\"summary\":\"ns scale\",\"operationId\":\"ns_scale\"}},\"/mandb/{modelName}\":{\"delete\":{\"responses\":{\"204\":{\"description\":\"The tables were deleted successfully.\"}},\"description\":\"ns table delete\",\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"model Name.\",\"in\":\"path\",\"name\":\"modelName\"}],\"produces\":[\"application/json\"],\"tags\":[\"db\"],\"summary\":\"ns table delete\",\"consumes\":[\"application/json\"],\"operationId\":\"ns_table_delete\"},\"get\":{\"responses\":{\"200\":{\"description\":\"successful operation\",\"schema\":{\"$ref\":\"#/definitions/TableInfo\"}},\"500\":{\"description\":\"the url is invalid\"}},\"description\":\"query ns table info\",\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"model Name.\",\"in\":\"path\",\"name\":\"modelName\"}],\"produces\":[\"application/json\"],\"tags\":[\"db\"],\"summary\":\"query ns table info\",\"consumes\":[\"application/json\"],\"operationId\":\"query_ns_table\"}},\"/ns/{nsInstanceId}/Instantiate\":{\"post\":{\"responses\":{\"200\":{\"description\":\"\",\"schema\":{\"$ref\":\"#/definitions/JobInfo\"}},\"201\":{\"description\":\"Invalid Request\"}},\"parameters\":[{\"required\":true,\"type\":\"string\",\"description\":\"\",\"in\":\"path\",\"name\":\"nsInstanceId\"},{\"schema\":{\"$ref\":\"#/definitions/NsInstantiateRequest\"},\"description\":\"NS Instantiate Request Body\",\"required\":true,\"name\":\"NSInstantiateRequest\",\"in\":\"body\"}],\"tags\":[\"ns\"],\"description\":\"ns Instantiate\",\"summary\":\"ns Instantiate\",\"operationId\":\"ns_Instantiate\"}}},\"schemes\":[\"http\",\"https\"],\"produces\":[\"application/json\"],\"basePath\":\"/api/nslcm/v1\",\"definitions\":{\"NsInstanceInfo\":{\"type\":\"object\",\"properties\":{\"nsState\":{\"type\":\"string\"},\"vnfInfo\":{\"items\":{\"$ref\":\"#/definitions/vnfInfo\"},\"type\":\"array\"},\"nsInstanceId\":{\"type\":\"string\"},\"nsdId\":{\"type\":\"string\"},\"vlInfo\":{\"items\":{\"$ref\":\"#/definitions/vlInfo\"},\"type\":\"array\"},\"nsName\":{\"type\":\"string\"},\"vnffgInfo\":{\"items\":{\"$ref\":\"#/definitions/vnffgInfo\"},\"type\":\"array\"},\"description\":{\"type\":\"string\"}}},\"JobDetailInfo\":{\"type\":\"object\",\"properties\":{\"responseDescriptor\":{\"type\":\"object\",\"properties\":{\"status\":{\"type\":\"string\"},\"responseHistoryList\":{\"items\":{\"$ref\":\"#/definitions/jobResponseInfo\"},\"type\":\"array\"},\"responseId\":{\"type\":\"string\"},\"errorCode\":{\"type\":\"string\"},\"progress\":{\"type\":\"string\"},\"statusDescription\":{\"type\":\"string\"}}},\"jobId\":{\"type\":\"string\"}}},\"VnfInfo\":{\"type\":\"object\",\"properties\":{\"vnfInstId\":{\"type\":\"string\"},\"vnfName\":{\"type\":\"string\"},\"vnfStatus\":{\"type\":\"string\"}}},\"DeleteResponse\":{\"type\":\"object\",\"properties\":{\"result\":{\"enum\":[0,1],\"type\":\"integer\"},\"detail\":{\"type\":\"string\"}}},\"NsHealRequest\":{\"type\":\"object\",\"properties\":{\"vnfInstanceId\":{\"type\":\"string\"},\"cause\":{\"type\":\"string\"},\"additionalParams\":{\"type\":\"object\",\"properties\":{\"action\":{\"type\":\"string\"},\"actionvminfo\":{\"type\":\"object\",\"properties\":{\"vmname\":{\"type\":\"string\"},\"vmid\":{\"type\":\"string\"}}}}}}},\"NsScaleRequest\":{\"type\":\"object\",\"properties\":{\"scaleNsByStepsData\":{\"$ref\":\"#/definitions/NsScaleByStepsData\"},\"scaleType\":{\"type\":\"string\"}}},\"jobResponseInfo\":{\"type\":\"object\",\"properties\":{\"status\":{\"type\":\"string\"},\"progress\":{\"type\":\"string\"},\"responseId\":{\"type\":\"string\"},\"statusDescription\":{\"type\":\"string\"},\"errorCode\":{\"type\":\"string\"}}},\"NSInstPostDetailRequest\":{\"type\":\"object\",\"properties\":{\"status\":{\"type\":\"string\"}}},\"VlInfo\":{\"type\":\"object\",\"properties\":{\"vlId\":{\"type\":\"string\"},\"vlStatus\":{\"type\":\"string\"},\"vlName\":{\"type\":\"string\"}}},\"VnfPostResponse\":{\"type\":\"object\",\"properties\":{\"vnfInstId\":{\"type\":\"string\"},\"jobId\":{\"type\":\"string\"}}},\"NsCreateRequest\":{\"type\":\"object\",\"properties\":{\"nsName\":{\"type\":\"string\"},\"csarId\":{\"type\":\"string\",\"description\":\"the NS package ID\"},\"description\":{\"type\":\"string\"}}},\"VlPostResponse\":{\"type\":\"object\",\"properties\":{\"vlId\":{\"type\":\"string\"},\"result\":{\"enum\":[0,1],\"type\":\"integer\"},\"detail\":{\"type\":\"string\"}}},\"SfcPostRequest\":{\"type\":\"object\",\"properties\":{\"sdnControllerId\":{\"type\":\"string\"},\"vnfInstanceData\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"additionalParamForVnf\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"nsInstanceId\":{\"type\":\"string\"},\"jobId\":{\"type\":\"string\"},\"additionalParamForNs\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"context\":{\"type\":\"string\"},\"sapData\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"fpindex\":{\"type\":\"string\"}}},\"NsTerminateRequest\":{\"type\":\"object\",\"properties\":{\"gracefulTerminationTimeout\":{\"type\":\"string\"},\"terminationType\":{\"type\":\"string\"}}},\"JobProgressRequest\":{\"type\":\"object\",\"properties\":{\"progress\":{\"type\":\"string\"},\"errcode\":{\"type\":\"string\"},\"desc\":{\"type\":\"string\"}}},\"SfcInfo\":{\"type\":\"object\",\"properties\":{\"sfcName\":{\"type\":\"string\"},\"sfcInstId\":{\"type\":\"string\"},\"sfcStatus\":{\"type\":\"string\"}}},\"vnfInfo\":{\"type\":\"object\",\"properties\":{\"vnfInstanceId\":{\"type\":\"string\"},\"vnfdId\":{\"type\":\"string\"},\"vnfInstanceName\":{\"type\":\"string\"}}},\"LocationConstraint\":{\"type\":\"object\",\"properties\":{\"locationConstraints\":{\"type\":\"object\",\"properties\":{\"vimid\":{\"type\":\"string\"}}},\"vnfProfileId\":{\"type\":\"string\"}}},\"NsCreateResponse\":{\"type\":\"object\",\"properties\":{\"nsInstanceId\":{\"type\":\"string\"}}},\"VlPostRequest\":{\"type\":\"object\",\"properties\":{\"vnfInstanceData\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"additionalParamForVnf\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"nsInstanceId\":{\"type\":\"string\"},\"flavourId\":{\"type\":\"string\"},\"pnfInfo\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"extNSVirtualLink\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"additionalParamForNs\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"context\":{\"type\":\"string\"},\"sapData\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"nestedNsInstanceId\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"jobId\":{\"type\":\"string\"},\"locationConstraints\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"vlIndex\":{\"type\":\"string\"}}},\"VnfPostRequest\":{\"type\":\"object\",\"properties\":{\"vnfInstanceData\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"vnfIndex\":{\"type\":\"string\"},\"additionalParamForVnf\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"nsInstanceId\":{\"type\":\"string\"},\"flavourId\":{\"type\":\"string\"},\"pnfInfo\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"extNSVirtualLink\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"additionalParamForNs\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"context\":{\"type\":\"string\"},\"sapData\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"nestedNsInstanceId\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"jobId\":{\"type\":\"string\"},\"locationConstraints\":{\"items\":{\"type\":\"object\"},\"type\":\"array\"}}},\"DeleteVlResponse\":{\"type\":\"object\",\"properties\":{\"result\":{\"enum\":[0,1],\"type\":\"integer\"},\"detail\":{\"type\":\"string\"}}},\"vlInfo\":{\"type\":\"object\",\"properties\":{\"vldId\":{\"type\":\"string\"},\"vlInstanceName\":{\"type\":\"string\"},\"vlInstanceId\":{\"type\":\"string\"},\"relatedCpInstanceId\":{\"items\":{\"$ref\":\"#/definitions/cpInfo\"},\"type\":\"array\"}}},\"cpInfo\":{\"type\":\"object\",\"properties\":{\"cpInstanceId\":{\"type\":\"string\"},\"cpdId\":{\"type\":\"string\"},\"cpInstanceName\":{\"type\":\"string\"}}},\"SfcPostResponse\":{\"type\":\"object\",\"properties\":{\"sfcInstId\":{\"type\":\"string\"},\"jobId\":{\"type\":\"string\"}}},\"NsInstantiateRequest\":{\"type\":\"object\",\"properties\":{\"additionalParamForNs\":{\"type\":\"string\"},\"LocationConstraints\":{\"items\":{\"$ref\":\"#/definitions/LocationConstraint\"},\"type\":\"array\"}}},\"JobInfo\":{\"type\":\"object\",\"properties\":{\"jobId\":{\"type\":\"string\"}}},\"NsInstancesInfo\":{\"items\":{\"$ref\":\"#/definitions/NsInstanceInfo\"},\"type\":\"array\"},\"NsScaleByStepsData\":{\"type\":\"object\",\"properties\":{\"numberOfSteps\":{\"type\":\"integer\"},\"scalingDirection\":{\"type\":\"string\"},\"aspectId\":{\"type\":\"string\"}}},\"vnffgInfo\":{\"type\":\"object\",\"properties\":{\"cpId\":{\"type\":\"string\"},\"virtualLinkId\":{\"type\":\"string\"},\"vnfId\":{\"type\":\"string\"},\"pnfId\":{\"type\":\"string\"},\"nfp\":{\"type\":\"string\"},\"vnffgInstanceId\":{\"type\":\"string\"}}},\"TableInfo\":{\"type\":\"object\",\"properties\":{\"count\":{\"type\":\"string\"}}}},\"swagger\":\"2.0\",\"consumes\":[\"application/json\"]}","definition":""}]}};\r
+import {swaggerFjh} from './swagger';\r
+\r
+export const workflowFJH = {"id":"fjh","name":"fjh","nodes":[{"id":"node0","name":"startEvent","type":"startEvent","position":{"top":31,"left":31,"width":200,"height":100},"connection":[{"sourceRef":"node0","targetRef":"node23"}],"parameters":[{"name":"vlCount","value":"","valueSource":"String","type":"String"},{"name":"vnfCount","value":"","valueSource":"String","type":"String"},{"name":"sfcCount","value":"","valueSource":"String","type":"String"},{"name":"object_context","value":"","valueSource":"String","type":"String"},{"name":"nsInstanceId","value":"","valueSource":"String","type":"String"},{"name":"object_additionalParamForNs","value":"","valueSource":"String","type":"String"},{"name":"object_additionalParamForVnf","value":"","valueSource":"String","type":"String"},{"name":"jobId","value":"","valueSource":"String","type":"String"},{"name":"sdnControllerId","value":"","valueSource":"String","type":"String"},{"name":"templateid","value":"","valueSource":"String","type":"String"},{"name":"instanceid","value":"","valueSource":"String","type":"String"},{"name":"sdnolcmurl","value":"","valueSource":"String","type":"String"},{"name":"statusurl","value":"","valueSource":"String","type":"String"}]},{"id":"node1","name":"endEvent","type":"endEvent","position":{"top":668,"left":955,"width":200,"height":100},"connection":[]},{"id":"node2","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":120,"left":169,"width":200,"height":100},"connection":[{"sourceRef":"node2","targetRef":"node3","condition":"${ vl_index <= vlCount and vl_status='active' }","name":"未完成"},{"sourceRef":"node2","targetRef":"node4","condition":"!( vl_index <= vlCount and vl_status='active' )","name":"创建完成"}]},{"id":"node3","name":"createVL","type":"restTask","position":{"top":213,"left":142,"width":200,"height":100},"connection":[{"sourceRef":"node3","targetRef":"node11"}],"produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"body","valueSource":"String","type":"String","position":"body","schema":{"$ref":"#/definitions/VlPostRequest"}}],"responses":[{"description":"","schema":{"$ref":"#/definitions/VlPostResponse"}}],"restConfigId":"nslcm","path":"/ns/vls","method":"post"},{"id":"node4","name":"restTask","type":"restTask","position":{"top":115,"left":358,"width":200,"height":100},"connection":[{"sourceRef":"node4","targetRef":"node5"}],"produces":[],"consumes":[],"parameters":[],"responses":[],"restConfigId":"nslcm","path":"","method":""},{"id":"node5","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":212,"left":383,"width":200,"height":100},"connection":[{"sourceRef":"node5","targetRef":"node6","condition":"未完成"},{"sourceRef":"node5","targetRef":"node12","condition":"创建完成"}]},{"id":"node6","name":"createVNF","type":"restTask","position":{"top":306,"left":352,"width":200,"height":100},"connection":[{"sourceRef":"node6","targetRef":"node7"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node7","name":"intermediateCatchEvent","type":"intermediateCatchEvent","position":{"top":558,"left":443,"width":200,"height":100},"connection":[{"sourceRef":"node7","targetRef":"node8"}],"timerEventDefinition":{"type":"timeDuration"}},{"id":"node8","name":"query_vnf nslcm","type":"restTask","position":{"top":639,"left":216,"width":200,"height":100},"connection":[{"sourceRef":"node8","targetRef":"node9"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node9","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":539,"left":264,"width":200,"height":100},"connection":[{"sourceRef":"node9","targetRef":"node7","condition":"未完成"},{"sourceRef":"node9","targetRef":"node10","condition":"已完成"}]},{"id":"node10","name":"scriptTask","type":"scriptTask","position":{"top":303,"left":239,"width":200,"height":100},"connection":[{"sourceRef":"node10","targetRef":"node5"}]},{"id":"node11","name":"scriptTask","type":"scriptTask","position":{"top":207,"left":34,"width":200,"height":100},"connection":[{"sourceRef":"node11","targetRef":"node2"}]},{"id":"node12","name":"restTask","type":"restTask","position":{"top":205,"left":732,"width":200,"height":100},"connection":[{"sourceRef":"node12","targetRef":"node13"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node13","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":287,"left":757,"width":200,"height":100},"connection":[{"sourceRef":"node13","targetRef":"node14","condition":"未结束"},{"sourceRef":"node13","targetRef":"node18","condition":"已结束"}]},{"id":"node14","name":"createSfc","type":"restTask","position":{"top":440,"left":726,"width":200,"height":100},"connection":[{"sourceRef":"node14","targetRef":"node15"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node15","name":"intermediateCatchEvent","type":"intermediateCatchEvent","position":{"top":551,"left":754,"width":200,"height":100},"connection":[{"sourceRef":"node15","targetRef":"node16"}],"timerEventDefinition":{"type":"timeDuration"}},{"id":"node16","name":"restTask","type":"restTask","position":{"top":642,"left":589,"width":200,"height":100},"connection":[{"sourceRef":"node16","targetRef":"node17"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node17","name":"exclusiveGateway","type":"exclusiveGateway","position":{"top":551,"left":614,"width":200,"height":100},"connection":[{"sourceRef":"node17","targetRef":"node15","condition":"未结束"},{"sourceRef":"node17","targetRef":"node19","condition":"已结束"}]},{"id":"node18","name":"restTask","type":"restTask","position":{"top":282,"left":927,"width":200,"height":100},"connection":[{"sourceRef":"node18","targetRef":"node20"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node19","name":"scriptTask","type":"scriptTask","position":{"top":275,"left":588,"width":200,"height":100},"connection":[{"sourceRef":"node19","targetRef":"node13"}]},{"id":"node20","name":"Assign_all_status","type":"scriptTask","position":{"top":380,"left":928,"width":200,"height":100},"connection":[{"sourceRef":"node20","targetRef":"node21"}]},{"id":"node21","name":"post_do","type":"restTask","position":{"top":497,"left":929,"width":200,"height":100},"connection":[{"sourceRef":"node21","targetRef":"node22"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node22","name":"jobstatus","type":"restTask","position":{"top":586,"left":927,"width":200,"height":100},"connection":[{"sourceRef":"node22","targetRef":"node1"}],"produces":[],"consumes":[],"parameters":[],"responses":[]},{"id":"node23","name":"scriptTask","type":"scriptTask","position":{"top":16,"left":143,"width":200,"height":100},"connection":[{"sourceRef":"node23","targetRef":"node2"}],"scriptFormate":"javascript","script":"execution.setVariable(\"vl_index\", 1);\nexecution.setVariable(\"vl_status\", \"active\");"}],"configs":{"restConfigs":[{"id": "nslcm", "name":"nslcm","version":"v1","swagger":swaggerFjh,"definition":""}]}};\r
--- /dev/null
+export const swaggerFjh = {"info":{"version":"1.0.0","contact":{"url":"https://gerrit.onap.org/r/#/admin/projects/vfc/nfvo/lcm","name":"ONAP VFC team","email":"onap-discuss@lists.onap.org"},"description":"VFC Network Service Lifecycle Management Rest API.","title":"ONAP VFC Network Service Lifecycle Management API"},"paths":{"/ns/sfcs/{sfcInstId}":{"delete":{"responses":{"204":{"description":"successful operation","schema":{"$ref":"#/definitions/DeleteResponse"}},"404":{"description":"the sfc instance id is wrong"},"500":{"description":"the url is invalid"}},"description":"","parameters":[{"required":true,"type":"string","description":"","in":"path","name":"sfcInstId"}],"produces":["application/json"],"tags":["sfc"],"summary":"delete sfc","consumes":["application/json"],"operationId":"delete_sfc"},"get":{"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/SfcInfo"}},"404":{"description":"the sfc instance id is wrong"},"500":{"description":"the url is invalid"}},"description":"","parameters":[{"description":"sfc instance id","required":true,"type":"string","name":"sfcInstId","in":"path"}],"produces":["application/json"],"tags":["sfc"],"summary":"query the specified sfc info","consumes":["application/json"],"operationId":"query_sfc"}},"/ns/{nsInstanceId}/postdeal":{"post":{"responses":{"202":{"description":""}},"description":"","parameters":[{"required":true,"type":"string","description":"","in":"path","name":"nsInstanceId"},{"schema":{"$ref":"#/definitions/NSInstPostDetailRequest"},"description":"request param","required":true,"name":"body","in":"body"}],"produces":["application/json"],"tags":["postdeal"],"summary":"ns postdeal","consumes":["application/json"],"operationId":"ns_postdeal"}},"/ns/vnfs":{"post":{"responses":{"201":{"description":"","schema":{"$ref":"#/definitions/VnfPostResponse"}}},"description":"","parameters":[{"schema":{"$ref":"#/definitions/VnfPostRequest"},"description":"instantiate request param","required":true,"name":"body","in":"body"}],"produces":["application/json"],"tags":["vnf"],"summary":"vnf create","consumes":["application/json"],"operationId":"create_vnf"}},"/ns/{ns_instance_id}/heal":{"post":{"responses":{"202":{"description":"","schema":{"$ref":"#/definitions/JobInfo"}},"500":{"description":"the url is invalid"}},"parameters":[{"required":true,"type":"string","description":"Identifier of the NS instance.","in":"path","name":"ns_instance_id"},{"schema":{"$ref":"#/definitions/NsHealRequest"},"description":"healVnfData","required":true,"name":"healVnfData","in":"body"}],"tags":["ns"],"description":"ns heal","summary":"ns heal","operationId":"ns_heal"}},"/jobs/{jobId}":{"post":{"responses":{"202":{"description":""}},"parameters":[{"required":true,"type":"string","description":"","in":"path","name":"jobId"},{"schema":{"$ref":"#/definitions/JobProgressRequest"},"description":"request param","required":true,"name":"body","in":"body"}],"tags":["job"],"description":"","summary":"jobstatus","operationId":"post_jobprogress"},"get":{"responses":{"202":{"description":"","schema":{"$ref":"#/definitions/JobDetailInfo"}}},"parameters":[{"required":true,"type":"string","description":"job Id","in":"path","name":"jobId"},{"required":true,"type":"string","description":"job response message id","in":"query","name":"responseId"}],"tags":["job"],"description":"","summary":"jobstatus","operationId":"get_jobstatus"}},"/ns/vls/{vlId}":{"delete":{"responses":{"204":{"description":"successful operation","schema":{"$ref":"#/definitions/DeleteVlResponse"}},"404":{"description":"the vl instance id is wrong"},"500":{"description":"the url is invalid"}},"description":"","parameters":[{"required":true,"type":"string","description":"","in":"path","name":"vlId"}],"produces":["application/json"],"tags":["vl"],"summary":"delete vl","consumes":["application/json"],"operationId":"delete_vl"},"get":{"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/VlInfo"}},"404":{"description":"the vl instance id is wrong"},"500":{"description":"the url is invalid"}},"description":"","parameters":[{"description":"vl instance id","required":true,"type":"string","name":"vlId","in":"path"}],"produces":["application/json"],"tags":["vl"],"summary":"query the specified vl info","consumes":["application/json"],"operationId":"query_vl"}},"/ns/vls":{"post":{"responses":{"201":{"description":"","schema":{"$ref":"#/definitions/VlPostResponse"}}},"description":"","parameters":[{"schema":{"$ref":"#/definitions/VlPostRequest"},"description":"instantiate request param","required":true,"name":"body","in":"body"}],"produces":["application/json"],"tags":["vl"],"summary":"vl create","consumes":["application/json"],"operationId":"create_vl"}},"/ns/sfcs":{"post":{"responses":{"201":{"description":"","schema":{"$ref":"#/definitions/SfcPostResponse"}}},"description":"","parameters":[{"schema":{"$ref":"#/definitions/SfcPostRequest"},"description":"request param","required":true,"name":"body","in":"body"}],"produces":["application/json"],"tags":["sfc"],"summary":"sfc create","consumes":["application/json"],"operationId":"create_sfc"}},"/ns/{ns_instance_id}":{"delete":{"responses":{"204":{"description":"The NS instance resource and the associated NS identifier were deleted successfully."}},"parameters":[{"required":true,"type":"string","description":"Identifier of the NS instance.","in":"path","name":"ns_instance_id"}],"tags":["ns"],"description":"ns delete","summary":"ns delete","operationId":"ns_delete"},"get":{"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/NsInstanceInfo"}}},"parameters":[],"tags":["ns"],"description":"ns get","summary":"ns get","operationId":"ns_instance_get"}},"/ns/vnfs/{vnfInstId}":{"delete":{"responses":{"204":{"description":"successful operation","schema":{"$ref":"#/definitions/DeleteResponse"}},"404":{"description":"the vl instance id is wrong"},"500":{"description":"the url is invalid"}},"description":"","parameters":[{"required":true,"type":"string","description":"","in":"path","name":"vnfInstId"}],"produces":["application/json"],"tags":["vnf"],"summary":"delete vnf","consumes":["application/json"],"operationId":"delete_vnf"},"get":{"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/VnfInfo"}},"404":{"description":"the vnf instance id is wrong"},"500":{"description":"the url is invalid"}},"description":"","parameters":[{"description":"vnf instance id","required":true,"type":"string","name":"vnfInstId","in":"path"}],"produces":["application/json"],"tags":["vnf"],"summary":"query the specified vnf info","consumes":["application/json"],"operationId":"query_vnf"}},"/ns":{"post":{"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/NsCreateResponse"}}},"parameters":[{"schema":{"$ref":"#/definitions/NsCreateRequest"},"description":"NS Instance Create Request","required":true,"name":"NSCreateRequest","in":"body"}],"tags":["ns"],"description":"ns create","summary":"ns create","operationId":"ns_create"},"get":{"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/NsInstancesInfo"}}},"parameters":[{"required":true,"type":"string","description":"job response message id","in":"query","name":"csarId"}],"tags":["ns"],"description":"ns get","summary":"ns get","operationId":"ns_instantces_get"}},"/ns/{ns_instance_id}/terminate":{"post":{"responses":{"202":{"description":"","schema":{"$ref":"#/definitions/JobInfo"}},"500":{"description":"the url is invalid"}},"parameters":[{"required":true,"type":"string","description":"Identifier of the NS instance.","in":"path","name":"ns_instance_id"},{"schema":{"$ref":"#/definitions/NsTerminateRequest"},"description":"NsTerminateRequest","required":true,"name":"NsTerminateRequest","in":"body"}],"tags":["ns"],"description":"ns terminate","summary":"ns terminate","operationId":"ns_terminate"}},"/ns/{nsInstanceId}/scale":{"post":{"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/JobInfo"}},"201":{"description":"Invalid Request"}},"parameters":[{"required":true,"type":"string","description":"","in":"path","name":"nsInstanceId"},{"schema":{"$ref":"#/definitions/NsScaleRequest"},"description":"Scale NS Request Body","required":true,"name":"ScaleNSRequest","in":"body"}],"tags":["ns"],"description":"ns scale","summary":"ns scale","operationId":"ns_scale"}},"/mandb/{modelName}":{"delete":{"responses":{"204":{"description":"The tables were deleted successfully."}},"description":"ns table delete","parameters":[{"required":true,"type":"string","description":"model Name.","in":"path","name":"modelName"}],"produces":["application/json"],"tags":["db"],"summary":"ns table delete","consumes":["application/json"],"operationId":"ns_table_delete"},"get":{"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/TableInfo"}},"500":{"description":"the url is invalid"}},"description":"query ns table info","parameters":[{"required":true,"type":"string","description":"model Name.","in":"path","name":"modelName"}],"produces":["application/json"],"tags":["db"],"summary":"query ns table info","consumes":["application/json"],"operationId":"query_ns_table"}},"/ns/{nsInstanceId}/Instantiate":{"post":{"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/JobInfo"}},"201":{"description":"Invalid Request"}},"parameters":[{"required":true,"type":"string","description":"","in":"path","name":"nsInstanceId"},{"schema":{"$ref":"#/definitions/NsInstantiateRequest"},"description":"NS Instantiate Request Body","required":true,"name":"NSInstantiateRequest","in":"body"}],"tags":["ns"],"description":"ns Instantiate","summary":"ns Instantiate","operationId":"ns_Instantiate"}}},"schemes":["http","https"],"produces":["application/json"],"basePath":"/api/nslcm/v1","definitions":{"NsInstanceInfo":{"type":"object","properties":{"nsState":{"type":"string"},"vnfInfo":{"items":{"$ref":"#/definitions/vnfInfo"},"type":"array"},"nsInstanceId":{"type":"string"},"nsdId":{"type":"string"},"vlInfo":{"items":{"$ref":"#/definitions/vlInfo"},"type":"array"},"nsName":{"type":"string"},"vnffgInfo":{"items":{"$ref":"#/definitions/vnffgInfo"},"type":"array"},"description":{"type":"string"}}},"JobDetailInfo":{"type":"object","properties":{"responseDescriptor":{"type":"object","properties":{"status":{"type":"string"},"responseHistoryList":{"items":{"$ref":"#/definitions/jobResponseInfo"},"type":"array"},"responseId":{"type":"string"},"errorCode":{"type":"string"},"progress":{"type":"string"},"statusDescription":{"type":"string"}}},"jobId":{"type":"string"}}},"VnfInfo":{"type":"object","properties":{"vnfInstId":{"type":"string"},"vnfName":{"type":"string"},"vnfStatus":{"type":"string"}}},"DeleteResponse":{"type":"object","properties":{"result":{"enum":[0,1],"type":"integer"},"detail":{"type":"string"}}},"NsHealRequest":{"type":"object","properties":{"vnfInstanceId":{"type":"string"},"cause":{"type":"string"},"additionalParams":{"type":"object","properties":{"action":{"type":"string"},"actionvminfo":{"type":"object","properties":{"vmname":{"type":"string"},"vmid":{"type":"string"}}}}}}},"NsScaleRequest":{"type":"object","properties":{"scaleNsByStepsData":{"$ref":"#/definitions/NsScaleByStepsData"},"scaleType":{"type":"string"}}},"jobResponseInfo":{"type":"object","properties":{"status":{"type":"string"},"progress":{"type":"string"},"responseId":{"type":"string"},"statusDescription":{"type":"string"},"errorCode":{"type":"string"}}},"NSInstPostDetailRequest":{"type":"object","properties":{"status":{"type":"string"}}},"VlInfo":{"type":"object","properties":{"vlId":{"type":"string"},"vlStatus":{"type":"string"},"vlName":{"type":"string"}}},"VnfPostResponse":{"type":"object","properties":{"vnfInstId":{"type":"string"},"jobId":{"type":"string"}}},"NsCreateRequest":{"type":"object","properties":{"nsName":{"type":"string"},"csarId":{"type":"string","description":"the NS package ID"},"description":{"type":"string"}}},"VlPostResponse":{"type":"object","properties":{"vlId":{"type":"string"},"result":{"enum":[0,1],"type":"integer"},"detail":{"type":"string"}}},"SfcPostRequest":{"type":"object","properties":{"sdnControllerId":{"type":"string"},"vnfInstanceData":{"items":{"type":"object"},"type":"array"},"additionalParamForVnf":{"items":{"type":"object"},"type":"array"},"nsInstanceId":{"type":"string"},"jobId":{"type":"string"},"additionalParamForNs":{"items":{"type":"object"},"type":"array"},"context":{"type":"string"},"sapData":{"items":{"type":"object"},"type":"array"},"fpindex":{"type":"string"}}},"NsTerminateRequest":{"type":"object","properties":{"gracefulTerminationTimeout":{"type":"string"},"terminationType":{"type":"string"}}},"JobProgressRequest":{"type":"object","properties":{"progress":{"type":"string"},"errcode":{"type":"string"},"desc":{"type":"string"}}},"SfcInfo":{"type":"object","properties":{"sfcName":{"type":"string"},"sfcInstId":{"type":"string"},"sfcStatus":{"type":"string"}}},"vnfInfo":{"type":"object","properties":{"vnfInstanceId":{"type":"string"},"vnfdId":{"type":"string"},"vnfInstanceName":{"type":"string"}}},"LocationConstraint":{"type":"object","properties":{"locationConstraints":{"type":"object","properties":{"vimid":{"type":"string"}}},"vnfProfileId":{"type":"string"}}},"NsCreateResponse":{"type":"object","properties":{"nsInstanceId":{"type":"string"}}},"VlPostRequest":{"type":"object","properties":{"vnfInstanceData":{"items":{"type":"object"},"type":"array"},"additionalParamForVnf":{"items":{"type":"object"},"type":"array"},"nsInstanceId":{"type":"string"},"flavourId":{"type":"string"},"pnfInfo":{"items":{"type":"object"},"type":"array"},"extNSVirtualLink":{"items":{"type":"object"},"type":"array"},"additionalParamForNs":{"items":{"type":"object"},"type":"array"},"context":{"type":"string"},"sapData":{"items":{"type":"object"},"type":"array"},"nestedNsInstanceId":{"items":{"type":"object"},"type":"array"},"jobId":{"type":"string"},"locationConstraints":{"items":{"type":"object"},"type":"array"},"vlIndex":{"type":"string"}}},"VnfPostRequest":{"type":"object","properties":{"vnfInstanceData":{"items":{"type":"object"},"type":"array"},"vnfIndex":{"type":"string"},"additionalParamForVnf":{"items":{"type":"object"},"type":"array"},"nsInstanceId":{"type":"string"},"flavourId":{"type":"string"},"pnfInfo":{"items":{"type":"object"},"type":"array"},"extNSVirtualLink":{"items":{"type":"object"},"type":"array"},"additionalParamForNs":{"items":{"type":"object"},"type":"array"},"context":{"type":"string"},"sapData":{"items":{"type":"object"},"type":"array"},"nestedNsInstanceId":{"items":{"type":"object"},"type":"array"},"jobId":{"type":"string"},"locationConstraints":{"items":{"type":"object"},"type":"array"}}},"DeleteVlResponse":{"type":"object","properties":{"result":{"enum":[0,1],"type":"integer"},"detail":{"type":"string"}}},"vlInfo":{"type":"object","properties":{"vldId":{"type":"string"},"vlInstanceName":{"type":"string"},"vlInstanceId":{"type":"string"},"relatedCpInstanceId":{"items":{"$ref":"#/definitions/cpInfo"},"type":"array"}}},"cpInfo":{"type":"object","properties":{"cpInstanceId":{"type":"string"},"cpdId":{"type":"string"},"cpInstanceName":{"type":"string"}}},"SfcPostResponse":{"type":"object","properties":{"sfcInstId":{"type":"string"},"jobId":{"type":"string"}}},"NsInstantiateRequest":{"type":"object","properties":{"additionalParamForNs":{"type":"string"},"LocationConstraints":{"items":{"$ref":"#/definitions/LocationConstraint"},"type":"array"}}},"JobInfo":{"type":"object","properties":{"jobId":{"type":"string"}}},"NsInstancesInfo":{"items":{"$ref":"#/definitions/NsInstanceInfo"},"type":"array"},"NsScaleByStepsData":{"type":"object","properties":{"numberOfSteps":{"type":"integer"},"scalingDirection":{"type":"string"},"aspectId":{"type":"string"}}},"vnffgInfo":{"type":"object","properties":{"cpId":{"type":"string"},"virtualLinkId":{"type":"string"},"vnfId":{"type":"string"},"pnfId":{"type":"string"},"nfp":{"type":"string"},"vnffgInstanceId":{"type":"string"}}},"TableInfo":{"type":"object","properties":{"count":{"type":"string"}}}},"swagger":"2.0","consumes":["application/json"]};\r
private selectNodes: WorkflowNode[] = [];\r
\r
constructor(private modelService: ModelService, private broadcastService: BroadcastService) {\r
+\r
this.broadcastService.selectedElement$.subscribe(elements => {\r
this.selectNodes = [];\r
if (elements && 0 < elements.length) {\r
private msbPublishServiceURL = '/api/msdiscover/v1/publishservicelist';\r
\r
constructor(private broadcastService: BroadcastService, private http: Http) {\r
+ this.broadcastService.planModel$.subscribe(planModel => {\r
+ planModel.configs.restConfigs.forEach(element => {\r
+ this.restConfigs.push(element);\r
+ });\r
+ });\r
// this.initSwaggerInfoByMSB();\r
}\r
\r
return this.dataAccessService.catalogService.saveWorkflow(this.planName, this.planModel);\r
}\r
\r
+ public getPlanName(planId: number): string {\r
+ const planInfo = this.workflows.get(planId);\r
+ return planInfo ? planInfo.planName: null;\r
+ }\r
+\r
+ public getPlanModel(planId: number): PlanModel {\r
+ const planInfo = this.workflows.get(planId);\r
+ return planInfo ? planInfo.plan: null;\r
+ }\r
+\r
public getWorkflows(): Map<number, any> {\r
\r
return this.workflows;\r