browserLang = window.navigator.language;
}
translate.use(browserLang);
-
}
}
* Contributors:
* ZTE - initial API and implementation and/or initial documentation
*/
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
-import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+import { RouterModule } from '@angular/router';
+import { AccordionModule } from 'ngx-bootstrap/accordion';
+import { AlertModule, ModalModule } from 'ngx-bootstrap/index';
import { NgxTreeSelectModule } from 'ngx-tree-select';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
-import { AlertModule, ModalModule } from 'ngx-bootstrap/index';
-import { AccordionModule } from 'ngx-bootstrap/accordion';
import { AppComponent } from './app.component';
-import { JsPlumbService } from "./services/jsplumb.service";
-import { NodeComponent } from "./components/node/node.component";
-import { ToolbarComponent } from "./components/toolbar/toolbar.component";
-import { WorkflowService } from "./services/workflow.service";
-import { DataService } from "./services/data/data.service";
-import { HttpService } from "./util/http.service";
-import { SharedModule } from "./shared/shared.module";
-import { InMemoryWebApiModule } from "angular-in-memory-web-api";
-import { InMemoryDataService } from "./services/data/in-memory-data.service";
-import { HttpModule } from "@angular/http";
-import { RouterModule } from "@angular/router";
-import { BroadcastService } from "./services/broadcast.service";
-import { PropertiesComponent } from "./components/property/properties.component";
-import { ParameterComponent } from "./components/parameter/parameter.component";
-import { MenusComponent } from "./components/menus/menus.component";
-import { RestTaskComponent } from "./components/property/rest-task/rest-task.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 { SequenceFlowComponent } from "./components/sequence-flow/sequence-flow.component";
-import { ScriptTaskComponent } from "./components/property/script-task/script-task.component";
-import { WorkflowsComponent } from "./components/menus/workflows/workflows.component";
-import { ModelService } from './services/model.service';
import { ContainerComponent } from './components/container/container.component';
-import { RestService } from './services/rest.service';
-import { ResizableDirective } from './directive/resizable/resizable.directive';
-import { StartEventComponent } from './components/property/start-event/start-event.component';
+import { EditablePropertyComponent } from './components/editable-property/editable-property.component';
import { NodeParametersComponent } from './components/node-parameters/node-parameters.component';
import { ParameterTreeComponent } from './components/node-parameters/parameter-tree/parameter-tree.component';
-import { NoticeService } from './services/notice.service';
-import { GlobalNoticeComponent } from './components/global-notice/global-notice.component';
-import { SettingService } from './services/setting.service';
-import { ErrorEventComponent } from './components/property/error-event/error-event.component';
+import { NodeComponent } from './components/node/node.component';
+import { ParameterComponent } from './components/parameter/parameter.component';
+import { IntermediateCatchEventComponent } from './components/property/intermediate-catch-event/intermediate-catch-event.component';
import { NodeTemplateComponent } from './components/property/node-template/node-template.component';
-import { RestConfigComponent } from './components/menus/rest-config/rest-config.component';
+import { PropertiesComponent } from './components/property/properties.component';
+import { RestTaskComponent } from './components/property/rest-task/rest-task.component';
+import { ErrorEventComponent } from './components/property/error-event/error-event.component';
+import { StartEventComponent } from './components/property/start-event/start-event.component';
+import { SequenceFlowComponent } from './components/sequence-flow/sequence-flow.component';
import { RestConfigDetailComponent } from './components/menus/rest-config/rest-config-detail/rest-config-detail.component';
import { RestConfigListComponent } from './components/menus/rest-config/rest-config-list/rest-config-list.component';
+import { RestConfigComponent } from './components/menus/rest-config/rest-config.component';
+import { ToolbarComponent } from './components/toolbar/toolbar.component';
+
+import { ResizableDirective } from './directive/resizable/resizable.directive';
+
+import { BroadcastService } from './services/broadcast.service';
+import { DataService } from './services/data/data.service';
+import { JsPlumbService } from './services/jsplumb.service';
+import { ModelService } from './services/model.service';
+import { NoticeService } from './services/notice.service';
+import { RestService } from './services/rest.service';
+import { SwaggerTreeConverterService } from './services/swagger-tree-converter.service';
+import { SettingService } from './services/setting.service';
+
+import { SharedModule } from './shared/shared.module';
+import { HttpService } from './util/http.service';
+import { GlobalNoticeComponent } from './components/global-notice/global-notice.component';
+import { MenusComponent } from './components/menus/menus.component';
+import { ScriptTaskComponent } from "./components/property/script-task/script-task.component";
+import { WorkflowsComponent } from './components/menus/workflows/workflows.component';
+import { WorkflowService } from './services/workflow.service';
+import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
+import { InMemoryDataService } from './services/data/in-memory-data.service';
+import { HttpModule } from '@angular/http';
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
declarations: [
AppComponent,
ContainerComponent,
- ErrorEventComponent,
- ResizableDirective,
EditablePropertyComponent,
- GlobalNoticeComponent,
+ ErrorEventComponent,
IntermediateCatchEventComponent,
- MenusComponent,
NodeComponent,
NodeParametersComponent,
NodeTemplateComponent,
ParameterComponent,
ParameterTreeComponent,
PropertiesComponent,
- RestTaskComponent,
RestConfigComponent,
- RestConfigDetailComponent,
- RestConfigListComponent,
+ RestTaskComponent,
+ SequenceFlowComponent,
ScriptTaskComponent,
StartEventComponent,
- SequenceFlowComponent,
ToolbarComponent,
+ RestConfigDetailComponent,
+ RestConfigListComponent,
+ ResizableDirective,
+ GlobalNoticeComponent,
+ MenusComponent,
WorkflowsComponent,
],
providers: [
BroadcastService,
- DataService,
HttpService,
JsPlumbService,
- ModelService,
+ ModelService,
NoticeService,
RestService,
- SettingService,
SwaggerTreeConverterService,
+ DataService,
+ SettingService,
WorkflowService
],
imports: [
})
],
bootstrap: [
- AppComponent,
+ AppComponent,
],
})
export class AppModule {
+
}
<b4t-properties></b4t-properties>
-<b4t-sequence-flow></b4t-sequence-flow>
+<b4t-sequence-flow></b4t-sequence-flow>
\ No newline at end of file
-/**\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
-.edit{\r
- font-size: 24px;\r
- width: 300px;\r
- height: 30px;\r
- border: 1px solid #fff;\r
-}\r
-\r
-.edit:hover{\r
- border-color: #80bdff;\r
-}\r
-\r
-.edit:focus{\r
- border-color: #80bdff;\r
-}\r
+/**
+ * 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
+ */
+
+.edit{
+ font-size: 24px;
+ width: 300px;
+ height: 30px;
+ border: 1px solid #fff;
+}
+
+.edit:hover{
+ border-color: #80bdff;
+}
+
+.edit:focus{
+ border-color: #80bdff;
+}
\ No newline at end of file
(mouseover)="showEditComponent(true)" (mouseout)="showEditComponent(false)">
<button *ngIf="showEdit" type="button" class="btn blue1 pull-left" (click)="stopEdit();">
<i class="fa fa-check"></i>
-</button>
+</button>
\ No newline at end of file
}
public addRestConfig() {
- const restConfig = this.restService.addRestConfig();
+
+ const restConfig = this.restService.newRestConfig();
+ this.restService.addRestConfig(restConfig);
this.onConfigSelected(restConfig);
}
-<!--\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
+<!--
+/*******************************************************************************
+ * 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 pathParams" [param]="param" [valueSource]= "inputSources" [planItems]="planItems"></b4t-parameter>
+<hr *ngIf="pathParams.length > 0">
+<b4t-parameter *ngFor="let param of queryParams" [param]="param" [valueSource]= "inputSources" [planItems]="planItems"></b4t-parameter>
+
+<b4t-parameter-tree [restConfigId]="restConfigId" [parameters]="inputParams" [valueSource]="inputSources"
+ [planItems]="planItems"></b4t-parameter-tree>
+<b4t-parameter-tree [restConfigId]="restConfigId" [parameters]="outputParams" [valueSource]="outputSources"
+ [planItems]="planItems"></b4t-parameter-tree>
-/**\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
+/**
+ * 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, OnChanges, Output, SimpleChanges } from '@angular/core';
+import { TreeNode } from 'primeng/primeng';
+
+import { PlanTreeviewItem } from '../../model/plan-treeview-item';
+import { Swagger, SwaggerResponse } from '../../model/swagger';
+import { ValueSource } from '../../model/value-source.enum';
+import { RestParameter } from '../../model/workflow/rest-parameter';
+import { BroadcastService } from '../../services/broadcast.service';
+import { SwaggerTreeConverterService } from '../../services/swagger-tree-converter.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-node-parameters',
+ styleUrls: ['./node-parameters.component.css'],
+ templateUrl: 'node-parameters.component.html',
+})
+export class NodeParametersComponent implements OnChanges {
+ @Input() public swaggerInput: RestParameter[];
+ @Input() public swaggerOutput: SwaggerResponse[];
+ @Input() public restConfigId: string;
+ @Input() public planItems: PlanTreeviewItem[];
+
+ public inputSources: ValueSource[] = [ValueSource.String, ValueSource.Variable, ValueSource.Topology, ValueSource.Plan];
+ public outputSources: ValueSource[] = [ValueSource.Topology, ValueSource.Plan];
+ public valueSource = ValueSource;
+ public pathParams: any[] = [];
+ public queryParams: any[] = [];
+ public inputParams: TreeNode[] = [];
+ public outputParams: TreeNode[] = [];
+
+ private index = 1;
+
+ constructor(private broadcastService: BroadcastService,
+ private restService: RestService,
+ private swaggerTreeConverterService: SwaggerTreeConverterService) {
+ }
+
+ public ngOnChanges(changes: SimpleChanges): void {
+ if (changes.swaggerInput && changes.swaggerInput.currentValue) {
+ this.resetRequestParams(changes.swaggerInput.currentValue);
+ }
+ if (changes.swaggerOutput && changes.swaggerOutput.currentValue) {
+ this.resetResponseParams(changes.swaggerOutput.currentValue);
+ }
+ }
+
+ public resetRequestParams(parameters: RestParameter[]) {
+ this.pathParams = [];
+ this.queryParams = [];
+ this.inputParams = [];
+
+ parameters.forEach(param => {
+ if (param.position === 'path') {
+ this.pathParams.push(param);
+ } else if (param.position === 'query') {
+ this.queryParams.push(param);
+ } else if (param.position === 'body') {
+ const requestTreeNode = this.swaggerTreeConverterService
+ .schema2TreeNode(this.restService.getSwaggerInfo(this.restConfigId), 'Request Param', param.schema, param.value);
+ param.value = requestTreeNode.value;
+ this.inputParams.push(requestTreeNode);
+ } else {
+ // TODO others param types not supported
+ console.log('Unsupport parameter position(in):' + param.position);
+ }
+ });
+ }
+
+ public resetResponseParams(responses: SwaggerResponse[]) {
+ this.outputParams = [];
+ if (0 < responses.length && responses[0].schema) {
+ const treeNode = this.swaggerTreeConverterService
+ .schema2TreeNode(this.restService.getSwaggerInfo(this.restConfigId), 'Response Params', responses[0].schema, {});
+ this.outputParams.push(treeNode);
+ }
+ }
+}
-<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
+<p-tree *ngIf="parameters.length > 0" [value]="parameters">
+ <ng-template let-node pTemplate="default">
+ <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="valueSource" [planItems]="planItems"
+ [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)" (delete)="deleteTreeNode(node)"></b4t-parameter>
+ </ng-template>
+
+ <ng-template let-node pTemplate="array">
+ <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="getObjectValueSource()" [planItems]="planItems"
+ [canInsert]="canInsert(node)" [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)"
+ (insert)="addChildNode4ObjectArray(node)" (delete)="deleteTreeNode(node)"></b4t-parameter>
+ </ng-template>
+
+ <ng-template let-node pTemplate="object">
+ <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="getObjectValueSource()" [planItems]="planItems"
+ [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)" (delete)="deleteTreeNode(node)"></b4t-parameter>
+ </ng-template>
+
+ <ng-template let-node pTemplate="map">
+ <b4t-parameter [param]="getParameter(node)" [canEditName]="node.keyEditable" [valueSource]="getObjectValueSource()" [planItems]="planItems"
+ [canInsert]="canInsert(node)" [canDelete]="canDelete(node)" (paramChange)="paramChange($event, node)"
+ (insert)="addChildNode4DynamicObject(node)" (delete)="deleteTreeNode(node)"></b4t-parameter>
+ </ng-template>
+</p-tree>
\ No newline at end of file
-/**\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
+/**
+ * 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 { ChangeDetectionStrategy, 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 { SwaggerTreeConverterService } from '../../../services/swagger-tree-converter.service';
+import { WorkflowUtil } from '../../../util/workflow-util';
+import { Swagger } from "../../../model/swagger";
+import { RestService } from "../../../services/rest.service";
+
+/**
+ * parameter tree presents parameter of task node's input or output parameters.
+ */
+@Component({
+ selector: 'b4t-parameter-tree',
+ styleUrls: ['./parameter-tree.component.css'],
+ templateUrl: 'parameter-tree.component.html',
+ changeDetection: ChangeDetectionStrategy.OnPush
+})
+export class ParameterTreeComponent implements OnChanges {
+ @Input() public parameters: TreeNode[];
+ @Input() public restConfigId: string;
+ @Input() public valueSource: ValueSource[];
+ @Input() public planItems: PlanTreeviewItem[];
+
+ constructor(private restService: RestService, private swaggerTreeConverterService: SwaggerTreeConverterService) { }
+
+ public ngOnChanges(changes: SimpleChanges) {
+ }
+
+ public getParameter(node: any): Parameter {
+ // console.log('Parameter init:' + node.label +'.'+ node.type+'.'+JSON.stringify(node.value.value)+'.'+node.value.valueSource);
+
+ return new Parameter(node.label, node.value.value, node.value.valueSource, node.definition.type, node.definition.reqquired);
+ }
+
+
+ public paramChange(param: Parameter, node: any) {
+ // console.log('Parameter change:' + param.name + ', Node label is:' + node.label);
+
+ 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{
+ // this parameter is 'request param' or 'response param'
+ }
+
+ }
+
+ 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 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 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 canInsert(node: any) {
+ if (node.value.valueSource !== ValueSource[ValueSource.Definition]) {
+ return false;
+ } else {
+ return this.isArrayObject(node) || this.isDynamicObject(node);
+ }
+ }
+
+ public canDelete(node: any) {
+ const parent = node.parent;
+ if (parent &&
+ (this.isArrayObject(parent) || this.isDynamicObject(parent))) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public getObjectValueSource(): ValueSource[] {
+ const result = [];
+ this.valueSource.forEach(source => {
+ if (ValueSource.String != source) {
+ result.push(source);
+ }
+ });
+ result.push(ValueSource.Definition);
+ return result;
+ }
+
+ private isArrayObject(node: any): boolean {
+ return node.type === 'array';
+ }
+
+ private isDynamicObject(node: any): boolean {
+ return node.type === 'map';
+ }
+}
-/**\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
-.node {\r
- cursor: pointer;\r
- display: inline-block;\r
- position: absolute;\r
- z-index: 2;\r
-}\r
-\r
-.node-icon{\r
- border-radius: 4px;\r
-}\r
-\r
-.node-icon svg{\r
- display: block;\r
- fill: #00ABFF;\r
-}\r
-\r
-.active {\r
- outline: 1px solid #00ABFF;\r
-}\r
-\r
-/**\r
- * Anchors\r
- */\r
-.anchors {\r
- position: absolute;\r
- border-radius: 1em;\r
- display: none;\r
- background-color: #2e6f9a;\r
- width: 12px;\r
- height: 12px;\r
- cursor: pointer;\r
- -ms-transition: all 0.15s ease-in-out;\r
- transition: all 0.15s ease-in-out;\r
- -moz-transition: all 0.15s ease-in-out;\r
- -webkit-transition: all 0.15s ease-in-out;\r
- -o-transition: all 0.15s ease-in-out;\r
-}\r
-\r
-.node-icon:hover > .anchors {\r
- display: inline-block;\r
-}\r
-\r
-.anchor-left {\r
- left: -6px;\r
- top: calc(50%);\r
-}\r
-\r
-.anchor-right {\r
- right: -6px;\r
- top: calc(50%);\r
-}\r
-\r
-.anchor-top {\r
- top: -6px;\r
- left: calc(50% - 6px);\r
-}\r
-\r
-.anchor-bottom {\r
- bottom: -6px;\r
- left: calc(50% - 6px);\r
-}\r
-\r
-/*right arrow*/\r
-.right {\r
- width: 10px;\r
- height: 10px;\r
- position: absolute;\r
- left: 4px;\r
- top: 1px;\r
-\r
-}\r
-\r
-.right-arrow1, .right-arrow2 {\r
- width: 0;\r
- height: 0;\r
- display: block;\r
- position: absolute;\r
- left: 0;\r
- top: 0;\r
- border-top: 5px transparent dashed;\r
- border-right: 5px transparent dashed;\r
- border-bottom: 5px transparent dashed;\r
- border-left: 5px #2e6f9a solid;\r
- overflow: hidden;\r
-}\r
-\r
-.right-arrow1 {\r
-\r
- border-left: 5px white solid;\r
-}\r
-\r
-.right-arrow2 {\r
- left: -2px;\r
-}\r
-\r
-/*left arrow */\r
-.left {\r
- width: 10px;\r
- height: 10px;\r
- position: absolute;\r
- left: -2px;\r
- top: 1px;\r
- z-index: 2;\r
-}\r
-\r
-.left-arrow1, .left-arrow2 {\r
- width: 0;\r
- height: 0;\r
- display: block;\r
- position: absolute;\r
- left: 0;\r
- top: 0;\r
- z-index: 5; /*ie8-*/\r
- border-top: 5px transparent dashed;\r
- border-left: 5px transparent dashed;\r
- border-bottom: 5px transparent dashed;\r
- border-right: 5px #2e6f9a solid;\r
- overflow: hidden;\r
-}\r
-\r
-.left-arrow1 {\r
- border-right: 5px #fff solid;\r
-}\r
-\r
-.left-arrow2 {\r
- left: 2px;\r
-}\r
-\r
-/*top arrow*/\r
-.top {\r
- width: 10px;\r
- height: 10px;\r
- position: absolute;\r
- left: 1px;\r
- z-index: 2;\r
-}\r
-\r
-.top-arrow1, .top-arrow2 {\r
- width: 0;\r
- height: 0;\r
- display: block;\r
- position: absolute;\r
- left: 0;\r
- top: 0;\r
- z-index: 5;\r
- border-bottom: 5px #2e6f9a solid;\r
- border-left: 5px transparent dashed;\r
- border-right: 5px transparent dashed;\r
- border-top: 5px transparent dashed;\r
- overflow: hidden;\r
-}\r
-\r
-.top-arrow1 {\r
- z-index: 6;\r
-}\r
-\r
-.top-arrow2 {\r
- top: -2px;\r
- border-bottom: 5px white solid;\r
-}\r
-\r
-/*bottom arrow*/\r
-.bottom {\r
- width: 10px;\r
- height: 10px;\r
- position: absolute;\r
- left: 1px;\r
- top: 4px;\r
- z-index: 2;\r
-}\r
-\r
-.bottom-arrow1, .bottom-arrow2 {\r
- width: 0;\r
- height: 0;\r
- display: block;\r
- position: absolute;\r
- left: 0;\r
- top: 0;\r
- z-index: 5;\r
- border-bottom: 5px transparent dashed;\r
- border-left: 5px transparent dashed;\r
- border-right: 5px transparent dashed;\r
- border-top: 5px #2e6f9a solid;\r
- overflow: hidden;\r
-}\r
-\r
-.bottom-arrow1 {\r
- top: -2px;\r
- z-index: 6;\r
-}\r
-\r
-.bottom-arrow2 {\r
- border-top: 5px white solid;\r
-}\r
-/**\r
- * Anchors End\r
- */\r
-\r
-.node .name {\r
- width: 55px;\r
- height: 12px;\r
- text-align: center;\r
- white-space: nowrap;\r
- color: #5c6d90;\r
- line-height: 12px;\r
- cursor: pointer;\r
- font-family: Arial;\r
- font-size: 12px;\r
-}\r
-\r
-.resizeable {\r
- background-color: darkolivegreen;\r
- border:1px solid blue;\r
- margin: 10px;\r
-}\r
-\r
+/**
+ * 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
+ */
+
+.node {
+ cursor: pointer;
+ display: inline-block;
+ position: absolute;
+ z-index: 2;
+}
+
+.node-icon{
+ border-radius: 4px;
+}
+
+.node-icon svg{
+ display: block;
+ fill: #00ABFF;
+}
+
+.active {
+ outline: 1px solid #00ABFF;
+}
+
+/**
+ * Anchors
+ */
+.anchors {
+ position: absolute;
+ border-radius: 1em;
+ display: none;
+ background-color: #2e6f9a;
+ width: 12px;
+ height: 12px;
+ cursor: pointer;
+ -ms-transition: all 0.15s ease-in-out;
+ transition: all 0.15s ease-in-out;
+ -moz-transition: all 0.15s ease-in-out;
+ -webkit-transition: all 0.15s ease-in-out;
+ -o-transition: all 0.15s ease-in-out;
+}
+
+.node-icon:hover > .anchors {
+ display: inline-block;
+}
+
+.anchor-left {
+ left: -6px;
+ top: calc(50%);
+}
+
+.anchor-right {
+ right: -6px;
+ top: calc(50%);
+}
+
+.anchor-top {
+ top: -6px;
+ left: calc(50% - 6px);
+}
+
+.anchor-bottom {
+ bottom: -6px;
+ left: calc(50% - 6px);
+}
+
+/*right arrow*/
+.right {
+ width: 10px;
+ height: 10px;
+ position: absolute;
+ left: 4px;
+ top: 1px;
+
+}
+
+.right-arrow1, .right-arrow2 {
+ width: 0;
+ height: 0;
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ border-top: 5px transparent dashed;
+ border-right: 5px transparent dashed;
+ border-bottom: 5px transparent dashed;
+ border-left: 5px #2e6f9a solid;
+ overflow: hidden;
+}
+
+.right-arrow1 {
+
+ border-left: 5px white solid;
+}
+
+.right-arrow2 {
+ left: -2px;
+}
+
+/*left arrow */
+.left {
+ width: 10px;
+ height: 10px;
+ position: absolute;
+ left: -2px;
+ top: 1px;
+ z-index: 2;
+}
+
+.left-arrow1, .left-arrow2 {
+ width: 0;
+ height: 0;
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 5; /*ie8-*/
+ border-top: 5px transparent dashed;
+ border-left: 5px transparent dashed;
+ border-bottom: 5px transparent dashed;
+ border-right: 5px #2e6f9a solid;
+ overflow: hidden;
+}
+
+.left-arrow1 {
+ border-right: 5px #fff solid;
+}
+
+.left-arrow2 {
+ left: 2px;
+}
+
+/*top arrow*/
+.top {
+ width: 10px;
+ height: 10px;
+ position: absolute;
+ left: 1px;
+ z-index: 2;
+}
+
+.top-arrow1, .top-arrow2 {
+ width: 0;
+ height: 0;
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 5;
+ border-bottom: 5px #2e6f9a solid;
+ border-left: 5px transparent dashed;
+ border-right: 5px transparent dashed;
+ border-top: 5px transparent dashed;
+ overflow: hidden;
+}
+
+.top-arrow1 {
+ z-index: 6;
+}
+
+.top-arrow2 {
+ top: -2px;
+ border-bottom: 5px white solid;
+}
+
+/*bottom arrow*/
+.bottom {
+ width: 10px;
+ height: 10px;
+ position: absolute;
+ left: 1px;
+ top: 4px;
+ z-index: 2;
+}
+
+.bottom-arrow1, .bottom-arrow2 {
+ width: 0;
+ height: 0;
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 5;
+ border-bottom: 5px transparent dashed;
+ border-left: 5px transparent dashed;
+ border-right: 5px transparent dashed;
+ border-top: 5px #2e6f9a solid;
+ overflow: hidden;
+}
+
+.bottom-arrow1 {
+ top: -2px;
+ z-index: 6;
+}
+
+.bottom-arrow2 {
+ border-top: 5px white solid;
+}
+/**
+ * Anchors End
+ */
+
+.node .name {
+ width: 55px;
+ height: 12px;
+ text-align: center;
+ white-space: nowrap;
+ color: #5c6d90;
+ line-height: 12px;
+ cursor: pointer;
+ font-family: Arial;
+ font-size: 12px;
+}
+
+.resizeable {
+ background-color: darkolivegreen;
+ border:1px solid blue;
+ margin: 10px;
+}
+
-<!--\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
-<div (click)="onClick($event)" (mousedown)="onMousedown()" (dblclick)="showProperties($event)" class="node" id="{{node.id}}"\r
- (mouseover)="onMouseOver($event, $event.target.parentNode)" (mouseout)="onMouseOut($event, $event.target.parentNode)" [style.top]="node.position.top + 'px'"\r
- [style.left]="node.position.left + 'px'" [style.width]="node.position.width + 'px'" #nodeItem>\r
-\r
- <div class="name">{{node.name}}</div>\r
-\r
- <div *ngIf="canHaveChildren()" b4tResizable class="node-icon" [style.width]="node.position.width + 'px'" [style.height]="node.position.height + 'px'"\r
- [class.active]="active">\r
- <b4t-node *ngFor="let child of node.children" [node]="child" [rank]="rank + 10"></b4t-node>\r
- <div class="anchor anchors anchor-left">\r
- <span class="left">\r
- <i class="left-arrow1"></i>\r
- <i class="left-arrow2"></i>\r
- </span>\r
- </div>\r
- <div class="anchor anchors anchor-right">\r
- <span class="right">\r
- <i class="right-arrow1"></i>\r
- <i class="right-arrow2"></i>\r
- </span>\r
- </div>\r
- </div>\r
-\r
- <div *ngIf="!canHaveChildren()" class="node-icon" [class.active]="active">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" [style.width]="node.position.width + 'px'" [style.height]="node.position.height + 'px'">\r
- <g [ngSwitch]="node.type">\r
- <g *ngSwitchCase="nodeType[nodeType.startEvent]">\r
- <path class="st0" d="M15,2c7.2,0,13,5.8,13,13s-5.8,13-13,13S2,22.2,2,15S7.8,2,15,2 M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15\r
- s15-6.7,15-15S23.3,0,15,0L15,0z" />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.endEvent]">\r
- <path class="st0" d="M15,4c6.1,0,11,4.9,11,11s-4.9,11-11,11S4,21.1,4,15S8.9,4,15,4 M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15\r
- s15-6.7,15-15S23.3,0,15,0L15,0z" />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.errorStartEvent]">\r
- <path class="st0" d="M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15s15-6.7,15-15S23.3,0,15,0z M15,28C7.8,28,2,22.2,2,15S7.8,2,15,2\r
- s13,5.8,13,13S22.2,28,15,28z" />\r
- <path class="st0" d="M19.7,12H17l2-5.5c0.1-0.3,0.1-0.5-0.1-0.7c-0.2-0.2-0.3-0.3-0.6-0.3H14c-0.3,0-0.6,0.2-0.8,0.5L9.7,16\r
- c-0.1,0.3-0.1,0.5,0.1,0.7c0.2,0.2,0.3,0.3,0.6,0.3l3.6,0.1l-1,6.7c-0.1,0.3,0.2,0.8,0.5,0.9c0.1,0,0.2,0,0.3,0\r
- c0.3,0,0.7-0.2,0.9-0.4l5.5-11.1c0.1-0.3,0.1-0.5,0-0.8C20.2,12.1,19.9,12,19.7,12z M14.6,22.3l1.2-5.9c0-0.3,0-0.4-0.2-0.6\r
- c-0.2-0.2-0.3-0.3-0.6-0.3h-3.5L14.5,7h2.6l-2,5.4C15,12.8,15,13,15.2,13.2c0.2,0.2,0.3,0.3,0.6,0.3h2.5L14.6,22.3z"\r
- />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.errorEndEvent]">\r
- <path class="st0" d="M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15s15-6.7,15-15S23.3,0,15,0z M15,26C8.9,26,4,21.1,4,15S8.9,4,15,4\r
- s11,4.9,11,11S21.1,26,15,26z" />\r
- <path class="st0" d="M19.7,12.4H17l2-5.5c0.1-0.3,0.1-0.5-0.1-0.7c-0.2-0.2-0.3-0.3-0.6-0.3h-4.2c-0.3,0-0.6,0.2-0.8,0.5l-3.5,10\r
- c-0.1,0.3-0.1,0.5,0.1,0.7c0.2,0.2,0.3,0.3,0.6,0.3l3.6,0.1l-1,6.7c-0.1,0.3,0.2,0.8,0.5,0.9c0.1,0,0.2,0,0.3,0\r
- c0.3,0,0.7-0.2,0.9-0.4l5.5-11.1c0.1-0.3,0.1-0.5,0-0.8C20.2,12.6,20,12.4,19.7,12.4z" />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.toscaNodeManagementTask]">\r
- <path class="st0" d="M24,29H6c-2.8,0-5-2.2-5-5V6c0-2.8,2.2-5,5-5h18c2.8,0,5,2.2,5,5v18C29,26.8,26.8,29,24,29z M6,3\r
- C4.3,3,3,4.3,3,6v18c0,1.7,1.3,3,3,3h18c1.7,0,3-1.3,3-3V6c0-1.7-1.3-3-3-3H6z" />\r
- <path class="st0" d="M7.6,14.5h7.5c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,14.5,7.6,14.5z" />\r
- <path class="st0" d="M7.6,18.7h3.7c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,18.7,7.6,18.7z" />\r
- <path class="st0" d="M7.6,10.4H19c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,10.4,7.6,10.4z" />\r
- <path class="st0" d="M24.7,15.1h-5c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1h1.5v5.7c0,0.6,0.4,1,1,1s1-0.4,1-1v-5.7h1.5c0.6,0,1-0.4,1-1\r
- C25.7,15.5,25.2,15.1,24.7,15.1z" />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.restTask]">\r
- <path class="st0" d="M24,29H6c-2.8,0-5-2.2-5-5V6c0-2.8,2.2-5,5-5h18c2.8,0,5,2.2,5,5v18C29,26.8,26.8,29,24,29z M6,3\r
- C4.3,3,3,4.3,3,6v18c0,1.7,1.3,3,3,3h18c1.7,0,3-1.3,3-3V6c0-1.7-1.3-3-3-3H6z" />\r
- <path class="st0" d="M7.6,14.5h7.5c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,14.5,7.6,14.5z" />\r
- <path class="st0" d="M7.6,18.7h3.7c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,18.7,7.6,18.7z" />\r
- <path class="st0" d="M7.6,10.4H19c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,10.4,7.6,10.4z" />\r
- <path class="st0" d="M24.1,22.6l-1.6-2.7c0.9-0.4,1.5-1.2,1.5-2.2c0-1.4-1.2-2.5-2.8-2.5h-1.9c-0.2,0-0.4,0.1-0.6,0.2\r
- c-0.2,0.1-0.3,0.3-0.3,0.6v7c0,0.4,0.3,0.8,0.8,0.8c0.4,0,0.8-0.3,0.8-0.8v-2.8h0.8l1.9,3.2c0.1,0.2,0.4,0.4,0.7,0.4\r
- c0.1,0,0.3,0,0.4-0.1C24.2,23.5,24.4,23,24.1,22.6z M20.1,16.8h1.2c0.6,0,1.2,0.4,1.2,0.9s-0.5,0.9-1.2,0.9h-1.2V16.8z"\r
- />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.exclusiveGateway]">\r
- <path class="st0" d="M16.4,15l3.2-3.2c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L15,13.6l-3.2-3.2c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4\r
- l3.2,3.2l-3.2,3.2c-0.4,0.4-0.4,1,0,1.4s1,0.4,1.4,0l3.2-3.2l3.2,3.2c0.4,0.4,1,0.4,1.4,0s0.4-1,0-1.4L16.4,15z"\r
- />\r
- <path class="st0" d="M29.1,12.9l-12-12c-1.1-1.1-3.1-1.1-4.2,0l-12,12C0.3,13.4,0,14.2,0,15s0.3,1.6,0.9,2.1l12,12\r
- c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9l12-12c0.6-0.6,0.9-1.3,0.9-2.1S29.7,13.4,29.1,12.9z M27.7,15.7l-12,12\r
- c-0.4,0.4-1,0.4-1.4,0l-12-12C2.1,15.5,2,15.3,2,15s0.1-0.5,0.3-0.7l12-12C14.5,2.1,14.7,2,15,2s0.5,0.1,0.7,0.3l12,12\r
- c0.2,0.2,0.3,0.4,0.3,0.7S27.9,15.5,27.7,15.7z" />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.parallelGateway]">\r
- <path class="st0" d="M20.5,14H16V9.5c0-0.6-0.4-1-1-1s-1,0.4-1,1V14H9.5c-0.6,0-1,0.4-1,1s0.4,1,1,1H14v4.5c0,0.6,0.4,1,1,1\r
- s1-0.4,1-1V16h4.5c0.6,0,1-0.4,1-1S21.1,14,20.5,14z" />\r
- <path class="st0" d="M29.1,12.9l-12-12c-1.1-1.1-3.1-1.1-4.2,0l-12,12C0.3,13.4,0,14.2,0,15s0.3,1.6,0.9,2.1l12,12\r
- c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9l12-12c0.6-0.6,0.9-1.3,0.9-2.1S29.7,13.4,29.1,12.9z M27.7,15.7l-12,12\r
- c-0.4,0.4-1,0.4-1.4,0l-12-12C2.1,15.5,2,15.3,2,15s0.1-0.5,0.3-0.7l12-12C14.5,2.1,14.7,2,15,2s0.5,0.1,0.7,0.3l12,12\r
- c0.2,0.2,0.3,0.4,0.3,0.7S27.9,15.5,27.7,15.7z" />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.subProcess]">\r
- <path class="st0" d="M24.5,1h-18c-2.8,0-5,2.2-5,5v18c0,2.8,2.2,5,5,5h18c2.8,0,5-2.2,5-5V6C29.5,3.2,27.2,1,24.5,1z M20.2,27h-9.4\r
- v-9.1c0-0.3,0.2-0.5,0.5-0.5h8.4c0.3,0,0.5,0.2,0.5,0.5V27z M27.5,24c0,1.7-1.3,3-3,3h-2.3v-9.1c0-1.4-1.1-2.5-2.5-2.5h-8.4\r
- c-1.4,0-2.5,1.1-2.5,2.5V27H6.5c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h18c1.7,0,3,1.3,3,3V24z" />\r
- <path class="st0" d="M19,21.3h-2.5v-2.5c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v2.5H12c-0.6,0-1,0.4-1,1s0.4,1,1,1h2.5v2.5\r
- c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1v-2.5H19c0.6,0,1-0.4,1-1S19.5,21.3,19,21.3z" />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.intermediateCatchEvent]">\r
- <path class="st0" d="M15,0C6.7,0,0,6.7,0,15c0,8.3,6.7,15,15,15c8.3,0,15-6.7,15-15C30,6.7,23.3,0,15,0z M16,27.9V26\r
- c0-0.6-0.4-1-1-1s-1,0.4-1,1v1.9C7.6,27.5,2.5,22.4,2.1,16H4c0.6,0,1-0.4,1-1s-0.4-1-1-1H2.1C2.5,7.6,7.6,2.5,14,2.1V4\r
- c0,0.6,0.4,1,1,1s1-0.4,1-1V2.1C22.4,2.5,27.5,7.6,27.9,14H26c-0.6,0-1,0.4-1,1s0.4,1,1,1h1.9C27.5,22.4,22.4,27.5,16,27.9z"\r
- />\r
- <path class="st0" d="M20,14h-3.6l2.5-6.6c0.2-0.5-0.1-1.1-0.6-1.3c-0.5-0.2-1.1,0.1-1.3,0.6l-3,8c-0.1,0.3-0.1,0.7,0.1,0.9\r
- c0.2,0.3,0.5,0.4,0.8,0.4h5c0.6,0,1-0.4,1-1S20.6,14,20,14z" />\r
- </g>\r
- <g *ngSwitchCase="nodeType[nodeType.scriptTask]">\r
- <path class="st0" d="M24,1H6C3.2,1,1,3.2,1,6v18c0,2.8,2.2,5,5,5h18c2.8,0,5-2.2,5-5V6C29,3.2,26.8,1,24,1z M16.9,3.4\r
- c0.5,0,0.9,0.2,1.3,0.5c0.4,0.4,0.5,0.8,0.5,1.3c0,0.5-0.2,0.9-0.5,1.3L17.7,7l-5.3,5.3c-0.2-0.6-0.5-1.2-0.9-1.6\r
- c-0.4-0.4-1-0.8-1.6-0.9l5.8-5.8C16,3.6,16.4,3.4,16.9,3.4z M10.3,27H6c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h8.2l-7.4,7.4\r
- c-0.1,0.1-0.2,0.2-0.3,0.3c-0.7,0.7-1,1.6-1,2.5c0,0.9,0.4,1.8,1,2.5l5.2,5.2l-1.3,1.3c-0.7,0.7-1,1.6-1,2.5\r
- C9.3,25.5,9.7,26.4,10.3,27z M14.1,25.9c-0.4,0.4-0.8,0.5-1.3,0.5c-0.5,0-0.9-0.2-1.3-0.5c-0.4-0.4-0.5-0.8-0.5-1.3\r
- c0-0.5,0.2-0.9,0.5-1.3l1.3-1.3l0.5,0.5l0.8,0.8c0.4,0.4,0.5,0.8,0.5,1.3C14.6,25.1,14.5,25.5,14.1,25.9z M14.5,21.3l-6.8-6.8\r
- c-0.4-0.4-0.5-0.8-0.5-1.3c0-0.5,0.2-0.9,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5c0.5,0,0.9,0.2,1.3,0.5c0.4,0.4,0.5,0.8,0.5,1.3\r
- c0,0.5-0.2,0.9-0.5,1.3l0.9,0.9c0.2,0.2,0.4,0.2,0.6,0l5.2-5.2l4.4,4.4l0.8,0.8c0.4,0.4,0.5,0.8,0.5,1.3c0,0.5-0.2,0.9-0.5,1.3v0\r
- l-5.8,5.8c-0.1-0.6-0.5-1.2-0.9-1.6L14.5,21.3z M27,24c0,1.7-1.3,3-3,3h-8.6l7.9-7.9c0.7-0.7,1-1.6,1-2.5c0-0.9-0.4-1.8-1-2.5\r
- l-0.8-0.8L18.1,9l1.3-1.3c0.7-0.7,1-1.6,1-2.5c0-0.8-0.3-1.6-0.8-2.2H24c1.7,0,3,1.3,3,3V24z" />\r
- <path class="st0" d="M17.2,12.4c-0.3-0.3-0.8-0.3-1.1,0L12.6,16c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2\r
- l3.6-3.6C17.5,13.1,17.5,12.7,17.2,12.4z" />\r
- <path class="st0" d="M18.9,14.2c-0.3-0.3-0.8-0.3-1.1,0l-3.6,3.6c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2\r
- c0.2,0,0.4-0.1,0.5-0.2l3.6-3.6C19.2,14.9,19.2,14.4,18.9,14.2z" />\r
- <path class="st0" d="M17.1,20.6l3.6-3.6c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0L16,19.5c-0.3,0.3-0.3,0.8,0,1.1\r
- c0.1,0.1,0.3,0.2,0.5,0.2S17,20.7,17.1,20.6z" />\r
- </g>\r
- </g>\r
- </svg>\r
- <div class="anchor anchors anchor-left">\r
- <span class="left">\r
- <i class="left-arrow1"></i>\r
- <i class="left-arrow2"></i>\r
- </span>\r
- </div>\r
- <div class="anchor anchors anchor-right">\r
- <span class="right">\r
- <i class="right-arrow1"></i>\r
- <i class="right-arrow2"></i>\r
- </span>\r
- </div>\r
- </div>\r
-</div>\r
+<!--
+/**
+ * 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
+ */
+-->
+<div (click)="onClick($event)" (mousedown)="onMousedown()" (dblclick)="showProperties($event)" class="node" id="{{node.id}}"
+ (mouseover)="onMouseOver($event, $event.target.parentNode)" (mouseout)="onMouseOut($event, $event.target.parentNode)" [style.top]="node.position.top + 'px'"
+ [style.left]="node.position.left + 'px'" [style.width]="node.position.width + 'px'" #nodeItem>
+
+ <div class="name">{{node.name}}</div>
+
+ <div *ngIf="canHaveChildren()" b4tResizable class="node-icon" [style.width]="node.position.width + 'px'" [style.height]="node.position.height + 'px'"
+ [class.active]="active">
+ <b4t-node *ngFor="let child of node.children" [node]="child" [rank]="rank + 10"></b4t-node>
+ <div class="anchor anchors anchor-left">
+ <span class="left">
+ <i class="left-arrow1"></i>
+ <i class="left-arrow2"></i>
+ </span>
+ </div>
+ <div class="anchor anchors anchor-right">
+ <span class="right">
+ <i class="right-arrow1"></i>
+ <i class="right-arrow2"></i>
+ </span>
+ </div>
+ </div>
+
+ <div *ngIf="!canHaveChildren()" class="node-icon" [class.active]="active">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" [style.width]="node.position.width + 'px'" [style.height]="node.position.height + 'px'">
+ <g [ngSwitch]="node.type">
+ <g *ngSwitchCase="nodeType[nodeType.startEvent]">
+ <path class="st0" d="M15,2c7.2,0,13,5.8,13,13s-5.8,13-13,13S2,22.2,2,15S7.8,2,15,2 M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15
+ s15-6.7,15-15S23.3,0,15,0L15,0z" />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.endEvent]">
+ <path class="st0" d="M15,4c6.1,0,11,4.9,11,11s-4.9,11-11,11S4,21.1,4,15S8.9,4,15,4 M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15
+ s15-6.7,15-15S23.3,0,15,0L15,0z" />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.errorStartEvent]">
+ <path class="st0" d="M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15s15-6.7,15-15S23.3,0,15,0z M15,28C7.8,28,2,22.2,2,15S7.8,2,15,2
+ s13,5.8,13,13S22.2,28,15,28z" />
+ <path class="st0" d="M19.7,12H17l2-5.5c0.1-0.3,0.1-0.5-0.1-0.7c-0.2-0.2-0.3-0.3-0.6-0.3H14c-0.3,0-0.6,0.2-0.8,0.5L9.7,16
+ c-0.1,0.3-0.1,0.5,0.1,0.7c0.2,0.2,0.3,0.3,0.6,0.3l3.6,0.1l-1,6.7c-0.1,0.3,0.2,0.8,0.5,0.9c0.1,0,0.2,0,0.3,0
+ c0.3,0,0.7-0.2,0.9-0.4l5.5-11.1c0.1-0.3,0.1-0.5,0-0.8C20.2,12.1,19.9,12,19.7,12z M14.6,22.3l1.2-5.9c0-0.3,0-0.4-0.2-0.6
+ c-0.2-0.2-0.3-0.3-0.6-0.3h-3.5L14.5,7h2.6l-2,5.4C15,12.8,15,13,15.2,13.2c0.2,0.2,0.3,0.3,0.6,0.3h2.5L14.6,22.3z"
+ />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.errorEndEvent]">
+ <path class="st0" d="M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15s15-6.7,15-15S23.3,0,15,0z M15,26C8.9,26,4,21.1,4,15S8.9,4,15,4
+ s11,4.9,11,11S21.1,26,15,26z" />
+ <path class="st0" d="M19.7,12.4H17l2-5.5c0.1-0.3,0.1-0.5-0.1-0.7c-0.2-0.2-0.3-0.3-0.6-0.3h-4.2c-0.3,0-0.6,0.2-0.8,0.5l-3.5,10
+ c-0.1,0.3-0.1,0.5,0.1,0.7c0.2,0.2,0.3,0.3,0.6,0.3l3.6,0.1l-1,6.7c-0.1,0.3,0.2,0.8,0.5,0.9c0.1,0,0.2,0,0.3,0
+ c0.3,0,0.7-0.2,0.9-0.4l5.5-11.1c0.1-0.3,0.1-0.5,0-0.8C20.2,12.6,20,12.4,19.7,12.4z" />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.toscaNodeManagementTask]">
+ <path class="st0" d="M24,29H6c-2.8,0-5-2.2-5-5V6c0-2.8,2.2-5,5-5h18c2.8,0,5,2.2,5,5v18C29,26.8,26.8,29,24,29z M6,3
+ C4.3,3,3,4.3,3,6v18c0,1.7,1.3,3,3,3h18c1.7,0,3-1.3,3-3V6c0-1.7-1.3-3-3-3H6z" />
+ <path class="st0" d="M7.6,14.5h7.5c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,14.5,7.6,14.5z" />
+ <path class="st0" d="M7.6,18.7h3.7c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,18.7,7.6,18.7z" />
+ <path class="st0" d="M7.6,10.4H19c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,10.4,7.6,10.4z" />
+ <path class="st0" d="M24.7,15.1h-5c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1h1.5v5.7c0,0.6,0.4,1,1,1s1-0.4,1-1v-5.7h1.5c0.6,0,1-0.4,1-1
+ C25.7,15.5,25.2,15.1,24.7,15.1z" />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.restTask]">
+ <path class="st0" d="M24,29H6c-2.8,0-5-2.2-5-5V6c0-2.8,2.2-5,5-5h18c2.8,0,5,2.2,5,5v18C29,26.8,26.8,29,24,29z M6,3
+ C4.3,3,3,4.3,3,6v18c0,1.7,1.3,3,3,3h18c1.7,0,3-1.3,3-3V6c0-1.7-1.3-3-3-3H6z" />
+ <path class="st0" d="M7.6,14.5h7.5c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,14.5,7.6,14.5z" />
+ <path class="st0" d="M7.6,18.7h3.7c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,18.7,7.6,18.7z" />
+ <path class="st0" d="M7.6,10.4H19c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,10.4,7.6,10.4z" />
+ <path class="st0" d="M24.1,22.6l-1.6-2.7c0.9-0.4,1.5-1.2,1.5-2.2c0-1.4-1.2-2.5-2.8-2.5h-1.9c-0.2,0-0.4,0.1-0.6,0.2
+ c-0.2,0.1-0.3,0.3-0.3,0.6v7c0,0.4,0.3,0.8,0.8,0.8c0.4,0,0.8-0.3,0.8-0.8v-2.8h0.8l1.9,3.2c0.1,0.2,0.4,0.4,0.7,0.4
+ c0.1,0,0.3,0,0.4-0.1C24.2,23.5,24.4,23,24.1,22.6z M20.1,16.8h1.2c0.6,0,1.2,0.4,1.2,0.9s-0.5,0.9-1.2,0.9h-1.2V16.8z"
+ />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.exclusiveGateway]">
+ <path class="st0" d="M16.4,15l3.2-3.2c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L15,13.6l-3.2-3.2c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4
+ l3.2,3.2l-3.2,3.2c-0.4,0.4-0.4,1,0,1.4s1,0.4,1.4,0l3.2-3.2l3.2,3.2c0.4,0.4,1,0.4,1.4,0s0.4-1,0-1.4L16.4,15z"
+ />
+ <path class="st0" d="M29.1,12.9l-12-12c-1.1-1.1-3.1-1.1-4.2,0l-12,12C0.3,13.4,0,14.2,0,15s0.3,1.6,0.9,2.1l12,12
+ c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9l12-12c0.6-0.6,0.9-1.3,0.9-2.1S29.7,13.4,29.1,12.9z M27.7,15.7l-12,12
+ c-0.4,0.4-1,0.4-1.4,0l-12-12C2.1,15.5,2,15.3,2,15s0.1-0.5,0.3-0.7l12-12C14.5,2.1,14.7,2,15,2s0.5,0.1,0.7,0.3l12,12
+ c0.2,0.2,0.3,0.4,0.3,0.7S27.9,15.5,27.7,15.7z" />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.parallelGateway]">
+ <path class="st0" d="M20.5,14H16V9.5c0-0.6-0.4-1-1-1s-1,0.4-1,1V14H9.5c-0.6,0-1,0.4-1,1s0.4,1,1,1H14v4.5c0,0.6,0.4,1,1,1
+ s1-0.4,1-1V16h4.5c0.6,0,1-0.4,1-1S21.1,14,20.5,14z" />
+ <path class="st0" d="M29.1,12.9l-12-12c-1.1-1.1-3.1-1.1-4.2,0l-12,12C0.3,13.4,0,14.2,0,15s0.3,1.6,0.9,2.1l12,12
+ c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9l12-12c0.6-0.6,0.9-1.3,0.9-2.1S29.7,13.4,29.1,12.9z M27.7,15.7l-12,12
+ c-0.4,0.4-1,0.4-1.4,0l-12-12C2.1,15.5,2,15.3,2,15s0.1-0.5,0.3-0.7l12-12C14.5,2.1,14.7,2,15,2s0.5,0.1,0.7,0.3l12,12
+ c0.2,0.2,0.3,0.4,0.3,0.7S27.9,15.5,27.7,15.7z" />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.subProcess]">
+ <path class="st0" d="M24.5,1h-18c-2.8,0-5,2.2-5,5v18c0,2.8,2.2,5,5,5h18c2.8,0,5-2.2,5-5V6C29.5,3.2,27.2,1,24.5,1z M20.2,27h-9.4
+ v-9.1c0-0.3,0.2-0.5,0.5-0.5h8.4c0.3,0,0.5,0.2,0.5,0.5V27z M27.5,24c0,1.7-1.3,3-3,3h-2.3v-9.1c0-1.4-1.1-2.5-2.5-2.5h-8.4
+ c-1.4,0-2.5,1.1-2.5,2.5V27H6.5c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h18c1.7,0,3,1.3,3,3V24z" />
+ <path class="st0" d="M19,21.3h-2.5v-2.5c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v2.5H12c-0.6,0-1,0.4-1,1s0.4,1,1,1h2.5v2.5
+ c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1v-2.5H19c0.6,0,1-0.4,1-1S19.5,21.3,19,21.3z" />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.intermediateCatchEvent]">
+ <path class="st0" d="M15,0C6.7,0,0,6.7,0,15c0,8.3,6.7,15,15,15c8.3,0,15-6.7,15-15C30,6.7,23.3,0,15,0z M16,27.9V26
+ c0-0.6-0.4-1-1-1s-1,0.4-1,1v1.9C7.6,27.5,2.5,22.4,2.1,16H4c0.6,0,1-0.4,1-1s-0.4-1-1-1H2.1C2.5,7.6,7.6,2.5,14,2.1V4
+ c0,0.6,0.4,1,1,1s1-0.4,1-1V2.1C22.4,2.5,27.5,7.6,27.9,14H26c-0.6,0-1,0.4-1,1s0.4,1,1,1h1.9C27.5,22.4,22.4,27.5,16,27.9z"
+ />
+ <path class="st0" d="M20,14h-3.6l2.5-6.6c0.2-0.5-0.1-1.1-0.6-1.3c-0.5-0.2-1.1,0.1-1.3,0.6l-3,8c-0.1,0.3-0.1,0.7,0.1,0.9
+ c0.2,0.3,0.5,0.4,0.8,0.4h5c0.6,0,1-0.4,1-1S20.6,14,20,14z" />
+ </g>
+ <g *ngSwitchCase="nodeType[nodeType.scriptTask]">
+ <path class="st0" d="M24,1H6C3.2,1,1,3.2,1,6v18c0,2.8,2.2,5,5,5h18c2.8,0,5-2.2,5-5V6C29,3.2,26.8,1,24,1z M16.9,3.4
+ c0.5,0,0.9,0.2,1.3,0.5c0.4,0.4,0.5,0.8,0.5,1.3c0,0.5-0.2,0.9-0.5,1.3L17.7,7l-5.3,5.3c-0.2-0.6-0.5-1.2-0.9-1.6
+ c-0.4-0.4-1-0.8-1.6-0.9l5.8-5.8C16,3.6,16.4,3.4,16.9,3.4z M10.3,27H6c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h8.2l-7.4,7.4
+ c-0.1,0.1-0.2,0.2-0.3,0.3c-0.7,0.7-1,1.6-1,2.5c0,0.9,0.4,1.8,1,2.5l5.2,5.2l-1.3,1.3c-0.7,0.7-1,1.6-1,2.5
+ C9.3,25.5,9.7,26.4,10.3,27z M14.1,25.9c-0.4,0.4-0.8,0.5-1.3,0.5c-0.5,0-0.9-0.2-1.3-0.5c-0.4-0.4-0.5-0.8-0.5-1.3
+ c0-0.5,0.2-0.9,0.5-1.3l1.3-1.3l0.5,0.5l0.8,0.8c0.4,0.4,0.5,0.8,0.5,1.3C14.6,25.1,14.5,25.5,14.1,25.9z M14.5,21.3l-6.8-6.8
+ c-0.4-0.4-0.5-0.8-0.5-1.3c0-0.5,0.2-0.9,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5c0.5,0,0.9,0.2,1.3,0.5c0.4,0.4,0.5,0.8,0.5,1.3
+ c0,0.5-0.2,0.9-0.5,1.3l0.9,0.9c0.2,0.2,0.4,0.2,0.6,0l5.2-5.2l4.4,4.4l0.8,0.8c0.4,0.4,0.5,0.8,0.5,1.3c0,0.5-0.2,0.9-0.5,1.3v0
+ l-5.8,5.8c-0.1-0.6-0.5-1.2-0.9-1.6L14.5,21.3z M27,24c0,1.7-1.3,3-3,3h-8.6l7.9-7.9c0.7-0.7,1-1.6,1-2.5c0-0.9-0.4-1.8-1-2.5
+ l-0.8-0.8L18.1,9l1.3-1.3c0.7-0.7,1-1.6,1-2.5c0-0.8-0.3-1.6-0.8-2.2H24c1.7,0,3,1.3,3,3V24z" />
+ <path class="st0" d="M17.2,12.4c-0.3-0.3-0.8-0.3-1.1,0L12.6,16c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2
+ l3.6-3.6C17.5,13.1,17.5,12.7,17.2,12.4z" />
+ <path class="st0" d="M18.9,14.2c-0.3-0.3-0.8-0.3-1.1,0l-3.6,3.6c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2
+ c0.2,0,0.4-0.1,0.5-0.2l3.6-3.6C19.2,14.9,19.2,14.4,18.9,14.2z" />
+ <path class="st0" d="M17.1,20.6l3.6-3.6c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0L16,19.5c-0.3,0.3-0.3,0.8,0,1.1
+ c0.1,0.1,0.3,0.2,0.5,0.2S17,20.7,17.1,20.6z" />
+ </g>
+ </g>
+ </svg>
+ <div class="anchor anchors anchor-left">
+ <span class="left">
+ <i class="left-arrow1"></i>
+ <i class="left-arrow2"></i>
+ </span>
+ </div>
+ <div class="anchor anchors anchor-right">
+ <span class="right">
+ <i class="right-arrow1"></i>
+ <i class="right-arrow2"></i>
+ </span>
+ </div>
+ </div>
+</div>
\ No newline at end of file
-/**\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 { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core';\r
-\r
-import { Subscription } from 'rxjs/Subscription';\r
-import { SubProcess } from '../../model/workflow/sub-process';\r
-import { WorkflowNode } from '../../model/workflow/workflow-node';\r
-import { BroadcastService } from '../../services/broadcast.service';\r
-import { JsPlumbService } from '../../services/jsplumb.service';\r
-import { ModelService } from '../../services/model.service';\r
-import { NodeType } from '../../model/workflow/node-type.enum';\r
-\r
-/**\r
- * node component represent a single workflow node.\r
- * every node would be rendered on the container component\r
- */\r
-@Component({\r
- selector: 'b4t-node',\r
- styleUrls: ['./node.component.css'],\r
- templateUrl: 'node.component.html',\r
-})\r
-export class NodeComponent implements AfterViewInit, OnDestroy {\r
- @Input() public node: WorkflowNode;\r
- @Input() public rank: number;\r
- @ViewChild('nodeItem') nodeItem: ElementRef;\r
-\r
- public nodeType = NodeType;\r
- public active = false;\r
- private currentWorkflowSubscription: Subscription;\r
- private isMoving = false;\r
-\r
- constructor(private jsPlumbService: JsPlumbService,\r
- private modelService: ModelService,\r
- private broadcastService: BroadcastService) {\r
- }\r
-\r
- public ngAfterViewInit() {\r
- this.jsPlumbService.initJsPlumbInstance(this.node.parentId);\r
- this.jsPlumbService.initNode(this.node);\r
-\r
- if (this.canHaveChildren()) {\r
- this.jsPlumbService.nodeDroppable(this.node, this.rank);\r
- this.jsPlumbService.connectChildrenNodes(this.node.id);\r
- }\r
-\r
- this.currentWorkflowSubscription = this.broadcastService.selectedElement$.subscribe(activeNodes => {\r
- let active = false;\r
- for (let index = 0; index < activeNodes.length; index++) {\r
- let activeNode = activeNodes[index] as WorkflowNode;\r
- if (activeNode.id === this.node.id) {\r
- active = true;\r
- break;\r
- }\r
- }\r
- this.active = active;\r
- });\r
- }\r
-\r
- public ngOnDestroy() {\r
- this.currentWorkflowSubscription.unsubscribe();\r
- if (this.nodeItem.nativeElement.onmousemove) {\r
- this.nodeItem.nativeElement.onmousemove = null;\r
- }\r
- }\r
-\r
- public onMousedown() {\r
- let currentThis = this;\r
- this.nodeItem.nativeElement.onmousemove = function () {\r
- currentThis.isMoving = true;\r
- };\r
- }\r
-\r
- public onClick(event) {\r
- if (this.nodeItem.nativeElement.onmousemove) {\r
- this.nodeItem.nativeElement.onmousemove = null;\r
- }\r
- if (this.isMoving && this.active) {\r
- this.isMoving = false;\r
- return;\r
- }\r
- event.stopPropagation();\r
- this.broadcastService.broadcast(this.broadcastService.showProperty, null);\r
- this.broadcastService.broadcast(this.broadcastService.selectedElement, [this.node]);\r
- }\r
-\r
- public canHaveChildren(): boolean {\r
- return this.node.type === 'subProcess';\r
- }\r
-\r
- public onMouseOut(event, target) {\r
- event.stopPropagation();\r
- target.classList.remove('hover');\r
- }\r
-\r
- public onMouseOver(event, target) {\r
- event.stopPropagation();\r
- target.classList.add('hover');\r
- }\r
-\r
- public showProperties(event) {\r
- event.stopPropagation();\r
- this.broadcastService.broadcast(this.broadcastService.showProperty, this.node);\r
- }\r
-}\r
+/**
+ * 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 { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core';
+
+import { Subscription } from 'rxjs/Subscription';
+import { SubProcess } from '../../model/workflow/sub-process';
+import { WorkflowNode } from '../../model/workflow/workflow-node';
+import { BroadcastService } from '../../services/broadcast.service';
+import { JsPlumbService } from '../../services/jsplumb.service';
+import { ModelService } from '../../services/model.service';
+import { NodeType } from '../../model/workflow/node-type.enum';
+
+/**
+ * node component represent a single workflow node.
+ * every node would be rendered on the container component
+ */
+@Component({
+ selector: 'b4t-node',
+ styleUrls: ['./node.component.css'],
+ templateUrl: 'node.component.html',
+})
+export class NodeComponent implements AfterViewInit, OnDestroy {
+ @Input() public node: WorkflowNode;
+ @Input() public rank: number;
+ @ViewChild('nodeItem') nodeItem: ElementRef;
+
+ public nodeType = NodeType;
+ public active = false;
+ private currentWorkflowSubscription: Subscription;
+ private isMoving = false;
+
+ constructor(private jsPlumbService: JsPlumbService,
+ private modelService: ModelService,
+ private broadcastService: BroadcastService) {
+ }
+
+ public ngAfterViewInit() {
+ this.jsPlumbService.initJsPlumbInstance(this.node.parentId);
+ this.jsPlumbService.initNode(this.node);
+
+ if (this.canHaveChildren()) {
+ this.jsPlumbService.nodeDroppable(this.node, this.rank);
+ this.jsPlumbService.connectChildrenNodes(this.node.id);
+ }
+
+ this.currentWorkflowSubscription = this.broadcastService.selectedElement$.subscribe(activeNodes => {
+ let active = false;
+ for (let index = 0; index < activeNodes.length; index++) {
+ let activeNode = activeNodes[index] as WorkflowNode;
+ if (activeNode.id === this.node.id) {
+ active = true;
+ break;
+ }
+ }
+ this.active = active;
+ });
+ }
+
+ public ngOnDestroy() {
+ this.currentWorkflowSubscription.unsubscribe();
+ if (this.nodeItem.nativeElement.onmousemove) {
+ this.nodeItem.nativeElement.onmousemove = null;
+ }
+ }
+
+ public onMousedown() {
+ let currentThis = this;
+ this.nodeItem.nativeElement.onmousemove = function () {
+ currentThis.isMoving = true;
+ };
+ }
+
+ public onClick(event) {
+ if (this.nodeItem.nativeElement.onmousemove) {
+ this.nodeItem.nativeElement.onmousemove = null;
+ }
+ if (this.isMoving && this.active) {
+ this.isMoving = false;
+ return;
+ }
+ event.stopPropagation();
+ this.broadcastService.broadcast(this.broadcastService.showProperty, null);
+ this.broadcastService.broadcast(this.broadcastService.selectedElement, [this.node]);
+ }
+
+ public canHaveChildren(): boolean {
+ return this.node.type === 'subProcess';
+ }
+
+ public onMouseOut(event, target) {
+ event.stopPropagation();
+ target.classList.remove('hover');
+ }
+
+ public onMouseOver(event, target) {
+ event.stopPropagation();
+ target.classList.add('hover');
+ }
+
+ public showProperties(event) {
+ event.stopPropagation();
+ this.broadcastService.broadcast(this.broadcastService.showProperty, this.node);
+ }
+}
-/**\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
- .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
+/**
+ * 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
+ */
+.form-control-label{
+ margin-bottom: 0;
+ width: 100px;
+ vertical-align: middle;
+}
+
+.parameter-item{
+ display: inline;
+ margin-left: 5px;
+ vertical-align: middle;
+}
+
+.form-control-required{
+ color: red;
+ height: 30px;
+ line-height: 30px;
+}
+
+.form-control-input{
+ width: 120px;
+ vertical-align: middle;
+}
+
+.form-control-value{
+ width: 160px;
+ display: inline-block;
+}
-<!--\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">\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 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 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="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
-</div>\r
+<!--
+/**
+ * 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
+ */
+-->
+
+<div class="form-group">
+ <div *ngIf="showLabel" class="parameter-item" style="margin:0;">
+ <label *ngIf="true === param.required" class="form-control-required">*</label>
+ <input *ngIf="canEditName" class="form-control form-control-input" type="text" [ngModel]="param.name" (ngModelChange)="keyChange($event)">
+ <label *ngIf="!canEditName" class="form-control-label">{{param.name}}</label>
+ </div>
+ <div class="parameter-item">
+ <div *ngIf="showValue" [ngSwitch]="param.valueSource" class="parameter-item">
+ <input *ngSwitchCase="sourceEnum[sourceEnum.String]" class="form-control form-control-value" type="text" [ngModel]="param.value"
+ (ngModelChange)="valueChange($event)">
+ <input *ngSwitchCase="sourceEnum[sourceEnum.Variable]" class="form-control form-control-value" type="text" [ngModel]="param.value"
+ (ngModelChange)="valueChange($event)">
+ <tree-select *ngSwitchCase="sourceEnum[sourceEnum.Plan]" name="simpleSelect" style="vertical-align:top;" [items]="planOptions" childrenField="children"
+ #simpleSelect="ngModel" class="form-control-value" [ngModel]="planValue" (ngModelChange)="valueChange($event)"></tree-select>
+ <select *ngSwitchCase="sourceEnum[sourceEnum.Topology]" class="form-control form-control-value" type="text" [ngModel]="param.value"
+ (ngModelChange)="valueChange($event)">
+ <option *ngFor="let topology of topologyOptions" value="{{topology.value}}">{{topology.name}}</option>
+ </select>
+ </div>
+ <select *ngIf="showValueSource" class="form-control parameter-item" style="width:auto;" type="text" [ngModel]="param.valueSource"
+ (ngModelChange)="valueSourceChange($event)">
+ <option *ngFor="let sourceType of valueSource" value="{{sourceEnum[sourceType]}}">{{sourceEnum[sourceType]}}</option>
+ </select>
+ </div>
+ <div *ngIf="canInsert" class="parameter-item">
+ <button type="button" class="btn blue1" (click)="insertParam()">
+ <i class="fa fa-plus"></i>
+ </button>
+ </div>
+ <div *ngIf="canDelete" class="parameter-item">
+ <button type="button" class="btn oes-red-bg" (click)="deleteParam()">
+ <i class="fa fa-minus"></i>
+ </button>
+ </div>
+</div>
\ No newline at end of file
-/**\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, 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 { DataService } from '../../services/data/data.service';\r
-\r
-/**\r
- * this component contains in property component if the corresponding node has parameter properties\r
- * eg. task node have input and output params, start event node has input param\r
- */\r
-@Component({\r
- selector: 'b4t-parameter',\r
- styleUrls: ['./parameter.component.css'],\r
- templateUrl: 'parameter.component.html',\r
-})\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 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 dataService: DataService) { }\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.topologyOptions = this.dataService.getTopologyProperties();\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
- this.planValue = { id: this.param.value };\r
- }\r
- }\r
-\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 ('object' === typeof (value)) {\r
- this.planValue = value;\r
- this.param.value = value.id;\r
- } else {\r
- this.planValue = { id: '' };\r
- this.param.value = '';\r
- }\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
- private getTreeviewChild(planTreeviewItems: PlanTreeviewItem[]): any[] {\r
- let treeviewItems = [];\r
- if (undefined == planTreeviewItems || 0 === planTreeviewItems.length) {\r
- // todo: debug check if it need [] or undefined.\r
- return treeviewItems;\r
- }\r
- planTreeviewItems.forEach(item => {\r
- const treeviewItem = {\r
- id: item.value,\r
- name: item.name,\r
- disabled: false,\r
- // !item.canSelect,\r
- children: this.getTreeviewChild(item.children)\r
- };\r
- treeviewItems.push(treeviewItem);\r
- });\r
- return treeviewItems;\r
- }\r
-}\r
+/**
+ * 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, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
+
+import { PlanTreeviewItem } from '../../model/plan-treeview-item';
+import { ValueSource } from '../../model/value-source.enum';
+import { Parameter } from '../../model/workflow/parameter';
+import { DataService } from '../../services/data/data.service';
+
+/**
+ * this component contains in property component if the corresponding node has parameter properties
+ * eg. task node have input and output params, start event node has input param
+ */
+@Component({
+ selector: 'b4t-parameter',
+ styleUrls: ['./parameter.component.css'],
+ templateUrl: 'parameter.component.html',
+})
+export class ParameterComponent implements OnChanges, OnInit {
+ @Input() public param: Parameter;
+ @Input() public valueSource: ValueSource[];
+ @Input() public canEditName: boolean;
+ @Input() public showLabel = true;
+ @Input() public canInsert: boolean;
+ @Input() public canDelete: boolean;
+ @Input() public planItems: PlanTreeviewItem[];
+ @Output() public paramChange = new EventEmitter<Parameter>();
+ @Output() insert: EventEmitter<Parameter> = new EventEmitter<Parameter>();
+ @Output() delete: EventEmitter<Parameter> = new EventEmitter<Parameter>();
+
+ public sourceEnum = ValueSource;
+ public valueGroupClass;
+ public valueClass;
+ public valueSourceClass;
+ public planOptions = [];
+ public topologyOptions: { name: string, value: string }[] = [];
+ public showValue = true;
+ public showValueSource = true;
+ public planValue: any = {};
+
+ constructor(private dataService: DataService) { }
+
+ public ngOnChanges(changes: SimpleChanges): void {
+ // if (changes.canInsert && !changes.canInsert.isFirstChange()) {
+ // this.resetValueGroupClass(changes.canInsert.currentValue, this.canDelete);
+ // }
+ // if (changes.canDelete && !changes.canDelete.isFirstChange()) {
+ // this.resetValueGroupClass(this.canInsert, changes.canDelete.currentValue);
+ // }
+ }
+
+ public ngOnInit(): void {
+ // console.warn('Parameter OnInit, parameter name is:' + this.param.name);
+ if (1 === this.valueSource.length) {
+ this.showValueSource = false;
+ }
+ this.topologyOptions = this.dataService.getTopologyProperties();
+ // this.valueClass = {
+ // 'col-md-7': this.showValueSource,
+ // 'col-md-12': !this.showValueSource
+ // };
+ // this.resetValueGroupClass(this.canInsert, this.canDelete);
+ this.updateValueSource(this.param.valueSource);
+ // trans plan options to tree view items.
+ this.initPlanTreeviewItems(this.planItems);
+ if (ValueSource[ValueSource.Plan] === this.param.valueSource) {
+ this.planValue = { id: this.param.value };
+ }
+ }
+
+ public keyChange(key: string) {
+ this.param.name = key;
+ this.paramChange.emit(this.param);
+ }
+
+ public valueChange(value: any) {
+ if (ValueSource[ValueSource.Plan] === this.param.valueSource) {
+ if ('object' === typeof (value)) {
+ this.planValue = value;
+ this.param.value = value.id;
+ } else {
+ this.planValue = { id: '' };
+ this.param.value = '';
+ }
+ } else {
+ this.param.value = value;
+ }
+ this.paramChange.emit(this.param);
+ }
+
+ public valueSourceChange(valueSource: string) {
+ this.updateValueSource(valueSource);
+ this.param.valueSource = valueSource;
+ this.valueChange('');
+ }
+
+ public insertParam(): void {
+ this.insert.emit();
+ }
+
+ public deleteParam(): void {
+ this.delete.emit();
+ }
+
+ private updateValueSource(valueSource: string):void{
+ if(ValueSource[ValueSource.Definition] === valueSource){
+ this.showValue = false;
+ }else{
+ this.showValue = true;
+ }
+ // this.resetValueSourceClass(this.showValue);
+ }
+
+ private resetValueGroupClass(canInsert: boolean, canDelete: boolean): void {
+ // this.valueGroupClass = {
+ // 'col-md-5': canInsert && canDelete,
+ // 'col-md-7': (canInsert && !canDelete) || (!canInsert && canDelete),
+ // 'col-md-9': !canInsert && !canDelete
+ // };
+ }
+
+ private initPlanTreeviewItems(planTreeviewItems: PlanTreeviewItem[]): void {
+ this.planOptions = this.getTreeviewChild(planTreeviewItems);
+ }
+
+ private getTreeviewChild(planTreeviewItems: PlanTreeviewItem[]): any[] {
+ let treeviewItems = [];
+ if (undefined == planTreeviewItems || 0 === planTreeviewItems.length) {
+ // todo: debug check if it need [] or undefined.
+ return treeviewItems;
+ }
+ planTreeviewItems.forEach(item => {
+ const treeviewItem = {
+ id: item.value,
+ name: item.name,
+ disabled: false,
+ // !item.canSelect,
+ children: this.getTreeviewChild(item.children)
+ };
+ treeviewItems.push(treeviewItem);
+ });
+ return treeviewItems;
+ }
+}
<div class="ui-fluid">
<b4t-node-parameters [restConfigId]="this.node.restConfigId" [swaggerInput]="this.node.parameters" [swaggerOutput]="this.node.responses" [planItems]="planItems"></b4t-node-parameters>
-</div>
+</div>
\ No newline at end of file
-<!--\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
- <label class="col-md-3 form-control-label text-md-right">{{'WORKFLOW.SCRIPT_FORMAT' | translate}}</label>\r
- <div class="col-md-9">\r
- <select class="form-control" [(ngModel)]="node.scriptFormat">\r
- <option *ngFor="let script of scriptOperations" value="{{script}}">{{script}}</option>\r
- </select>\r
- </div>\r
-</div>\r
-\r
-<div class="form-group row">\r
- <label class="col-md-3 form-control-label text-md-right">{{'WORKFLOW.SCRIPT' | translate}}</label>\r
- <div class="col-md-9">\r
- <textarea class="form-control" type="text" rows="20" [(ngModel)]="node.script"></textarea>\r
- </div>\r
-</div>\r
-\r
+<!--
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+-->
+
+<div class="form-group row">
+ <label class="col-md-3 form-control-label text-md-right">{{'WORKFLOW.SCRIPT_FORMAT' | translate}}</label>
+ <div class="col-md-9">
+ <select class="form-control" [(ngModel)]="node.scriptFormat">
+ <option *ngFor="let script of scriptOperations" value="{{script}}">{{script}}</option>
+ </select>
+ </div>
+</div>
+
+<div class="form-group row">
+ <label class="col-md-3 form-control-label text-md-right">{{'WORKFLOW.SCRIPT' | translate}}</label>
+ <div class="col-md-9">
+ <textarea class="form-control" type="text" rows="20" [(ngModel)]="node.script"></textarea>
+ </div>
+</div>
+
-/*******************************************************************************\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 { AfterViewInit, Component, Input } from '@angular/core';\r
-\r
-import { ScriptTask } from "../../../model/workflow/script-task";\r
-\r
-@Component({\r
- selector: 'b4t-script-task',\r
- templateUrl: 'script-task.component.html',\r
-})\r
-export class ScriptTaskComponent {\r
- @Input() public node: ScriptTask;\r
-\r
- public scriptOperations = ['JavaScript'];\r
-}\r
+/*******************************************************************************
+ * 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 { AfterViewInit, Component, Input } from '@angular/core';
+
+import { ScriptTask } from "../../../model/workflow/script-task";
+
+@Component({
+ selector: 'b4t-script-task',
+ templateUrl: 'script-task.component.html',
+})
+export class ScriptTaskComponent {
+ @Input() public node: ScriptTask;
+
+ public scriptOperations = ['JavaScript'];
+}
-<!--\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
+<!--
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+-->
+
+<div class="form-group row">
+ <div class="col-md-10"></div>
+ <div class="col-md-2">
+ <button (click)="create();" type="button" class="btn blue1 pull-right">
+ <i class="fa fa-plus"></i>
+ </button>
+ </div>
+</div>
+
+<b4t-parameter *ngFor="let param of node.parameters; let i = index;" [param]="param" [canEditName]="true"
+ [valueSource]="sources" [canDelete]="true" (delete)="delete(i)"></b4t-parameter>
\ No newline at end of file
-/*******************************************************************************\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
+/*******************************************************************************
+ * 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 } from '@angular/core';
+import { Subscription } from 'rxjs/Subscription';
+
+import { ValueSource } from '../../../model/value-source.enum';
+import { Parameter } from '../../../model/workflow/parameter';
+import { StartEvent } from '../../../model/workflow/start-event';
+import { BroadcastService } from '../../../services/broadcast.service';
+import { WorkflowUtil } from '../../../util/workflow-util';
+
+@Component({
+ selector: 'b4t-start-event',
+ templateUrl: 'start-event.component.html',
+})
+export class StartEventComponent {
+ @Input() public node: StartEvent;
+ public sources: ValueSource[] = [ValueSource.String];
+
+ public create(): void {
+ this.node.parameters.push(new Parameter('', '', ValueSource[ValueSource.String]));
+ }
+
+ public delete(index: number): void {
+ this.node.parameters.splice(index, 1);
+ }
+}
<input class="form-control" type="text" [(ngModel)]="sequenceFlow.condition">
</div>
</div>
-</div>
+</div>
\ No newline at end of file
-/**\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
-.toolbar-head{\r
- color:#404040;\r
- font-size: 14px;\r
-}\r
-\r
-.toolbar-head:hover{\r
- cursor: pointer;\r
-}\r
-\r
-.fold-icon{\r
- width: 15px;\r
- font-size: 8px;\r
- color: #00abff;\r
-}\r
-\r
-.item{\r
- width: 50px;\r
- height: 50px;\r
- text-align: center;\r
- float: left;\r
- margin-left: 6px;\r
- margin-bottom: 10px;\r
-}\r
-\r
-.item:hover{\r
- cursor: pointer;\r
-}\r
-\r
-.item svg{\r
- width:24px;\r
- height:24px;\r
- margin: 4px 13px;\r
- display: block;\r
- /* fill: #A9B2BA; */\r
- fill: #00ABFF;\r
-}\r
-\r
-.item span{\r
- font-size: 12px;\r
- color: #595959;\r
- display: block;\r
-}\r
-\r
-.getway{\r
- padding-top: 5px;\r
-}\r
-\r
-.getway div{\r
- width: 30px !important;\r
- height: 30px !important;\r
-}\r
+/**
+ * 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
+ */
+.toolbar-head{
+ color:#404040;
+ font-size: 14px;
+}
+
+.toolbar-head:hover{
+ cursor: pointer;
+}
+
+.fold-icon{
+ width: 15px;
+ font-size: 8px;
+ color: #00abff;
+}
+
+.item{
+ width: 50px;
+ height: 50px;
+ text-align: center;
+ float: left;
+ margin-left: 6px;
+ margin-bottom: 10px;
+}
+
+.item:hover{
+ cursor: pointer;
+}
+
+.item svg{
+ width:24px;
+ height:24px;
+ margin: 4px 13px;
+ display: block;
+ /* fill: #A9B2BA; */
+ fill: #00ABFF;
+}
+
+.item span{
+ font-size: 12px;
+ color: #595959;
+ display: block;
+}
+
+.getway{
+ padding-top: 5px;
+}
+
+.getway div{
+ width: 30px !important;
+ height: 30px !important;
+}
\ No newline at end of file
-<!--\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
-<accordion>\r
- <accordion-group [isOpen]="true" #event>\r
- <div accordion-heading class="toolbar-head">\r
- <i class="fa fold-icon" [ngClass]="{'fa-chevron-down': event?.isOpen, 'fa-chevron-right': !event?.isOpen}"></i>\r
- <i class="fa fa-th-list"></i>\r
- <span>{{ 'WORKFLOW.BPMN_EVENT' | translate }}</span>\r
- </div>\r
- <div nodeType="startEvent" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M15,2c7.2,0,13,5.8,13,13s-5.8,13-13,13S2,22.2,2,15S7.8,2,15,2 M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15\r
- s15-6.7,15-15S23.3,0,15,0L15,0z" />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.START_EVENT' | translate }}</span>\r
- </div>\r
- <div nodeType="endEvent" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M15,4c6.1,0,11,4.9,11,11s-4.9,11-11,11S4,21.1,4,15S8.9,4,15,4 M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15\r
- s15-6.7,15-15S23.3,0,15,0L15,0z" />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.END_EVENT' | translate }}</span>\r
- </div>\r
- <div nodeType="intermediateCatchEvent" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M15,0C6.7,0,0,6.7,0,15c0,8.3,6.7,15,15,15c8.3,0,15-6.7,15-15C30,6.7,23.3,0,15,0z M16,27.9V26\r
- c0-0.6-0.4-1-1-1s-1,0.4-1,1v1.9C7.6,27.5,2.5,22.4,2.1,16H4c0.6,0,1-0.4,1-1s-0.4-1-1-1H2.1C2.5,7.6,7.6,2.5,14,2.1V4\r
- c0,0.6,0.4,1,1,1s1-0.4,1-1V2.1C22.4,2.5,27.5,7.6,27.9,14H26c-0.6,0-1,0.4-1,1s0.4,1,1,1h1.9C27.5,22.4,22.4,27.5,16,27.9z"\r
- />\r
- <path class="st0" d="M20,14h-3.6l2.5-6.6c0.2-0.5-0.1-1.1-0.6-1.3c-0.5-0.2-1.1,0.1-1.3,0.6l-3,8c-0.1,0.3-0.1,0.7,0.1,0.9\r
- c0.2,0.3,0.5,0.4,0.8,0.4h5c0.6,0,1-0.4,1-1S20.6,14,20,14z" />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.TIMER_EVENT' | translate }}</span>\r
- </div>\r
- <!--\r
- <div nodeType="errorStartEvent" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15s15-6.7,15-15S23.3,0,15,0z M15,28C7.8,28,2,22.2,2,15S7.8,2,15,2\r
- s13,5.8,13,13S22.2,28,15,28z" />\r
- <path class="st0" d="M19.7,12H17l2-5.5c0.1-0.3,0.1-0.5-0.1-0.7c-0.2-0.2-0.3-0.3-0.6-0.3H14c-0.3,0-0.6,0.2-0.8,0.5L9.7,16\r
- c-0.1,0.3-0.1,0.5,0.1,0.7c0.2,0.2,0.3,0.3,0.6,0.3l3.6,0.1l-1,6.7c-0.1,0.3,0.2,0.8,0.5,0.9c0.1,0,0.2,0,0.3,0\r
- c0.3,0,0.7-0.2,0.9-0.4l5.5-11.1c0.1-0.3,0.1-0.5,0-0.8C20.2,12.1,19.9,12,19.7,12z M14.6,22.3l1.2-5.9c0-0.3,0-0.4-0.2-0.6\r
- c-0.2-0.2-0.3-0.3-0.6-0.3h-3.5L14.5,7h2.6l-2,5.4C15,12.8,15,13,15.2,13.2c0.2,0.2,0.3,0.3,0.6,0.3h2.5L14.6,22.3z"\r
- />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.ERROR_START_EVENT' | translate }}</span>\r
- </div>\r
- <div nodeType="errorEndEvent" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15s15-6.7,15-15S23.3,0,15,0z M15,26C8.9,26,4,21.1,4,15S8.9,4,15,4\r
- s11,4.9,11,11S21.1,26,15,26z" />\r
- <path class="st0" d="M19.7,12.4H17l2-5.5c0.1-0.3,0.1-0.5-0.1-0.7c-0.2-0.2-0.3-0.3-0.6-0.3h-4.2c-0.3,0-0.6,0.2-0.8,0.5l-3.5,10\r
- c-0.1,0.3-0.1,0.5,0.1,0.7c0.2,0.2,0.3,0.3,0.6,0.3l3.6,0.1l-1,6.7c-0.1,0.3,0.2,0.8,0.5,0.9c0.1,0,0.2,0,0.3,0\r
- c0.3,0,0.7-0.2,0.9-0.4l5.5-11.1c0.1-0.3,0.1-0.5,0-0.8C20.2,12.6,20,12.4,19.7,12.4z" />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.ERROR_END_EVENT' | translate }}</span>\r
- </div>\r
- -->\r
- </accordion-group>\r
- <accordion-group [isOpen]="true" #task>\r
- <div accordion-heading class="toolbar-head">\r
- <i class="fa fold-icon" [ngClass]="{'fa-chevron-down': task?.isOpen, 'fa-chevron-right': !task?.isOpen}"></i>\r
- <i class="fa fa-th-list"></i>\r
- <span>{{ 'WORKFLOW.BPMN_TASK' | translate }}</span>\r
- </div>\r
- <div *ngIf="!isCatalog" nodeType="toscaNodeManagementTask" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M24,29H6c-2.8,0-5-2.2-5-5V6c0-2.8,2.2-5,5-5h18c2.8,0,5,2.2,5,5v18C29,26.8,26.8,29,24,29z M6,3\r
- C4.3,3,3,4.3,3,6v18c0,1.7,1.3,3,3,3h18c1.7,0,3-1.3,3-3V6c0-1.7-1.3-3-3-3H6z" />\r
- <path class="st0" d="M7.6,14.5h7.5c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,14.5,7.6,14.5z" />\r
- <path class="st0" d="M7.6,18.7h3.7c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,18.7,7.6,18.7z" />\r
- <path class="st0" d="M7.6,10.4H19c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,10.4,7.6,10.4z" />\r
- <path class="st0" d="M24.7,15.1h-5c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1h1.5v5.7c0,0.6,0.4,1,1,1s1-0.4,1-1v-5.7h1.5c0.6,0,1-0.4,1-1\r
- C25.7,15.5,25.2,15.1,24.7,15.1z" />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.TOSCA_TASK' | translate }}</span>\r
- </div>\r
- <div *ngIf="isCatalog" nodeType="restTask" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M24,29H6c-2.8,0-5-2.2-5-5V6c0-2.8,2.2-5,5-5h18c2.8,0,5,2.2,5,5v18C29,26.8,26.8,29,24,29z M6,3\r
- C4.3,3,3,4.3,3,6v18c0,1.7,1.3,3,3,3h18c1.7,0,3-1.3,3-3V6c0-1.7-1.3-3-3-3H6z" />\r
- <path class="st0" d="M7.6,14.5h7.5c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,14.5,7.6,14.5z" />\r
- <path class="st0" d="M7.6,18.7h3.7c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,18.7,7.6,18.7z" />\r
- <path class="st0" d="M7.6,10.4H19c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,10.4,7.6,10.4z" />\r
- <path class="st0" d="M24.1,22.6l-1.6-2.7c0.9-0.4,1.5-1.2,1.5-2.2c0-1.4-1.2-2.5-2.8-2.5h-1.9c-0.2,0-0.4,0.1-0.6,0.2\r
- c-0.2,0.1-0.3,0.3-0.3,0.6v7c0,0.4,0.3,0.8,0.8,0.8c0.4,0,0.8-0.3,0.8-0.8v-2.8h0.8l1.9,3.2c0.1,0.2,0.4,0.4,0.7,0.4\r
- c0.1,0,0.3,0,0.4-0.1C24.2,23.5,24.4,23,24.1,22.6z M20.1,16.8h1.2c0.6,0,1.2,0.4,1.2,0.9s-0.5,0.9-1.2,0.9h-1.2V16.8z"\r
- />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.REST_TASK' | translate }}</span>\r
- </div>\r
- <div nodeType="scriptTask" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M24,1H6C3.2,1,1,3.2,1,6v18c0,2.8,2.2,5,5,5h18c2.8,0,5-2.2,5-5V6C29,3.2,26.8,1,24,1z M16.9,3.4\r
- c0.5,0,0.9,0.2,1.3,0.5c0.4,0.4,0.5,0.8,0.5,1.3c0,0.5-0.2,0.9-0.5,1.3L17.7,7l-5.3,5.3c-0.2-0.6-0.5-1.2-0.9-1.6\r
- c-0.4-0.4-1-0.8-1.6-0.9l5.8-5.8C16,3.6,16.4,3.4,16.9,3.4z M10.3,27H6c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h8.2l-7.4,7.4\r
- c-0.1,0.1-0.2,0.2-0.3,0.3c-0.7,0.7-1,1.6-1,2.5c0,0.9,0.4,1.8,1,2.5l5.2,5.2l-1.3,1.3c-0.7,0.7-1,1.6-1,2.5\r
- C9.3,25.5,9.7,26.4,10.3,27z M14.1,25.9c-0.4,0.4-0.8,0.5-1.3,0.5c-0.5,0-0.9-0.2-1.3-0.5c-0.4-0.4-0.5-0.8-0.5-1.3\r
- c0-0.5,0.2-0.9,0.5-1.3l1.3-1.3l0.5,0.5l0.8,0.8c0.4,0.4,0.5,0.8,0.5,1.3C14.6,25.1,14.5,25.5,14.1,25.9z M14.5,21.3l-6.8-6.8\r
- c-0.4-0.4-0.5-0.8-0.5-1.3c0-0.5,0.2-0.9,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5c0.5,0,0.9,0.2,1.3,0.5c0.4,0.4,0.5,0.8,0.5,1.3\r
- c0,0.5-0.2,0.9-0.5,1.3l0.9,0.9c0.2,0.2,0.4,0.2,0.6,0l5.2-5.2l4.4,4.4l0.8,0.8c0.4,0.4,0.5,0.8,0.5,1.3c0,0.5-0.2,0.9-0.5,1.3v0\r
- l-5.8,5.8c-0.1-0.6-0.5-1.2-0.9-1.6L14.5,21.3z M27,24c0,1.7-1.3,3-3,3h-8.6l7.9-7.9c0.7-0.7,1-1.6,1-2.5c0-0.9-0.4-1.8-1-2.5\r
- l-0.8-0.8L18.1,9l1.3-1.3c0.7-0.7,1-1.6,1-2.5c0-0.8-0.3-1.6-0.8-2.2H24c1.7,0,3,1.3,3,3V24z" />\r
- <path class="st0" d="M17.2,12.4c-0.3-0.3-0.8-0.3-1.1,0L12.6,16c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2\r
- l3.6-3.6C17.5,13.1,17.5,12.7,17.2,12.4z" />\r
- <path class="st0" d="M18.9,14.2c-0.3-0.3-0.8-0.3-1.1,0l-3.6,3.6c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2\r
- c0.2,0,0.4-0.1,0.5-0.2l3.6-3.6C19.2,14.9,19.2,14.4,18.9,14.2z" />\r
- <path class="st0" d="M17.1,20.6l3.6-3.6c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0L16,19.5c-0.3,0.3-0.3,0.8,0,1.1\r
- c0.1,0.1,0.3,0.2,0.5,0.2S17,20.7,17.1,20.6z" />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.SCRIPT_TASK' | translate }}</span>\r
- </div>\r
- </accordion-group>\r
- <accordion-group [isOpen]="true" #getway>\r
- <div accordion-heading class="toolbar-head">\r
- <i class="fa fold-icon" [ngClass]="{'fa-chevron-down': getway?.isOpen, 'fa-chevron-right': !getway?.isOpen}"></i>\r
- <i class="fa fa-th-list"></i>\r
- <span>{{ 'WORKFLOW.BPMN_GETWAY' | translate }}</span>\r
- </div>\r
- <div nodeType="exclusiveGateway" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M16.4,15l3.2-3.2c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L15,13.6l-3.2-3.2c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4\r
- l3.2,3.2l-3.2,3.2c-0.4,0.4-0.4,1,0,1.4s1,0.4,1.4,0l3.2-3.2l3.2,3.2c0.4,0.4,1,0.4,1.4,0s0.4-1,0-1.4L16.4,15z"\r
- />\r
- <path class="st0" d="M29.1,12.9l-12-12c-1.1-1.1-3.1-1.1-4.2,0l-12,12C0.3,13.4,0,14.2,0,15s0.3,1.6,0.9,2.1l12,12\r
- c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9l12-12c0.6-0.6,0.9-1.3,0.9-2.1S29.7,13.4,29.1,12.9z M27.7,15.7l-12,12\r
- c-0.4,0.4-1,0.4-1.4,0l-12-12C2.1,15.5,2,15.3,2,15s0.1-0.5,0.3-0.7l12-12C14.5,2.1,14.7,2,15,2s0.5,0.1,0.7,0.3l12,12\r
- c0.2,0.2,0.3,0.4,0.3,0.7S27.9,15.5,27.7,15.7z" />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.EXCLUSIVE_GATEWAY' | translate }}</span>\r
- </div>\r
- <div nodeType="parallelGateway" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M20.5,14H16V9.5c0-0.6-0.4-1-1-1s-1,0.4-1,1V14H9.5c-0.6,0-1,0.4-1,1s0.4,1,1,1H14v4.5c0,0.6,0.4,1,1,1\r
- s1-0.4,1-1V16h4.5c0.6,0,1-0.4,1-1S21.1,14,20.5,14z" />\r
- <path class="st0" d="M29.1,12.9l-12-12c-1.1-1.1-3.1-1.1-4.2,0l-12,12C0.3,13.4,0,14.2,0,15s0.3,1.6,0.9,2.1l12,12\r
- c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9l12-12c0.6-0.6,0.9-1.3,0.9-2.1S29.7,13.4,29.1,12.9z M27.7,15.7l-12,12\r
- c-0.4,0.4-1,0.4-1.4,0l-12-12C2.1,15.5,2,15.3,2,15s0.1-0.5,0.3-0.7l12-12C14.5,2.1,14.7,2,15,2s0.5,0.1,0.7,0.3l12,12\r
- c0.2,0.2,0.3,0.4,0.3,0.7S27.9,15.5,27.7,15.7z" />\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.PARALLEL_GATEWAY' | translate }}</span>\r
- </div>\r
- </accordion-group>\r
- <!-- <accordion-group [isOpen]="true" #structural>\r
- <div accordion-heading class="toolbar-head">\r
- <i class="fa fold-icon" [ngClass]="{'fa-chevron-down': structural?.isOpen, 'fa-chevron-right': !structural?.isOpen}"></i>\r
- <i class="fa fa-th-list"></i>\r
- <span>{{ 'WORKFLOW.BPMN_STRUCTURAL' | translate }}</span>\r
- </div>\r
- <div nodeType="subProcess" class="item ui-draggable">\r
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\r
- <g>\r
- <path class="st0" d="M24.5,1h-18c-2.8,0-5,2.2-5,5v18c0,2.8,2.2,5,5,5h18c2.8,0,5-2.2,5-5V6C29.5,3.2,27.2,1,24.5,1z M20.2,27h-9.4\r
- v-9.1c0-0.3,0.2-0.5,0.5-0.5h8.4c0.3,0,0.5,0.2,0.5,0.5V27z M27.5,24c0,1.7-1.3,3-3,3h-2.3v-9.1c0-1.4-1.1-2.5-2.5-2.5h-8.4\r
- c-1.4,0-2.5,1.1-2.5,2.5V27H6.5c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h18c1.7,0,3,1.3,3,3V24z"/>\r
- <path class="st0" d="M19,21.3h-2.5v-2.5c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v2.5H12c-0.6,0-1,0.4-1,1s0.4,1,1,1h2.5v2.5\r
- c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1v-2.5H19c0.6,0,1-0.4,1-1S19.5,21.3,19,21.3z"/>\r
- </g>\r
- </svg>\r
- <span>{{ 'WORKFLOW.SUB_PROCESS' | translate }}</span>\r
- </div>\r
- </accordion-group> -->\r
-</accordion>\r
+<!--
+/**
+ * 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
+ */
+-->
+<accordion>
+ <accordion-group [isOpen]="true" #event>
+ <div accordion-heading class="toolbar-head">
+ <i class="fa fold-icon" [ngClass]="{'fa-chevron-down': event?.isOpen, 'fa-chevron-right': !event?.isOpen}"></i>
+ <i class="fa fa-th-list"></i>
+ <span>{{ 'WORKFLOW.BPMN_EVENT' | translate }}</span>
+ </div>
+ <div nodeType="startEvent" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M15,2c7.2,0,13,5.8,13,13s-5.8,13-13,13S2,22.2,2,15S7.8,2,15,2 M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15
+ s15-6.7,15-15S23.3,0,15,0L15,0z" />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.START_EVENT' | translate }}</span>
+ </div>
+ <div nodeType="endEvent" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M15,4c6.1,0,11,4.9,11,11s-4.9,11-11,11S4,21.1,4,15S8.9,4,15,4 M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15
+ s15-6.7,15-15S23.3,0,15,0L15,0z" />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.END_EVENT' | translate }}</span>
+ </div>
+ <div nodeType="intermediateCatchEvent" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M15,0C6.7,0,0,6.7,0,15c0,8.3,6.7,15,15,15c8.3,0,15-6.7,15-15C30,6.7,23.3,0,15,0z M16,27.9V26
+ c0-0.6-0.4-1-1-1s-1,0.4-1,1v1.9C7.6,27.5,2.5,22.4,2.1,16H4c0.6,0,1-0.4,1-1s-0.4-1-1-1H2.1C2.5,7.6,7.6,2.5,14,2.1V4
+ c0,0.6,0.4,1,1,1s1-0.4,1-1V2.1C22.4,2.5,27.5,7.6,27.9,14H26c-0.6,0-1,0.4-1,1s0.4,1,1,1h1.9C27.5,22.4,22.4,27.5,16,27.9z"
+ />
+ <path class="st0" d="M20,14h-3.6l2.5-6.6c0.2-0.5-0.1-1.1-0.6-1.3c-0.5-0.2-1.1,0.1-1.3,0.6l-3,8c-0.1,0.3-0.1,0.7,0.1,0.9
+ c0.2,0.3,0.5,0.4,0.8,0.4h5c0.6,0,1-0.4,1-1S20.6,14,20,14z" />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.TIMER_EVENT' | translate }}</span>
+ </div>
+ <!--
+ <div nodeType="errorStartEvent" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15s15-6.7,15-15S23.3,0,15,0z M15,28C7.8,28,2,22.2,2,15S7.8,2,15,2
+ s13,5.8,13,13S22.2,28,15,28z" />
+ <path class="st0" d="M19.7,12H17l2-5.5c0.1-0.3,0.1-0.5-0.1-0.7c-0.2-0.2-0.3-0.3-0.6-0.3H14c-0.3,0-0.6,0.2-0.8,0.5L9.7,16
+ c-0.1,0.3-0.1,0.5,0.1,0.7c0.2,0.2,0.3,0.3,0.6,0.3l3.6,0.1l-1,6.7c-0.1,0.3,0.2,0.8,0.5,0.9c0.1,0,0.2,0,0.3,0
+ c0.3,0,0.7-0.2,0.9-0.4l5.5-11.1c0.1-0.3,0.1-0.5,0-0.8C20.2,12.1,19.9,12,19.7,12z M14.6,22.3l1.2-5.9c0-0.3,0-0.4-0.2-0.6
+ c-0.2-0.2-0.3-0.3-0.6-0.3h-3.5L14.5,7h2.6l-2,5.4C15,12.8,15,13,15.2,13.2c0.2,0.2,0.3,0.3,0.6,0.3h2.5L14.6,22.3z"
+ />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.ERROR_START_EVENT' | translate }}</span>
+ </div>
+ <div nodeType="errorEndEvent" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M15,0C6.7,0,0,6.7,0,15s6.7,15,15,15s15-6.7,15-15S23.3,0,15,0z M15,26C8.9,26,4,21.1,4,15S8.9,4,15,4
+ s11,4.9,11,11S21.1,26,15,26z" />
+ <path class="st0" d="M19.7,12.4H17l2-5.5c0.1-0.3,0.1-0.5-0.1-0.7c-0.2-0.2-0.3-0.3-0.6-0.3h-4.2c-0.3,0-0.6,0.2-0.8,0.5l-3.5,10
+ c-0.1,0.3-0.1,0.5,0.1,0.7c0.2,0.2,0.3,0.3,0.6,0.3l3.6,0.1l-1,6.7c-0.1,0.3,0.2,0.8,0.5,0.9c0.1,0,0.2,0,0.3,0
+ c0.3,0,0.7-0.2,0.9-0.4l5.5-11.1c0.1-0.3,0.1-0.5,0-0.8C20.2,12.6,20,12.4,19.7,12.4z" />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.ERROR_END_EVENT' | translate }}</span>
+ </div>
+ -->
+ </accordion-group>
+ <accordion-group [isOpen]="true" #task>
+ <div accordion-heading class="toolbar-head">
+ <i class="fa fold-icon" [ngClass]="{'fa-chevron-down': task?.isOpen, 'fa-chevron-right': !task?.isOpen}"></i>
+ <i class="fa fa-th-list"></i>
+ <span>{{ 'WORKFLOW.BPMN_TASK' | translate }}</span>
+ </div>
+ <div *ngIf="!isCatalog" nodeType="toscaNodeManagementTask" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M24,29H6c-2.8,0-5-2.2-5-5V6c0-2.8,2.2-5,5-5h18c2.8,0,5,2.2,5,5v18C29,26.8,26.8,29,24,29z M6,3
+ C4.3,3,3,4.3,3,6v18c0,1.7,1.3,3,3,3h18c1.7,0,3-1.3,3-3V6c0-1.7-1.3-3-3-3H6z" />
+ <path class="st0" d="M7.6,14.5h7.5c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,14.5,7.6,14.5z" />
+ <path class="st0" d="M7.6,18.7h3.7c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,18.7,7.6,18.7z" />
+ <path class="st0" d="M7.6,10.4H19c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,10.4,7.6,10.4z" />
+ <path class="st0" d="M24.7,15.1h-5c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1h1.5v5.7c0,0.6,0.4,1,1,1s1-0.4,1-1v-5.7h1.5c0.6,0,1-0.4,1-1
+ C25.7,15.5,25.2,15.1,24.7,15.1z" />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.TOSCA_TASK' | translate }}</span>
+ </div>
+ <div *ngIf="isCatalog" nodeType="restTask" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M24,29H6c-2.8,0-5-2.2-5-5V6c0-2.8,2.2-5,5-5h18c2.8,0,5,2.2,5,5v18C29,26.8,26.8,29,24,29z M6,3
+ C4.3,3,3,4.3,3,6v18c0,1.7,1.3,3,3,3h18c1.7,0,3-1.3,3-3V6c0-1.7-1.3-3-3-3H6z" />
+ <path class="st0" d="M7.6,14.5h7.5c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,14.5,7.6,14.5z" />
+ <path class="st0" d="M7.6,18.7h3.7c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,18.7,7.6,18.7z" />
+ <path class="st0" d="M7.6,10.4H19c0.5,0,0.8-0.4,0.8-1s-0.3-1-0.8-1H7.6c-0.5,0-0.8,0.4-0.8,1S7.1,10.4,7.6,10.4z" />
+ <path class="st0" d="M24.1,22.6l-1.6-2.7c0.9-0.4,1.5-1.2,1.5-2.2c0-1.4-1.2-2.5-2.8-2.5h-1.9c-0.2,0-0.4,0.1-0.6,0.2
+ c-0.2,0.1-0.3,0.3-0.3,0.6v7c0,0.4,0.3,0.8,0.8,0.8c0.4,0,0.8-0.3,0.8-0.8v-2.8h0.8l1.9,3.2c0.1,0.2,0.4,0.4,0.7,0.4
+ c0.1,0,0.3,0,0.4-0.1C24.2,23.5,24.4,23,24.1,22.6z M20.1,16.8h1.2c0.6,0,1.2,0.4,1.2,0.9s-0.5,0.9-1.2,0.9h-1.2V16.8z"
+ />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.REST_TASK' | translate }}</span>
+ </div>
+ <div nodeType="scriptTask" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M24,1H6C3.2,1,1,3.2,1,6v18c0,2.8,2.2,5,5,5h18c2.8,0,5-2.2,5-5V6C29,3.2,26.8,1,24,1z M16.9,3.4
+ c0.5,0,0.9,0.2,1.3,0.5c0.4,0.4,0.5,0.8,0.5,1.3c0,0.5-0.2,0.9-0.5,1.3L17.7,7l-5.3,5.3c-0.2-0.6-0.5-1.2-0.9-1.6
+ c-0.4-0.4-1-0.8-1.6-0.9l5.8-5.8C16,3.6,16.4,3.4,16.9,3.4z M10.3,27H6c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h8.2l-7.4,7.4
+ c-0.1,0.1-0.2,0.2-0.3,0.3c-0.7,0.7-1,1.6-1,2.5c0,0.9,0.4,1.8,1,2.5l5.2,5.2l-1.3,1.3c-0.7,0.7-1,1.6-1,2.5
+ C9.3,25.5,9.7,26.4,10.3,27z M14.1,25.9c-0.4,0.4-0.8,0.5-1.3,0.5c-0.5,0-0.9-0.2-1.3-0.5c-0.4-0.4-0.5-0.8-0.5-1.3
+ c0-0.5,0.2-0.9,0.5-1.3l1.3-1.3l0.5,0.5l0.8,0.8c0.4,0.4,0.5,0.8,0.5,1.3C14.6,25.1,14.5,25.5,14.1,25.9z M14.5,21.3l-6.8-6.8
+ c-0.4-0.4-0.5-0.8-0.5-1.3c0-0.5,0.2-0.9,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5c0.5,0,0.9,0.2,1.3,0.5c0.4,0.4,0.5,0.8,0.5,1.3
+ c0,0.5-0.2,0.9-0.5,1.3l0.9,0.9c0.2,0.2,0.4,0.2,0.6,0l5.2-5.2l4.4,4.4l0.8,0.8c0.4,0.4,0.5,0.8,0.5,1.3c0,0.5-0.2,0.9-0.5,1.3v0
+ l-5.8,5.8c-0.1-0.6-0.5-1.2-0.9-1.6L14.5,21.3z M27,24c0,1.7-1.3,3-3,3h-8.6l7.9-7.9c0.7-0.7,1-1.6,1-2.5c0-0.9-0.4-1.8-1-2.5
+ l-0.8-0.8L18.1,9l1.3-1.3c0.7-0.7,1-1.6,1-2.5c0-0.8-0.3-1.6-0.8-2.2H24c1.7,0,3,1.3,3,3V24z" />
+ <path class="st0" d="M17.2,12.4c-0.3-0.3-0.8-0.3-1.1,0L12.6,16c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2
+ l3.6-3.6C17.5,13.1,17.5,12.7,17.2,12.4z" />
+ <path class="st0" d="M18.9,14.2c-0.3-0.3-0.8-0.3-1.1,0l-3.6,3.6c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2
+ c0.2,0,0.4-0.1,0.5-0.2l3.6-3.6C19.2,14.9,19.2,14.4,18.9,14.2z" />
+ <path class="st0" d="M17.1,20.6l3.6-3.6c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0L16,19.5c-0.3,0.3-0.3,0.8,0,1.1
+ c0.1,0.1,0.3,0.2,0.5,0.2S17,20.7,17.1,20.6z" />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.SCRIPT_TASK' | translate }}</span>
+ </div>
+ </accordion-group>
+ <accordion-group [isOpen]="true" #getway>
+ <div accordion-heading class="toolbar-head">
+ <i class="fa fold-icon" [ngClass]="{'fa-chevron-down': getway?.isOpen, 'fa-chevron-right': !getway?.isOpen}"></i>
+ <i class="fa fa-th-list"></i>
+ <span>{{ 'WORKFLOW.BPMN_GETWAY' | translate }}</span>
+ </div>
+ <div nodeType="exclusiveGateway" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M16.4,15l3.2-3.2c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L15,13.6l-3.2-3.2c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4
+ l3.2,3.2l-3.2,3.2c-0.4,0.4-0.4,1,0,1.4s1,0.4,1.4,0l3.2-3.2l3.2,3.2c0.4,0.4,1,0.4,1.4,0s0.4-1,0-1.4L16.4,15z"
+ />
+ <path class="st0" d="M29.1,12.9l-12-12c-1.1-1.1-3.1-1.1-4.2,0l-12,12C0.3,13.4,0,14.2,0,15s0.3,1.6,0.9,2.1l12,12
+ c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9l12-12c0.6-0.6,0.9-1.3,0.9-2.1S29.7,13.4,29.1,12.9z M27.7,15.7l-12,12
+ c-0.4,0.4-1,0.4-1.4,0l-12-12C2.1,15.5,2,15.3,2,15s0.1-0.5,0.3-0.7l12-12C14.5,2.1,14.7,2,15,2s0.5,0.1,0.7,0.3l12,12
+ c0.2,0.2,0.3,0.4,0.3,0.7S27.9,15.5,27.7,15.7z" />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.EXCLUSIVE_GATEWAY' | translate }}</span>
+ </div>
+ <div nodeType="parallelGateway" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M20.5,14H16V9.5c0-0.6-0.4-1-1-1s-1,0.4-1,1V14H9.5c-0.6,0-1,0.4-1,1s0.4,1,1,1H14v4.5c0,0.6,0.4,1,1,1
+ s1-0.4,1-1V16h4.5c0.6,0,1-0.4,1-1S21.1,14,20.5,14z" />
+ <path class="st0" d="M29.1,12.9l-12-12c-1.1-1.1-3.1-1.1-4.2,0l-12,12C0.3,13.4,0,14.2,0,15s0.3,1.6,0.9,2.1l12,12
+ c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9l12-12c0.6-0.6,0.9-1.3,0.9-2.1S29.7,13.4,29.1,12.9z M27.7,15.7l-12,12
+ c-0.4,0.4-1,0.4-1.4,0l-12-12C2.1,15.5,2,15.3,2,15s0.1-0.5,0.3-0.7l12-12C14.5,2.1,14.7,2,15,2s0.5,0.1,0.7,0.3l12,12
+ c0.2,0.2,0.3,0.4,0.3,0.7S27.9,15.5,27.7,15.7z" />
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.PARALLEL_GATEWAY' | translate }}</span>
+ </div>
+ </accordion-group>
+ <!-- <accordion-group [isOpen]="true" #structural>
+ <div accordion-heading class="toolbar-head">
+ <i class="fa fold-icon" [ngClass]="{'fa-chevron-down': structural?.isOpen, 'fa-chevron-right': !structural?.isOpen}"></i>
+ <i class="fa fa-th-list"></i>
+ <span>{{ 'WORKFLOW.BPMN_STRUCTURAL' | translate }}</span>
+ </div>
+ <div nodeType="subProcess" class="item ui-draggable">
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
+ <g>
+ <path class="st0" d="M24.5,1h-18c-2.8,0-5,2.2-5,5v18c0,2.8,2.2,5,5,5h18c2.8,0,5-2.2,5-5V6C29.5,3.2,27.2,1,24.5,1z M20.2,27h-9.4
+ v-9.1c0-0.3,0.2-0.5,0.5-0.5h8.4c0.3,0,0.5,0.2,0.5,0.5V27z M27.5,24c0,1.7-1.3,3-3,3h-2.3v-9.1c0-1.4-1.1-2.5-2.5-2.5h-8.4
+ c-1.4,0-2.5,1.1-2.5,2.5V27H6.5c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h18c1.7,0,3,1.3,3,3V24z"/>
+ <path class="st0" d="M19,21.3h-2.5v-2.5c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v2.5H12c-0.6,0-1,0.4-1,1s0.4,1,1,1h2.5v2.5
+ c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1v-2.5H19c0.6,0,1-0.4,1-1S19.5,21.3,19,21.3z"/>
+ </g>
+ </svg>
+ <span>{{ 'WORKFLOW.SUB_PROCESS' | translate }}</span>
+ </div>
+ </accordion-group> -->
+</accordion>
-/**\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 { AfterViewChecked, Component, OnInit } from '@angular/core';\r
-\r
-import { DataService } from '../../services/data/data.service';\r
-import { BroadcastService } from '../../services/broadcast.service';\r
-import { JsPlumbService } from '../../services/jsplumb.service';\r
-\r
-/**\r
- * toolbar component contains some basic operations(save) and all of the supported workflow nodes.\r
- * The supported nodes can be dragged to container component. which will add a new node to the workflow.\r
- */\r
-@Component({\r
- selector: 'b4t-toolbar',\r
- templateUrl: 'toolbar.component.html',\r
- styleUrls: ['./toolbar.component.css']\r
-})\r
-export class ToolbarComponent implements AfterViewChecked, OnInit {\r
- public isCatalog = true;\r
- private needInitButton = false;\r
-\r
- constructor(private jsPlumbService: JsPlumbService, private broadcastService: BroadcastService,\r
- private dataService: DataService) { }\r
-\r
- public ngOnInit() {\r
- this.broadcastService.backendServiceReady$.subscribe(() => {\r
- this.isCatalog = 'Catalog' === this.dataService.getBackendType();\r
- this.needInitButton = true;\r
- });\r
- }\r
-\r
- public ngAfterViewChecked() {\r
- if (this.needInitButton) {\r
- this.jsPlumbService.buttonDraggable();\r
- this.jsPlumbService.buttonDroppable();\r
- this.needInitButton = false;\r
- }\r
- }\r
-}\r
+/**
+ * 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 { AfterViewChecked, Component, OnInit } from '@angular/core';
+
+import { DataService } from '../../services/data/data.service';
+import { BroadcastService } from '../../services/broadcast.service';
+import { JsPlumbService } from '../../services/jsplumb.service';
+
+/**
+ * toolbar component contains some basic operations(save) and all of the supported workflow nodes.
+ * The supported nodes can be dragged to container component. which will add a new node to the workflow.
+ */
+@Component({
+ selector: 'b4t-toolbar',
+ templateUrl: 'toolbar.component.html',
+ styleUrls: ['./toolbar.component.css']
+})
+export class ToolbarComponent implements AfterViewChecked, OnInit {
+ public isCatalog = true;
+ private needInitButton = false;
+
+ constructor(private jsPlumbService: JsPlumbService, private broadcastService: BroadcastService,
+ private dataService: DataService) { }
+
+ public ngOnInit() {
+ this.broadcastService.backendServiceReady$.subscribe(() => {
+ this.isCatalog = 'Catalog' === this.dataService.getBackendType();
+ this.needInitButton = true;
+ });
+ }
+
+ public ngAfterViewChecked() {
+ if (this.needInitButton) {
+ this.jsPlumbService.buttonDraggable();
+ this.jsPlumbService.buttonDroppable();
+ this.needInitButton = false;
+ }
+ }
+}
-/**\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 { AfterViewInit, Directive, ElementRef } from '@angular/core';\r
-import * as $ from 'jquery';\r
-\r
-import { JsPlumbService } from '../../services/jsplumb.service';\r
-import { ModelService } from '../../services/model.service';\r
-\r
-@Directive({ selector: '[b4tResizable]' })\r
-export class ResizableDirective implements AfterViewInit {\r
-\r
- constructor(private el: ElementRef,\r
- private jsPlumbService: JsPlumbService,\r
- private planModelService: ModelService) {\r
- }\r
-\r
- public ngAfterViewInit() {\r
- console.log('init resizble.');\r
- \r
- $(this.el.nativeElement).resizable({\r
- handles: 'all',\r
- resize: (event, ui) => {\r
- const element = ui.helper[0];\r
- this.planModelService.updatePosition(element.id,\r
- element.offsetLeft, element.offsetTop, element.offsetWidth, element.offsetHeight - 12);\r
- this.jsPlumbService.resizeParent(element, element.parentNode);\r
- const node = this.planModelService.getNodeMap().get(element.id);\r
- this.jsPlumbService.jsplumbInstanceMap.get(node.parentId).revalidate(element.id);\r
- },\r
- });\r
- }\r
-}\r
+/**
+ * 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 { AfterViewInit, Directive, ElementRef } from '@angular/core';
+import * as $ from 'jquery';
+
+import { JsPlumbService } from '../../services/jsplumb.service';
+import { ModelService } from '../../services/model.service';
+
+@Directive({ selector: '[b4tResizable]' })
+export class ResizableDirective implements AfterViewInit {
+
+ constructor(private el: ElementRef,
+ private jsPlumbService: JsPlumbService,
+ private planModelService: ModelService) {
+ }
+
+ public ngAfterViewInit() {
+ console.log('init resizble.');
+
+ $(this.el.nativeElement).resizable({
+ handles: 'all',
+ resize: (event, ui) => {
+ const element = ui.helper[0];
+ this.planModelService.updatePosition(element.id,
+ element.offsetLeft, element.offsetTop, element.offsetWidth, element.offsetHeight - 12);
+ this.jsPlumbService.resizeParent(element, element.parentNode);
+ const node = this.planModelService.getNodeMap().get(element.id);
+ this.jsPlumbService.jsplumbInstanceMap.get(node.parentId).revalidate(element.id);
+ },
+ });
+ }
+}
-/**\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 { WorkflowNode } from './workflow/workflow-node';\r
-\r
-export class PlanModel {\r
- public nodes: WorkflowNode[] = [];\r
- public configs: any = {};\r
-}\r
+/**
+ * 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 { WorkflowNode } from './workflow/workflow-node';
+
+export class PlanModel {
+ public nodes: WorkflowNode[] = [];
+ public configs: any = {};
+}
-/**\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
-export class NodeTemplate {\r
- public id: string;\r
- public name: string;\r
- public type: string;\r
- public namespace: string;\r
-}\r
+/**
+ * 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
+ */
+
+export class NodeTemplate {
+ public id: string;
+ public name: string;
+ public type: string;
+ public namespace: string;
+}
-/**\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 { ValueSource } from '../value-source.enum';\r
-import { Parameter } from './parameter';\r
-import { WorkflowNode } from './workflow-node';\r
-\r
-export interface ErrorEvent extends WorkflowNode {\r
- parameter?: Parameter;\r
-}\r
+/**
+ * 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 { ValueSource } from '../value-source.enum';
+import { Parameter } from './parameter';
+import { WorkflowNode } from './workflow-node';
+
+export interface ErrorEvent extends WorkflowNode {
+ parameter?: Parameter;
+}
-/**\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
-export class Position {\r
- constructor(public left: number, public top: number, public width = 56, public height = 56) { }\r
-}\r
+/**
+ * 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
+ */
+
+export class Position {
+ constructor(public left: number, public top: number, public width = 56, public height = 56) { }
+}
-/**\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 { WorkflowNode } from './workflow-node';\r
-\r
-export interface ScriptTask extends WorkflowNode {\r
- scriptFormat: string;\r
- script?: string;\r
-}\r
+/**
+ * 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 { WorkflowNode } from './workflow-node';
+
+export interface ScriptTask extends WorkflowNode {
+ scriptFormat: string;
+ script?: string;
+}
-/**\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 { WorkflowNode } from './workflow-node';\r
-export interface SubProcess extends WorkflowNode {\r
- children?: WorkflowNode[];\r
-}\r
+/**
+ * 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 { WorkflowNode } from './workflow-node';
+export interface SubProcess extends WorkflowNode {
+ children?: WorkflowNode[];
+}
-/**\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 { NodeTemplate } from '../topology/node-template';\r
-import { Parameter } from './parameter';\r
-import { WorkflowNode } from './workflow-node';\r
-\r
-export interface ToscaNodeTask extends WorkflowNode {\r
- input?: Parameter[];\r
- output?: Parameter[];\r
- nodeInterface?: string;\r
- operation?: string;\r
- template?: NodeTemplate;\r
-}\r
+/**
+ * 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 { NodeTemplate } from '../topology/node-template';
+import { Parameter } from './parameter';
+import { WorkflowNode } from './workflow-node';
+
+export interface ToscaNodeTask extends WorkflowNode {
+ input?: Parameter[];
+ output?: Parameter[];
+ nodeInterface?: string;
+ operation?: string;
+ template?: NodeTemplate;
+}
-/**\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
-export interface WorkflowElement {\r
-}\r
+/**
+ * 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
+ */
+
+export interface WorkflowElement {
+}
* broadcast datas
* this method will catch the exceptions for the broadcast
* @param subject will broadcast data
- * @param data will be broadcated
+ * @param data will be broadcasted
*/
public broadcast(subject: Subject<any>, data: any) {
try {
name: 'workflow1',\r
nodes: [],\r
configs: {\r
- microservices: [{\r
+ restConfigs: [{\r
definition: "/s/swagger",\r
name: "test",\r
swaggerJson: JSON.stringify(swagger),\r
name: 'workflow2',\r
nodes: [],\r
configs: {\r
- microservices: []\r
+ restConfigs: []\r
}\r
},\r
},\r
const mockobject = {};\r
\r
const setting = {\r
- "BackendType":"Catalog"\r
- }\r
+ "BackendType":"SDC",\r
+ };\r
+\r
+ const tenant = {tenant: "tenant1"};\r
\r
- return { workflows, swagger, mockarray,mockobject, setting};\r
+ return { workflows, swagger, mockarray,mockobject, setting, tenant};\r
}\r
}\r
\r
-import {swaggerFjh} from './swagger';\r
+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
\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
-/**\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 { Injectable } from '@angular/core';\r
-import * as jsp from 'jsplumb';\r
-\r
-import { Subscription } from 'rxjs/Subscription';\r
-import { WorkflowNode } from '../model/workflow/workflow-node';\r
-import { BroadcastService } from './broadcast.service';\r
-import { ModelService } from './model.service';\r
-import { SequenceFlow } from '../model/workflow/sequence-flow';\r
-import { Position } from '../model/workflow/position';\r
-\r
-/**\r
- * JsPlumbService\r
- * provides all of the operations about jsplumb plugin.\r
- */\r
-@Injectable()\r
-export class JsPlumbService {\r
- public jsplumbInstanceMap = new Map<string, any>();\r
- public subscriptionMap = new Map<string, Subscription>();\r
-\r
- private padding = 20;\r
- private rootClass = 'canvas';\r
- private selectNodes: WorkflowNode[] = [];\r
-\r
- constructor(private modelService: ModelService, private broadcastService: BroadcastService) {\r
- this.broadcastService.selectedElement$.subscribe(elements => {\r
- this.selectNodes = [];\r
- if (elements && 0 < elements.length) {\r
- for (let index = 0; index < elements.length; index++) {\r
- let element = elements[index];\r
- if (this.modelService.isNode(element)) {\r
- let node = element as WorkflowNode;\r
- this.selectNodes.push(node);\r
- }\r
- }\r
- }\r
- });\r
- }\r
-\r
- public connectChildrenNodes(parentNodeId: string) {\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(parentNodeId);\r
-\r
- const nodes: WorkflowNode[] = this.modelService.getChildrenNodes(parentNodeId);\r
- nodes.forEach(node => this.connect4OneNode(node, jsplumbInstance));\r
- }\r
-\r
- public connect4OneNode(node: WorkflowNode, jsplumbInstance: any) {\r
- node.connection.forEach(sequenceFlow => {\r
- const connection = jsplumbInstance.connect({\r
- source: sequenceFlow.sourceRef,\r
- target: sequenceFlow.targetRef,\r
- });\r
- if (sequenceFlow.name) {\r
- connection.setLabel(sequenceFlow.name);\r
- }\r
- });\r
- }\r
-\r
- public initJsPlumbInstance(id: string) {\r
- if (this.jsplumbInstanceMap.get(id)) {\r
- return;\r
- }\r
- const jsplumbInstance = jsp.jsPlumb.getInstance();\r
-\r
- jsplumbInstance.importDefaults({\r
- Anchor: "Continuous",\r
- Endpoint: "Blank",\r
- Container: "pallete",\r
- ReattachConnections: true,\r
- Connector: ['Flowchart', {\r
- stub: [0, 0],\r
- cornerRadius: 5,\r
- alwaysRespectStubs: true\r
- }],\r
- PaintStyle: {\r
- stroke: "#7D8695",\r
- strokeWidth: 1,\r
- radius: 1,\r
- outlineStroke: "transform",\r
- outlineWidth: 4\r
- },\r
- ConnectorStyle: {\r
- stroke: "#7D8695",\r
- strokeWidth: 1,\r
- outlineStroke: "transform",\r
- outlineWidth: 4\r
- },\r
- ConnectorHoverStyle: {\r
- stroke: "#00ABFF",\r
- strokeWidth: 2,\r
- outlineStroke: "transform",\r
- outlineWidth: 4\r
- },\r
- ConnectionOverlays: [\r
- ['Arrow', {\r
- location: 1,\r
- id: 'arrow',\r
- cssClass: 'icon-port',\r
- width: 11,\r
- length: 12\r
- }],\r
- ['Label', { label: '', id: 'label' }]\r
- ]\r
- });\r
-\r
- // add connection to model data while a new connection is build\r
- jsplumbInstance.bind('connection', info => {\r
- this.modelService.addConnection(info.connection.sourceId, info.connection.targetId);\r
-\r
- this.subscribe4Connection(info.connection);\r
-\r
- info.connection.bind('click', (connection, event) => {\r
- if ('Label' === connection.type) {\r
- return;\r
- }\r
- event.stopPropagation();\r
- const sequenceFlow = this.modelService.getSequenceFlow(connection.sourceId, connection.targetId);\r
- this.broadcastService.broadcast(this.broadcastService.showProperty, null);\r
- this.broadcastService.broadcast(this.broadcastService.selectedElement, [sequenceFlow]);\r
- });\r
-\r
- info.connection.bind('dblclick', connection => {\r
- if ('Label' === connection.type) {\r
- return;\r
- }\r
- const sequenceFlow = this.modelService.getSequenceFlow(connection.sourceId, connection.targetId);\r
- this.broadcastService.broadcast(this.broadcastService.showProperty, sequenceFlow);\r
- });\r
- });\r
-\r
- this.jsplumbInstanceMap.set(id, jsplumbInstance);\r
- }\r
-\r
- private subscribe4Connection(connection: any) {\r
- const pre = connection.sourceId + connection.targetId;\r
- let sequenceFlowSubscription = this.subscriptionMap.get(pre + 'sequenceFlowSubscription');\r
- if (sequenceFlowSubscription && !sequenceFlowSubscription.closed) {\r
- sequenceFlowSubscription.unsubscribe();\r
- }\r
-\r
- let currentThis = this;\r
- sequenceFlowSubscription = this.broadcastService.selectedElement$.subscribe(elements => {\r
- let selected = false;\r
- if (elements && 0 < elements.length) {\r
- for (let index = 0; index < elements.length; index++) {\r
- let element = elements[index];\r
- if (!this.modelService.isNode(element)) {\r
- let sequence = element as SequenceFlow;\r
- if (sequence.sourceRef === connection.sourceId\r
- && sequence.targetRef === connection.targetId) {\r
- selected = true;\r
- }\r
- }\r
- }\r
- }\r
- if (selected) {\r
- connection.setPaintStyle({\r
- stroke: '#00ABFF',\r
- strokeWidth: 1,\r
- radius: 1,\r
- outlineStroke: "transform",\r
- outlineWidth: 4\r
- });\r
- } else {\r
- connection.setPaintStyle({\r
- stroke: '#7D8695',\r
- strokeWidth: 1,\r
- radius: 1,\r
- outlineStroke: "transform",\r
- outlineWidth: 4\r
- });\r
- }\r
- });\r
- this.subscriptionMap.set(pre + 'sequenceFlowSubscription', sequenceFlowSubscription);\r
- }\r
-\r
- private unsubscription4Connection(connectionSelection: any) {\r
- connectionSelection.each(connection => {\r
- const pre = connection.sourceId + connection.targetId;\r
- this.subscriptionMap.get(pre + 'sequenceFlowSubscription').unsubscribe();\r
- });\r
- }\r
-\r
- public deleteConnect(sourceId: string, targetId: string) {\r
- const sourceNode = this.modelService.getNodeMap().get(sourceId);\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(sourceNode.parentId);\r
- const connectionSelection = jsplumbInstance.select({ source: sourceId, target: targetId });\r
- this.unsubscription4Connection(connectionSelection);\r
- connectionSelection.delete();\r
- }\r
-\r
- public setLabel(sourceId: string, targetId: string, label: string) {\r
- const sourceNode = this.modelService.getNodeMap().get(sourceId);\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(sourceNode.parentId);\r
- const connections = jsplumbInstance.select({ source: sourceId, target: targetId });\r
- connections.setLabel(label);\r
- }\r
-\r
- public getParentNodeId(id: string): string {\r
- const nodeElement = jsp.jsPlumb.getSelector('#' + id);\r
- const parentNode = this.getParentNodeEl(nodeElement[0]);\r
-\r
- return parentNode ? parentNode.id : null;\r
- }\r
-\r
- public initNode(node: WorkflowNode) {\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(node.parentId);\r
-\r
- this.jsplumbInstanceMap.get(this.modelService.rootNodeId).draggable(node.id, {\r
- scope: 'node',\r
- filter: '.ui-resizable-handle',\r
- classes: {\r
- 'ui-draggable': 'dragging'\r
- },\r
- // grid: [5, 5],\r
- drag: event => {\r
- // out of container edge, reset to minimal value.\r
- if (0 > event.pos[0]) {\r
- event.el.style.left = '0px';\r
- }\r
- if (0 > event.pos[1]) {\r
- event.el.style.top = '0px';\r
- }\r
-\r
- if (0 < this.selectNodes.length) {\r
- let moveAll = false;\r
- this.selectNodes.forEach(element => {\r
- if (element.id === event.el.id) {\r
- moveAll = true;\r
- }\r
- });\r
- if (moveAll) {\r
- this.selectNodes.forEach(selectNode => {\r
- if (selectNode.id !== event.el.id) {\r
- selectNode.position.left += event.e.movementX;\r
- selectNode.position.left = 0 > selectNode.position.left ? 0 : selectNode.position.left;\r
- selectNode.position.top += event.e.movementY;\r
- selectNode.position.top = 0 > selectNode.position.top ? 0 : selectNode.position.top;\r
- }\r
- jsplumbInstance.revalidate(jsplumbInstance.getSelector('#' + selectNode.id));\r
- });\r
- }\r
- }\r
- },\r
- stop: event => {\r
- this.selectNodes.forEach(selectNode => {\r
- jsplumbInstance.revalidate(jsplumbInstance.getSelector('#' + selectNode.id));\r
- });\r
- }\r
- });\r
-\r
- jsplumbInstance.makeTarget(node.id, {\r
- maxConnections: -1,\r
- beforeDrop: function (info) {\r
- const sourceId = info.sourceId;\r
- const targetId = info.targetId;\r
- if (sourceId === targetId) {\r
- return false;\r
- }\r
- const sameConnections = this.instance.getConnections({ source: sourceId, target: targetId });\r
- if (sameConnections && 0 < sameConnections.length) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- });\r
-\r
- jsplumbInstance.makeSource(node.id, {\r
- filter: '.anchor, .anchor *',\r
- maxConnections: -1,\r
- });\r
- }\r
-\r
- public nodeDroppable(node: WorkflowNode, rank: number) {\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(node.parentId);\r
-\r
- const selector = jsplumbInstance.getSelector('#' + node.id);\r
- this.jsplumbInstanceMap.get(this.modelService.rootNodeId).droppable(selector, {\r
- scope: 'node',\r
- rank,\r
- tolerance: 'pointer',\r
- drop: event => {\r
- if (!this.isChildNode(event.drop.el, event.drag.el)) {\r
- this.drop(event);\r
- }\r
- return true;\r
- },\r
- canDrop: drag => {\r
- const nodeMap = this.modelService.getNodeMap();\r
- const ancestorNode = nodeMap.get(drag.el.id);\r
-\r
- const isAncestor = this.modelService.isDescendantNode(ancestorNode, node.id);\r
- return !isAncestor;\r
- },\r
- });\r
- }\r
-\r
- private isChildNode(childElement, parentElement) {\r
- while (childElement !== parentElement) {\r
- childElement = childElement.parentNode;\r
- if (childElement.classList.contains('canvas')) {\r
- return false;\r
- }\r
- }\r
-\r
- return true;\r
- }\r
-\r
- private drop(event) {\r
- const dragEl = event.drag.el;\r
- const dropEl = event.drop.el;\r
-\r
- this.resizeParent(dragEl, dropEl);\r
-\r
- const nodeLeft = dragEl.getBoundingClientRect().left;\r
- const nodeTop = dragEl.getBoundingClientRect().top;\r
- const parentLeft = dropEl.getBoundingClientRect().left;\r
- const parentTop = dropEl.getBoundingClientRect().top;\r
- const left = nodeLeft - parentLeft + dropEl.scrollLeft;\r
- const top = nodeTop - parentTop + dropEl.scrollTop;\r
- dragEl.style.top = top + 'px';\r
- dragEl.style.left = left + 'px';\r
-\r
- // 12 is title height\r
- this.modelService.updatePosition(dragEl.id, left, top, dragEl.getBoundingClientRect().width, dragEl.getBoundingClientRect().height - 12);\r
-\r
- const originalParentNode = this.getParentNodeEl(dragEl);\r
- const originalParentNodeId = originalParentNode ? originalParentNode.id : this.modelService.rootNodeId;\r
-\r
- const targetParentNodeId = dropEl.classList.contains('node') ? dropEl.id : this.modelService.rootNodeId;\r
- this.changeParent(dragEl.id, originalParentNodeId, targetParentNodeId);\r
- }\r
-\r
- private changeParent(id: string, originalParentNodeId: string, targetParentNodeId: string) {\r
- if (originalParentNodeId !== targetParentNodeId) {\r
- this.jsplumbInstanceMap.get(originalParentNodeId).removeAllEndpoints(id);\r
- this.modelService.changeParent(id, originalParentNodeId, targetParentNodeId);\r
- }\r
- }\r
-\r
- private getParentNodeEl(element) {\r
- while (!(element.parentNode.classList.contains('node') || element.parentNode.classList.contains('canvas'))) {\r
- element = element.parentNode;\r
- }\r
-\r
- if (element.parentNode.classList.contains('canvas')) { // top level node\r
- return null;\r
- } else {\r
- return element.parentNode;\r
- }\r
- }\r
-\r
- public canvasDroppable() {\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(this.modelService.rootNodeId);\r
- const canvasSelector = jsplumbInstance.getSelector('.canvas');\r
- jsplumbInstance.droppable(canvasSelector, {\r
- scope: 'node',\r
- rank: 0,\r
- grid: [5, 5],\r
- drop: event => this.drop(event),\r
- });\r
- }\r
-\r
- public buttonDraggable() {\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(this.modelService.rootNodeId);\r
- const selector = jsplumbInstance.getSelector('.item');\r
- jsplumbInstance.draggable(selector, {\r
- scope: 'btn',\r
- clone: true\r
- });\r
- }\r
-\r
- public buttonDroppable() {\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(this.modelService.rootNodeId);\r
- const selector = jsplumbInstance.getSelector('.canvas');\r
- jsplumbInstance.droppable(selector, {\r
- scope: 'btn',\r
- // grid: [5, 5],\r
- drop: event => {\r
- const el = jsplumbInstance.getSelector(event.drag.el);\r
- const type = el.attributes.nodeType.value;\r
- // Mouse position minus drop canvas start position plus scroll position.\r
- let left = event.e.x - event.drop.pagePosition[0] + event.drop.el.scrollLeft;\r
- let top = event.e.y - event.drop.pagePosition[1] + event.drop.el.scrollTop;\r
- if (0 > left) {\r
- left = 0;\r
- }\r
- if (0 > top) {\r
- top = 0;\r
- }\r
- const name = event.drag.el.children[1].innerText;\r
- this.modelService.addNode(name, type, left, top);\r
- },\r
- });\r
- }\r
-\r
- public remove(node: WorkflowNode) {\r
- const jsplumbInstance = this.jsplumbInstanceMap.get(node.parentId);\r
-\r
- // unsubscription4Connection\r
- const connectionsAsSource = jsplumbInstance.select({ source: node.id });\r
- this.unsubscription4Connection(connectionsAsSource);\r
- const connectionsAsTarget = jsplumbInstance.select({ target: node.id });\r
- this.unsubscription4Connection(connectionsAsTarget);\r
-\r
- jsplumbInstance.remove(node.id);\r
- }\r
-\r
- public resizeParent(element: any, parentElement: any) {\r
- if (parentElement.classList.contains(this.rootClass)) {\r
- return;\r
- }\r
-\r
- if (!parentElement.classList.contains('node')) {\r
- this.resizeParent(element, parentElement.parentNode);\r
- return;\r
- }\r
-\r
- const leftResized = this.resizeParentLeft(element, parentElement);\r
- const rightResized = this.resizeParentRight(element, parentElement);\r
- const topResized = this.resizeParentTop(element, parentElement);\r
- const bottomResized = this.resizeParentBottom(element, parentElement);\r
-\r
- if (leftResized || rightResized || topResized || bottomResized) {\r
- if (parentElement.classList.contains('node')) {\r
- const rect = parentElement.getBoundingClientRect();\r
- this.modelService.updatePosition(parentElement.id,\r
- parentElement.offsetLeft,\r
- parentElement.offsetTop,\r
- // title height\r
- rect.width, rect.height - 12);\r
- }\r
- this.resizeParent(parentElement, parentElement.parentNode);\r
- }\r
- }\r
-\r
- private resizeParentLeft(element: any, parentElement: any): boolean {\r
- let resized = false;\r
-\r
- const actualLeft = element.getBoundingClientRect().left;\r
- const actualParentLeft = parentElement.getBoundingClientRect().left;\r
-\r
- if (actualLeft - this.padding < actualParentLeft) {\r
- const width = actualParentLeft - actualLeft + this.padding;\r
-\r
- this.translateElement(parentElement, -width, 0, width, 0);\r
- this.translateChildren(parentElement, element, width, 0);\r
- resized = true;\r
- }\r
-\r
- return resized;\r
- }\r
-\r
- private resizeParentRight(element: any, parentElement: any): boolean {\r
- let resized = false;\r
-\r
- const actualLeft = element.getBoundingClientRect().left;\r
- const actualRight = actualLeft + element.offsetWidth;\r
-\r
- const actualParentLeft = parentElement.getBoundingClientRect().left;\r
-\r
- if ((actualParentLeft + parentElement.offsetWidth) < actualRight + this.padding) {\r
- this.setElementWidth(parentElement, actualRight + this.padding - actualParentLeft);\r
- resized = true;\r
- }\r
-\r
- return resized;\r
- }\r
-\r
- private resizeParentBottom(element: any, parentElement: any): boolean {\r
- let resized = false;\r
-\r
- const actualTop = element.getBoundingClientRect().top;\r
- const actualBottom = actualTop + element.offsetHeight;\r
-\r
- const actualParentTop = parentElement.getBoundingClientRect().top;\r
- const actualParentBottom = actualParentTop + parentElement.offsetHeight;\r
-\r
- if (actualParentBottom < actualBottom + this.padding) {\r
- this.setElementHeight(parentElement, actualBottom + this.padding - actualParentTop);\r
- resized = true;\r
- }\r
-\r
- return resized;\r
- }\r
-\r
- private resizeParentTop(element: any, parentElement: any): boolean {\r
- let resized = false;\r
-\r
- const actualTop = element.getBoundingClientRect().top;\r
- const actualParentTop = parentElement.getBoundingClientRect().top;\r
-\r
- if (actualTop - this.padding < actualParentTop) {\r
- const height = actualParentTop - actualTop + this.padding;\r
-\r
- this.translateElement(parentElement, 0, -height, 0, height);\r
- this.translateChildren(parentElement, element, 0, height);\r
- resized = true;\r
- }\r
-\r
- return resized;\r
- }\r
-\r
- private translateElement(element, left: number, top: number, width: number, height: number) {\r
- const offsetLeft = element.offsetLeft + left;\r
- element.style.left = offsetLeft + 'px';\r
-\r
- const offsetTop = element.offsetTop + top;\r
- element.style.top = offsetTop + 'px';\r
-\r
- const offsetWidth = element.offsetWidth + width;\r
- element.style.width = offsetWidth + 'px';\r
-\r
- const offsetHeight = element.offsetHeight + height;\r
- element.style.height = offsetHeight + 'px';\r
-\r
- if (element.classList.contains('node')) {\r
- const node = this.modelService.getNodeMap().get(element.id);\r
- this.jsplumbInstanceMap.get(node.parentId).revalidate(element.id);\r
- }\r
- }\r
-\r
- private translateChildren(parentElment, excludeElement, left: number, top: number) {\r
- const len = parentElment.children.length;\r
- for (let i = 0; i < len; i++) {\r
- const childElment = parentElment.children[i];\r
- if (childElment.localName === 'b4t-node') {\r
- this.translateElement(childElment.children[0], left, top, 0, 0);\r
- }\r
- }\r
- }\r
-\r
- private setElementHeight(element, height: number) {\r
- element.style.height = height + 'px';\r
- }\r
-\r
- private setElementWidth(element, width: number) {\r
- element.style.width = width + 'px';\r
- }\r
-\r
- private getActualPosition(element, offset: string) {\r
- let actualPosition = element[offset];\r
- let current = element.offsetParent;\r
- while (current !== null) {\r
- actualPosition += element[offset];\r
- current = current.offsetParent;\r
- }\r
- return actualPosition;\r
- }\r
-}\r
+/**
+ * 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 { Injectable } from '@angular/core';
+import * as jsp from 'jsplumb';
+
+import { Subscription } from 'rxjs/Subscription';
+import { WorkflowNode } from '../model/workflow/workflow-node';
+import { BroadcastService } from './broadcast.service';
+import { ModelService } from './model.service';
+import { SequenceFlow } from '../model/workflow/sequence-flow';
+import { Position } from '../model/workflow/position';
+
+/**
+ * JsPlumbService
+ * provides all of the operations about jsplumb plugin.
+ */
+@Injectable()
+export class JsPlumbService {
+ public jsplumbInstanceMap = new Map<string, any>();
+ public subscriptionMap = new Map<string, Subscription>();
+
+ private padding = 20;
+ private rootClass = 'canvas';
+ private selectNodes: WorkflowNode[] = [];
+
+ constructor(private modelService: ModelService, private broadcastService: BroadcastService) {
+ this.broadcastService.selectedElement$.subscribe(elements => {
+ this.selectNodes = [];
+ if (elements && 0 < elements.length) {
+ for (let index = 0; index < elements.length; index++) {
+ let element = elements[index];
+ if (this.modelService.isNode(element)) {
+ let node = element as WorkflowNode;
+ this.selectNodes.push(node);
+ }
+ }
+ }
+ });
+
+ this.broadcastService.planModel$.subscribe(Workflow => {
+ this.jsplumbInstanceMap.get(this.modelService.rootNodeId).reset();
+ this.unsubscriptionAll();
+ this.buttonDraggable();
+ this.buttonDroppable();
+ });
+ }
+
+ private unsubscriptionAll() {
+ this.subscriptionMap.forEach(subscription => subscription.unsubscribe());
+ }
+
+ public connectChildrenNodes(parentNodeId: string) {
+ const jsplumbInstance = this.jsplumbInstanceMap.get(parentNodeId);
+
+ const nodes: WorkflowNode[] = this.modelService.getChildrenNodes(parentNodeId);
+ nodes.forEach(node => this.connect4OneNode(node, jsplumbInstance));
+ }
+
+ public connect4OneNode(node: WorkflowNode, jsplumbInstance: any) {
+ node.connection.forEach(sequenceFlow => {
+ const connection = jsplumbInstance.connect({
+ source: sequenceFlow.sourceRef,
+ target: sequenceFlow.targetRef,
+ });
+ if (sequenceFlow.name) {
+ connection.setLabel(sequenceFlow.name);
+ }
+ });
+ }
+
+ public initJsPlumbInstance(id: string) {
+ if (this.jsplumbInstanceMap.get(id)) {
+ return;
+ }
+ const jsplumbInstance = jsp.jsPlumb.getInstance();
+
+ jsplumbInstance.importDefaults({
+ Anchor: "Continuous",
+ Endpoint: "Blank",
+ Container: "pallete",
+ ReattachConnections: true,
+ Connector: ['Flowchart', {
+ stub: [0, 0],
+ cornerRadius: 5,
+ alwaysRespectStubs: true
+ }],
+ PaintStyle: {
+ stroke: "#7D8695",
+ strokeWidth: 1,
+ radius: 1,
+ outlineStroke: "transform",
+ outlineWidth: 4
+ },
+ ConnectorStyle: {
+ stroke: "#7D8695",
+ strokeWidth: 1,
+ outlineStroke: "transform",
+ outlineWidth: 4
+ },
+ ConnectorHoverStyle: {
+ stroke: "#00ABFF",
+ strokeWidth: 2,
+ outlineStroke: "transform",
+ outlineWidth: 4
+ },
+ ConnectionOverlays: [
+ ['Arrow', {
+ location: 1,
+ id: 'arrow',
+ cssClass: 'icon-port',
+ width: 11,
+ length: 12
+ }],
+ ['Label', { label: '', id: 'label' }]
+ ]
+ });
+
+ // add connection to model data while a new connection is build
+ jsplumbInstance.bind('connection', info => {
+ this.modelService.addConnection(info.connection.sourceId, info.connection.targetId);
+
+ this.subscribe4Connection(info.connection);
+
+ info.connection.bind('click', (connection, event) => {
+ if ('Label' === connection.type) {
+ return;
+ }
+ event.stopPropagation();
+ const sequenceFlow = this.modelService.getSequenceFlow(connection.sourceId, connection.targetId);
+ this.broadcastService.broadcast(this.broadcastService.showProperty, null);
+ this.broadcastService.broadcast(this.broadcastService.selectedElement, [sequenceFlow]);
+ });
+
+ info.connection.bind('dblclick', connection => {
+ if ('Label' === connection.type) {
+ return;
+ }
+ const sequenceFlow = this.modelService.getSequenceFlow(connection.sourceId, connection.targetId);
+ this.broadcastService.broadcast(this.broadcastService.showProperty, sequenceFlow);
+ });
+ });
+
+ this.jsplumbInstanceMap.set(id, jsplumbInstance);
+ }
+
+ private subscribe4Connection(connection: any) {
+ const pre = connection.sourceId + connection.targetId;
+ let sequenceFlowSubscription = this.subscriptionMap.get(pre + 'sequenceFlowSubscription');
+ if (sequenceFlowSubscription && !sequenceFlowSubscription.closed) {
+ sequenceFlowSubscription.unsubscribe();
+ }
+
+ let currentThis = this;
+ sequenceFlowSubscription = this.broadcastService.selectedElement$.subscribe(elements => {
+ let selected = false;
+ if (elements && 0 < elements.length) {
+ for (let index = 0; index < elements.length; index++) {
+ let element = elements[index];
+ if (!this.modelService.isNode(element)) {
+ let sequence = element as SequenceFlow;
+ if (sequence.sourceRef === connection.sourceId
+ && sequence.targetRef === connection.targetId) {
+ selected = true;
+ }
+ }
+ }
+ }
+ if (selected) {
+ connection.setPaintStyle({
+ stroke: '#00ABFF',
+ strokeWidth: 1,
+ radius: 1,
+ outlineStroke: "transform",
+ outlineWidth: 4
+ });
+ } else {
+ connection.setPaintStyle({
+ stroke: '#7D8695',
+ strokeWidth: 1,
+ radius: 1,
+ outlineStroke: "transform",
+ outlineWidth: 4
+ });
+ }
+ });
+ this.subscriptionMap.set(pre + 'sequenceFlowSubscription', sequenceFlowSubscription);
+ }
+
+ private unsubscription4Connection(connectionSelection: any) {
+ connectionSelection.each(connection => {
+ const pre = connection.sourceId + connection.targetId;
+ this.subscriptionMap.get(pre + 'sequenceFlowSubscription').unsubscribe();
+ });
+ }
+
+ public deleteConnect(sourceId: string, targetId: string) {
+ const sourceNode = this.modelService.getNodeMap().get(sourceId);
+ const jsplumbInstance = this.jsplumbInstanceMap.get(sourceNode.parentId);
+ const connectionSelection = jsplumbInstance.select({ source: sourceId, target: targetId });
+ this.unsubscription4Connection(connectionSelection);
+ connectionSelection.delete();
+ }
+
+ public setLabel(sourceId: string, targetId: string, label: string) {
+ const sourceNode = this.modelService.getNodeMap().get(sourceId);
+ const jsplumbInstance = this.jsplumbInstanceMap.get(sourceNode.parentId);
+ const connections = jsplumbInstance.select({ source: sourceId, target: targetId });
+ connections.setLabel(label);
+ }
+
+ public getParentNodeId(id: string): string {
+ const nodeElement = jsp.jsPlumb.getSelector('#' + id);
+ const parentNode = this.getParentNodeEl(nodeElement[0]);
+
+ return parentNode ? parentNode.id : null;
+ }
+
+ public initNode(node: WorkflowNode) {
+ const jsplumbInstance = this.jsplumbInstanceMap.get(node.parentId);
+
+ this.jsplumbInstanceMap.get(this.modelService.rootNodeId).draggable(node.id, {
+ scope: 'node',
+ filter: '.ui-resizable-handle',
+ classes: {
+ 'ui-draggable': 'dragging'
+ },
+ // grid: [5, 5],
+ drag: event => {
+ // out of container edge, reset to minimal value.
+ if (0 > event.pos[0]) {
+ event.el.style.left = '0px';
+ }
+ if (0 > event.pos[1]) {
+ event.el.style.top = '0px';
+ }
+
+ if (0 < this.selectNodes.length) {
+ let moveAll = false;
+ this.selectNodes.forEach(element => {
+ if (element.id === event.el.id) {
+ moveAll = true;
+ }
+ });
+ if (moveAll) {
+ this.selectNodes.forEach(selectNode => {
+ if (selectNode.id !== event.el.id) {
+ selectNode.position.left += event.e.movementX;
+ selectNode.position.left = 0 > selectNode.position.left ? 0 : selectNode.position.left;
+ selectNode.position.top += event.e.movementY;
+ selectNode.position.top = 0 > selectNode.position.top ? 0 : selectNode.position.top;
+ }
+ jsplumbInstance.revalidate(jsplumbInstance.getSelector('#' + selectNode.id));
+ });
+ }
+ }
+ },
+ stop: event => {
+ this.selectNodes.forEach(selectNode => {
+ jsplumbInstance.revalidate(jsplumbInstance.getSelector('#' + selectNode.id));
+ });
+ }
+ });
+
+ jsplumbInstance.makeTarget(node.id, {
+ maxConnections: -1,
+ beforeDrop: function (info) {
+ const sourceId = info.sourceId;
+ const targetId = info.targetId;
+ if (sourceId === targetId) {
+ return false;
+ }
+ const sameConnections = this.instance.getConnections({ source: sourceId, target: targetId });
+ if (sameConnections && 0 < sameConnections.length) {
+ return false;
+ }
+ return true;
+ }
+
+ });
+
+ jsplumbInstance.makeSource(node.id, {
+ filter: '.anchor, .anchor *',
+ maxConnections: -1,
+ });
+ }
+
+ public nodeDroppable(node: WorkflowNode, rank: number) {
+ const jsplumbInstance = this.jsplumbInstanceMap.get(node.parentId);
+
+ const selector = jsplumbInstance.getSelector('#' + node.id);
+ this.jsplumbInstanceMap.get(this.modelService.rootNodeId).droppable(selector, {
+ scope: 'node',
+ rank,
+ tolerance: 'pointer',
+ drop: event => {
+ if (!this.isChildNode(event.drop.el, event.drag.el)) {
+ this.drop(event);
+ }
+ return true;
+ },
+ canDrop: drag => {
+ const nodeMap = this.modelService.getNodeMap();
+ const ancestorNode = nodeMap.get(drag.el.id);
+
+ const isAncestor = this.modelService.isDescendantNode(ancestorNode, node.id);
+ return !isAncestor;
+ },
+ });
+ }
+
+ private isChildNode(childElement, parentElement) {
+ while (childElement !== parentElement) {
+ childElement = childElement.parentNode;
+ if (childElement.classList.contains('canvas')) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private drop(event) {
+ const dragEl = event.drag.el;
+ const dropEl = event.drop.el;
+
+ this.resizeParent(dragEl, dropEl);
+
+ const nodeLeft = dragEl.getBoundingClientRect().left;
+ const nodeTop = dragEl.getBoundingClientRect().top;
+ const parentLeft = dropEl.getBoundingClientRect().left;
+ const parentTop = dropEl.getBoundingClientRect().top;
+ const left = nodeLeft - parentLeft + dropEl.scrollLeft;
+ const top = nodeTop - parentTop + dropEl.scrollTop;
+ dragEl.style.top = top + 'px';
+ dragEl.style.left = left + 'px';
+
+ // 12 is title height
+ this.modelService.updatePosition(dragEl.id, left, top, dragEl.getBoundingClientRect().width, dragEl.getBoundingClientRect().height - 12);
+
+ const originalParentNode = this.getParentNodeEl(dragEl);
+ const originalParentNodeId = originalParentNode ? originalParentNode.id : this.modelService.rootNodeId;
+
+ const targetParentNodeId = dropEl.classList.contains('node') ? dropEl.id : this.modelService.rootNodeId;
+ this.changeParent(dragEl.id, originalParentNodeId, targetParentNodeId);
+ }
+
+ private changeParent(id: string, originalParentNodeId: string, targetParentNodeId: string) {
+ if (originalParentNodeId !== targetParentNodeId) {
+ this.jsplumbInstanceMap.get(originalParentNodeId).removeAllEndpoints(id);
+ this.modelService.changeParent(id, originalParentNodeId, targetParentNodeId);
+ }
+ }
+
+ private getParentNodeEl(element) {
+ while (!(element.parentNode.classList.contains('node') || element.parentNode.classList.contains('canvas'))) {
+ element = element.parentNode;
+ }
+
+ if (element.parentNode.classList.contains('canvas')) { // top level node
+ return null;
+ } else {
+ return element.parentNode;
+ }
+ }
+
+ public canvasDroppable() {
+ const jsplumbInstance = this.jsplumbInstanceMap.get(this.modelService.rootNodeId);
+ const canvasSelector = jsplumbInstance.getSelector('.canvas');
+ jsplumbInstance.droppable(canvasSelector, {
+ scope: 'node',
+ rank: 0,
+ grid: [5, 5],
+ drop: event => this.drop(event),
+ });
+ }
+
+ public buttonDraggable() {
+ const jsplumbInstance = this.jsplumbInstanceMap.get(this.modelService.rootNodeId);
+ const selector = jsplumbInstance.getSelector('.item');
+ jsplumbInstance.draggable(selector, {
+ scope: 'btn',
+ clone: true
+ });
+ }
+
+ public buttonDroppable() {
+ const jsplumbInstance = this.jsplumbInstanceMap.get(this.modelService.rootNodeId);
+ const selector = jsplumbInstance.getSelector('.canvas');
+ jsplumbInstance.droppable(selector, {
+ scope: 'btn',
+ // grid: [5, 5],
+ drop: event => {
+ const el = jsplumbInstance.getSelector(event.drag.el);
+ const type = el.attributes.nodeType.value;
+ // Mouse position minus drop canvas start position plus scroll position.
+ let left = event.e.x - event.drop.pagePosition[0] + event.drop.el.scrollLeft;
+ let top = event.e.y - event.drop.pagePosition[1] + event.drop.el.scrollTop;
+ if (0 > left) {
+ left = 0;
+ }
+ if (0 > top) {
+ top = 0;
+ }
+ const name = event.drag.el.children[1].innerText;
+ this.modelService.addNode(name, type, left, top);
+ },
+ });
+ }
+
+ public remove(node: WorkflowNode) {
+ const jsplumbInstance = this.jsplumbInstanceMap.get(node.parentId);
+
+ // unsubscription4Connection
+ const connectionsAsSource = jsplumbInstance.select({ source: node.id });
+ this.unsubscription4Connection(connectionsAsSource);
+ const connectionsAsTarget = jsplumbInstance.select({ target: node.id });
+ this.unsubscription4Connection(connectionsAsTarget);
+
+ jsplumbInstance.remove(node.id);
+ }
+
+ public resizeParent(element: any, parentElement: any) {
+ if (parentElement.classList.contains(this.rootClass)) {
+ return;
+ }
+
+ if (!parentElement.classList.contains('node')) {
+ this.resizeParent(element, parentElement.parentNode);
+ return;
+ }
+
+ const leftResized = this.resizeParentLeft(element, parentElement);
+ const rightResized = this.resizeParentRight(element, parentElement);
+ const topResized = this.resizeParentTop(element, parentElement);
+ const bottomResized = this.resizeParentBottom(element, parentElement);
+
+ if (leftResized || rightResized || topResized || bottomResized) {
+ if (parentElement.classList.contains('node')) {
+ const rect = parentElement.getBoundingClientRect();
+ this.modelService.updatePosition(parentElement.id,
+ parentElement.offsetLeft,
+ parentElement.offsetTop,
+ // title height
+ rect.width, rect.height - 12);
+ }
+ this.resizeParent(parentElement, parentElement.parentNode);
+ }
+ }
+
+ private resizeParentLeft(element: any, parentElement: any): boolean {
+ let resized = false;
+
+ const actualLeft = element.getBoundingClientRect().left;
+ const actualParentLeft = parentElement.getBoundingClientRect().left;
+
+ if (actualLeft - this.padding < actualParentLeft) {
+ const width = actualParentLeft - actualLeft + this.padding;
+
+ this.translateElement(parentElement, -width, 0, width, 0);
+ this.translateChildren(parentElement, element, width, 0);
+ resized = true;
+ }
+
+ return resized;
+ }
+
+ private resizeParentRight(element: any, parentElement: any): boolean {
+ let resized = false;
+
+ const actualLeft = element.getBoundingClientRect().left;
+ const actualRight = actualLeft + element.offsetWidth;
+
+ const actualParentLeft = parentElement.getBoundingClientRect().left;
+
+ if ((actualParentLeft + parentElement.offsetWidth) < actualRight + this.padding) {
+ this.setElementWidth(parentElement, actualRight + this.padding - actualParentLeft);
+ resized = true;
+ }
+
+ return resized;
+ }
+
+ private resizeParentBottom(element: any, parentElement: any): boolean {
+ let resized = false;
+
+ const actualTop = element.getBoundingClientRect().top;
+ const actualBottom = actualTop + element.offsetHeight;
+
+ const actualParentTop = parentElement.getBoundingClientRect().top;
+ const actualParentBottom = actualParentTop + parentElement.offsetHeight;
+
+ if (actualParentBottom < actualBottom + this.padding) {
+ this.setElementHeight(parentElement, actualBottom + this.padding - actualParentTop);
+ resized = true;
+ }
+
+ return resized;
+ }
+
+ private resizeParentTop(element: any, parentElement: any): boolean {
+ let resized = false;
+
+ const actualTop = element.getBoundingClientRect().top;
+ const actualParentTop = parentElement.getBoundingClientRect().top;
+
+ if (actualTop - this.padding < actualParentTop) {
+ const height = actualParentTop - actualTop + this.padding;
+
+ this.translateElement(parentElement, 0, -height, 0, height);
+ this.translateChildren(parentElement, element, 0, height);
+ resized = true;
+ }
+
+ return resized;
+ }
+
+ private translateElement(element, left: number, top: number, width: number, height: number) {
+ const offsetLeft = element.offsetLeft + left;
+ element.style.left = offsetLeft + 'px';
+
+ const offsetTop = element.offsetTop + top;
+ element.style.top = offsetTop + 'px';
+
+ const offsetWidth = element.offsetWidth + width;
+ element.style.width = offsetWidth + 'px';
+
+ const offsetHeight = element.offsetHeight + height;
+ element.style.height = offsetHeight + 'px';
+
+ if (element.classList.contains('node')) {
+ const node = this.modelService.getNodeMap().get(element.id);
+ this.jsplumbInstanceMap.get(node.parentId).revalidate(element.id);
+ }
+ }
+
+ private translateChildren(parentElment, excludeElement, left: number, top: number) {
+ const len = parentElment.children.length;
+ for (let i = 0; i < len; i++) {
+ const childElment = parentElment.children[i];
+ if (childElment.localName === 'b4t-node') {
+ this.translateElement(childElment.children[0], left, top, 0, 0);
+ }
+ }
+ }
+
+ private setElementHeight(element, height: number) {
+ element.style.height = height + 'px';
+ }
+
+ private setElementWidth(element, width: number) {
+ element.style.width = width + 'px';
+ }
+
+ private getActualPosition(element, offset: string) {
+ let actualPosition = element[offset];
+ let current = element.offsetParent;
+ while (current !== null) {
+ actualPosition += element[offset];
+ current = current.offsetParent;
+ }
+ return actualPosition;
+ }
+}
-/**\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 { Injectable } from '@angular/core';\r
-import { isNullOrUndefined } from 'util';\r
-\r
-import { PlanModel } from '../model/plan-model';\r
-import { PlanTreeviewItem } from '../model/plan-treeview-item';\r
-import { RestConfig } from '../model/rest-config';\r
-import { Swagger, SwaggerModel, SwaggerModelSimple, SwaggerPrimitiveObject, SwaggerReferenceObject } from '../model/swagger';\r
-import { ErrorEvent } from '../model/workflow/error-event';\r
-import { IntermediateCatchEvent } from '../model/workflow/intermediate-catch-event';\r
-import { NodeType } from '../model/workflow/node-type.enum';\r
-import { Parameter } from '../model/workflow/parameter';\r
-import { Position } from '../model/workflow/position';\r
-import { RestTask } from '../model/workflow/rest-task';\r
-import { SequenceFlow } from '../model/workflow/sequence-flow';\r
-import { StartEvent } from '../model/workflow/start-event';\r
-import { SubProcess } from '../model/workflow/sub-process';\r
-import { ToscaNodeTask } from '../model/workflow/tosca-node-task';\r
-import { WorkflowNode } from '../model/workflow/workflow-node';\r
-import { NodeTemplate } from '../model/topology/node-template';\r
-import { ValueSource } from '../model/value-source.enum';\r
-import { BroadcastService } from './broadcast.service';\r
-import { RestService } from './rest.service';\r
-import { SwaggerTreeConverterService } from './swagger-tree-converter.service';\r
-import { ScriptTask } from "../model/workflow/script-task";\r
-import { TimerEventDefinition, TimerEventDefinitionType } from "../model/workflow/timer-event-definition";\r
-\r
-/**\r
- * ModelService\r
- * provides all operations about plan model.\r
- */\r
-@Injectable()\r
-export class ModelService {\r
- public rootNodeId = 'root';\r
-\r
- private planModel: PlanModel = new PlanModel();\r
-\r
- constructor(private broadcastService: BroadcastService, private restService: RestService) {\r
- this.broadcastService.planModel$.subscribe(plan => {\r
- plan.nodes.forEach(node => {\r
- switch (node.type) {\r
- case NodeType[NodeType.startEvent]:\r
- node.position.width = 56;\r
- node.position.height = 56;\r
- break;\r
- case NodeType[NodeType.endEvent]:\r
- node.position.width = 56;\r
- node.position.height = 56;\r
- break;\r
- case NodeType[NodeType.restTask]:\r
- node.position.width = 56;\r
- node.position.height = 56;\r
- break;\r
- case NodeType[NodeType.errorStartEvent]:\r
- case NodeType[NodeType.errorEndEvent]:\r
- node.position.width = 26;\r
- node.position.height = 26;\r
- break;\r
- case NodeType[NodeType.toscaNodeManagementTask]:\r
- node.position.width = 56;\r
- node.position.height = 56;\r
- break;\r
- case NodeType[NodeType.subProcess]:\r
- node.position.width = 56;\r
- node.position.height = 56;\r
- break;\r
- case NodeType[NodeType.intermediateCatchEvent]:\r
- node.position.width = 56;\r
- node.position.height = 56;\r
- break;\r
- case NodeType[NodeType.scriptTask]:\r
- node.position.width = 56;\r
- node.position.height = 56;\r
- break;\r
- case NodeType[NodeType.exclusiveGateway]:\r
- case NodeType[NodeType.parallelGateway]:\r
- node.position.width = 26;\r
- node.position.height = 26;\r
- break;\r
- default:\r
- node.position.width = 56;\r
- node.position.height = 56;\r
- break;\r
- }\r
- });\r
- this.planModel = plan;\r
- });\r
- this.broadcastService.updateModelRestConfig$.subscribe(restConfigs => {\r
- this.updateRestConfig(restConfigs);\r
- });\r
- }\r
-\r
- public getChildrenNodes(parentId: string): WorkflowNode[] {\r
- if (!parentId || parentId === this.rootNodeId) {\r
- return this.planModel.nodes;\r
- } else {\r
- const node = this.getNodeMap().get(parentId);\r
- if (node.type === 'subProcess') {\r
- return (<SubProcess>node).children;\r
- } else {\r
- return [];\r
- }\r
- }\r
- }\r
-\r
- public getNodes(): WorkflowNode[] {\r
- return this.planModel.nodes;\r
- }\r
-\r
- public getSequenceFlow(sourceRef: string, targetRef: string): SequenceFlow {\r
- const node = this.getNodeMap().get(sourceRef);\r
- if (node) {\r
- const sequenceFlow = node.connection.find(tmp => tmp.targetRef === targetRef);\r
- return sequenceFlow;\r
- } else {\r
- return null;\r
- }\r
- }\r
-\r
- public addNode(name: string, type: string, left: number, top: number) {\r
- const id = this.createId();\r
- const workflowPos = new Position(left, top);\r
- const node = this.createNodeByType(id, name, type, workflowPos);\r
- this.planModel.nodes.push(node);\r
- }\r
-\r
- private createNodeByType(id: string, name: string, type: string, position: Position): WorkflowNode {\r
- const bigPosition = new Position(position.left, position.top, 56, 56);\r
- const smallPosition = new Position(position.left, position.top, 26, 26);\r
- switch (type) {\r
- case NodeType[NodeType.startEvent]:\r
- let startEventNode: StartEvent = {\r
- id: id, type: type, name: name, parentId: this.rootNodeId,\r
- position: bigPosition, connection: [], parameters: []\r
- };\r
- return startEventNode;\r
- case NodeType[NodeType.endEvent]:\r
- let endEventNode: WorkflowNode = {\r
- id: id, type: type, name: name, parentId: this.rootNodeId,\r
- position: bigPosition, connection: []\r
- };\r
- return endEventNode;\r
- case NodeType[NodeType.restTask]:\r
- let restTaskNode: RestTask = {\r
- id: id, type: type, name: name, parentId: this.rootNodeId,\r
- position: bigPosition, connection: [], produces: [], consumes: [], parameters: [], responses: []\r
- };\r
- return restTaskNode;\r
- case NodeType[NodeType.errorStartEvent]:\r
- case NodeType[NodeType.errorEndEvent]:\r
- let errorEventNode: ErrorEvent = {\r
- id: id, type: type, name: '', parentId: this.rootNodeId,\r
- position: smallPosition, connection: [], parameter: new Parameter('errorRef', '', ValueSource[ValueSource.String])\r
- };\r
- return errorEventNode;\r
- case NodeType[NodeType.toscaNodeManagementTask]:\r
- let toscaNodeTask: ToscaNodeTask = {\r
- id: id, type: type, name: name, parentId: this.rootNodeId,\r
- position: bigPosition, connection: [], input: [], output: [], template: new NodeTemplate()\r
- };\r
- return toscaNodeTask;\r
- case NodeType[NodeType.subProcess]:\r
- let subProcess: SubProcess = {\r
- id: id, type: type, name: name, parentId: this.rootNodeId,\r
- position: bigPosition, connection: [], children: []\r
- };\r
- return subProcess;\r
- case NodeType[NodeType.intermediateCatchEvent]:\r
- let intermediateCatchEvent: IntermediateCatchEvent = {\r
- id: id, type: type, name: name, parentId: this.rootNodeId,\r
- position: bigPosition, connection: [], timerEventDefinition: <TimerEventDefinition>{ type: TimerEventDefinitionType[TimerEventDefinitionType.timeDuration] }\r
- };\r
- return intermediateCatchEvent;\r
- case NodeType[NodeType.scriptTask]:\r
- let scriptTask: ScriptTask = {\r
- id: id, type: type, name: name, parentId: this.rootNodeId,\r
- position: bigPosition, connection: [], scriptFormat: 'JavaScript'\r
- };\r
- return scriptTask;\r
- case NodeType[NodeType.exclusiveGateway]:\r
- case NodeType[NodeType.parallelGateway]:\r
- let getway: WorkflowNode = {\r
- id: id, type: type, name: '', parentId: this.rootNodeId,\r
- position: smallPosition, connection: []\r
- };\r
- return getway;\r
- default:\r
- let node: WorkflowNode = {\r
- id: id, type: type, name: name, parentId: this.rootNodeId,\r
- position: bigPosition, connection: []\r
- };\r
- return node;\r
- }\r
- }\r
-\r
- public isNode(object: any): boolean {\r
- return undefined !== object.type;\r
- }\r
-\r
- // public createNodeByJson(obj: any): WorkflowNode {\r
- // let node;\r
- // switch (obj.type) {\r
- // case NodeType[NodeType.startEvent]:\r
- // node = new StartEvent(obj.name, obj.id, obj.type, this.rootNodeId, obj.position);\r
- // node.parameters = obj.parameters;\r
- // return node;\r
- // case NodeType[NodeType.restTask]:\r
- // node = new RestTask(obj.name, obj.id, obj.type, this.rootNodeId, obj.position);\r
- // node.\r
- // case NodeType[NodeType.errorStartEvent]:\r
- // return new ErrorEvent(type, id, type, this.rootNodeId, position);\r
- // case NodeType[NodeType.errorEndEvent]:\r
- // return new ErrorEvent(type, id, type, this.rootNodeId, position);\r
- // case NodeType[NodeType.toscaNodeManagementTask]:\r
- // return new ToscaNodeTask(type, id, type, this.rootNodeId, position);\r
- // case NodeType[NodeType.subProcess]:\r
- // return new SubProcess(type, id, type, this.rootNodeId, position);\r
- // case NodeType[NodeType.intermediateCatchEvent]:\r
- // return new IntermediateCatchEvent(type, id, type, this.rootNodeId, position);\r
- // case NodeType[NodeType.scriptTask]:\r
- // return new ScriptTask(type, id, type, this.rootNodeId, position);\r
- // default:\r
- // return new WorkflowNode(type, id, type, this.rootNodeId, position);\r
- // }\r
- // return node;\r
- // }\r
-\r
- public changeParent(id: string, originalParentId: string, targetParentId: string) {\r
- if (originalParentId === targetParentId) {\r
- return;\r
- }\r
-\r
- const node: WorkflowNode = this.deleteNode(originalParentId, id);\r
- node.parentId = targetParentId;\r
-\r
- if (targetParentId) {\r
- this.addChild(targetParentId, node);\r
- } else {\r
- this.planModel.nodes.push(node);\r
- }\r
- }\r
-\r
- public updatePosition(id: string, left: number, top: number, width: number, height: number) {\r
- const node = this.getNodeMap().get(id);\r
- node.position.left = left;\r
- node.position.top = top;\r
- node.position.width = width;\r
- node.position.height = height;\r
- }\r
-\r
- public updateRestConfig(restConfigs: RestConfig[]): void {\r
- this.planModel.configs = { restConfigs: restConfigs };\r
- // console.log(this.planModel.configs);\r
- }\r
-\r
- public getNodeMap(): Map<string, WorkflowNode> {\r
- const map = new Map<string, WorkflowNode>();\r
- this.toNodeMap(this.planModel.nodes, map);\r
- return map;\r
- }\r
-\r
- public getAncestors(id: string): WorkflowNode[] {\r
- const nodeMap = this.getNodeMap();\r
- const ancestors = [];\r
-\r
- let ancestor = nodeMap.get(id);\r
- do {\r
- ancestor = this.getParentNode(ancestor.id, nodeMap);\r
- if (ancestor && ancestor.id !== id) {\r
- ancestors.push(ancestor);\r
- }\r
- } while (ancestor);\r
-\r
- return ancestors;\r
- }\r
-\r
- private getParentNode(id: string, nodeMap: Map<string, WorkflowNode>): WorkflowNode {\r
- let parentNode;\r
- nodeMap.forEach((node, key) => {\r
- if (NodeType[NodeType.subProcess] === node.type) {\r
- const childNode = (<SubProcess>node).children.find(child => child.id === id);\r
- if (childNode) {\r
- parentNode = node;\r
- }\r
- }\r
-\r
- });\r
-\r
- return parentNode;\r
- }\r
-\r
- public isDescendantNode(node: WorkflowNode, descendantId: string): boolean {\r
- if (NodeType[NodeType.subProcess] !== node.type) {\r
- return false;\r
- }\r
- const tmp = (<SubProcess>node).children.find(child => {\r
- return child.id === descendantId || (NodeType[NodeType.subProcess] === child.type && this.isDescendantNode(<SubProcess>child, descendantId));\r
- });\r
-\r
- return tmp !== undefined;\r
- }\r
-\r
- private toNodeMap(nodes: WorkflowNode[], map: Map<string, WorkflowNode>) {\r
- nodes.forEach(node => {\r
- if (node.type === 'subProcess') {\r
- this.toNodeMap((<SubProcess>node).children, map);\r
- }\r
- map.set(node.id, node);\r
- });\r
- }\r
-\r
- public addConnection(sourceId: string, targetId: string) {\r
- const node = this.getNodeMap().get(sourceId);\r
- if (node) {\r
- const index = node.connection.findIndex(sequenceFlow => sequenceFlow.targetRef === targetId);\r
- if (index === -1) {\r
- const sequenceFlow: SequenceFlow = { sourceRef: sourceId, targetRef: targetId };\r
- node.connection.push(sequenceFlow);\r
- }\r
- }\r
- }\r
-\r
- public deleteConnection(sourceId: string, targetId: string) {\r
- const node = this.getNodeMap().get(sourceId);\r
- if (node) {\r
- const index = node.connection.findIndex(sequenceFlow => sequenceFlow.targetRef === targetId);\r
- if (index !== -1) {\r
- node.connection.splice(index, 1);\r
- }\r
- }\r
- }\r
-\r
- public deleteNode(parentId: string, nodeId: string): WorkflowNode {\r
- const nodeMap = this.getNodeMap();\r
-\r
- const nodes = this.getChildrenNodes(parentId);\r
-\r
- // delete related connections\r
- nodes.forEach(node => this.deleteConnection(node.id, nodeId));\r
-\r
- // delete current node\r
- const index = nodes.findIndex(node => node.id === nodeId);\r
- if (index !== -1) {\r
- const node = nodes.splice(index, 1)[0];\r
- node.connection = [];\r
- return node;\r
- }\r
-\r
- return null;\r
- }\r
-\r
- public addChild(parentId: string, child: WorkflowNode) {\r
- this.getChildrenNodes(parentId).push(child);\r
- }\r
-\r
- public deleteChild(node: SubProcess, id: string): WorkflowNode {\r
- const index = node.children.findIndex(child => child.id === id);\r
- if (index !== -1) {\r
- const deletedNode = node.children.splice(index, 1);\r
- return deletedNode[0];\r
- }\r
-\r
- return null;\r
- }\r
-\r
- public getPlanParameters(nodeId: string): PlanTreeviewItem[] {\r
- const preNodeList = new Array<WorkflowNode>();\r
- this.getPreNodes(nodeId, this.getNodeMap(), preNodeList);\r
-\r
- return this.loadNodeOutputs(preNodeList);\r
- }\r
-\r
- private loadNodeOutputs(nodes: WorkflowNode[]): PlanTreeviewItem[] {\r
- const params = new Array<PlanTreeviewItem>();\r
- nodes.forEach(node => {\r
- switch (node.type) {\r
- case NodeType[NodeType.startEvent]:\r
- params.push(this.loadOutput4StartEvent(<StartEvent>node));\r
- break;\r
- case NodeType[NodeType.toscaNodeManagementTask]:\r
- params.push(this.loadOutput4ToscaNodeTask(<ToscaNodeTask>node));\r
- break;\r
- case NodeType[NodeType.restTask]:\r
- params.push(this.loadOutput4RestTask(<RestTask>node));\r
- break;\r
- default:\r
- break;\r
- }\r
- });\r
-\r
- return params;\r
- }\r
-\r
- private loadOutput4StartEvent(node: StartEvent): PlanTreeviewItem {\r
- const startItem = new PlanTreeviewItem(node.name, `[${node.id}]`, [], false);\r
- node.parameters.map(param =>\r
- startItem.children.push(new PlanTreeviewItem(param.name, `[${param.name}]`, [])));\r
- return startItem;\r
- }\r
-\r
- private loadOutput4ToscaNodeTask(node: ToscaNodeTask): PlanTreeviewItem {\r
- const item = new PlanTreeviewItem(node.name, `[${node.id}]`, [], false);\r
- item.children.push(this.createStatusCodeTreeViewItem(node.id));\r
- const responseItem = this.createResponseTreeViewItem(node.id);\r
- item.children.push(responseItem);\r
-\r
- node.output.map(param =>\r
- responseItem.children.push(new PlanTreeviewItem(param.name, `${responseItem.value}.[${param.name}]`, [])));\r
- return item;\r
- }\r
-\r
- private loadOutput4RestTask(node: RestTask): PlanTreeviewItem {\r
- const item = new PlanTreeviewItem(node.name, `[${node.id}]`, [], false);\r
- item.children.push(this.createStatusCodeTreeViewItem(node.id));\r
-\r
- if (node.responses.length !== 0) { // load rest responses\r
- const responseItem = this.createResponseTreeViewItem(node.id);\r
- item.children.push(responseItem);\r
- // todo: should list all available response or only the first one?\r
- if (node.responses[0]) {\r
- const swagger = this.restService.getSwaggerInfo(node.restConfigId);\r
- const SwaggerReferenceObject = node.responses[0].schema as SwaggerReferenceObject;\r
- const swaggerDefinition = this.restService.getDefinition(swagger, SwaggerReferenceObject.$ref);\r
- this.loadParamsBySwaggerDefinition(responseItem, swagger, swaggerDefinition);\r
- }\r
- }\r
-\r
- return item;\r
- }\r
-\r
- private loadParamsBySwaggerDefinition(parentItem: PlanTreeviewItem, swagger: Swagger, definition: any) {\r
- Object.getOwnPropertyNames(definition.properties).map(key => {\r
- const property = definition.properties[key];\r
- const value = `${parentItem.value}.[${key}]`;\r
- const propertyItem = new PlanTreeviewItem(key, value, []);\r
- parentItem.children.push(propertyItem);\r
-\r
- // reference to swagger.ts function getSchemaObject()\r
- if (property instanceof SwaggerReferenceObject) {\r
- // handle reference parameter.\r
- const propertyDefinition = this.restService.getDefinition(swagger, property.$ref);\r
- this.loadParamsBySwaggerDefinition(propertyItem, swagger, propertyDefinition);\r
- } else if (property instanceof SwaggerModelSimple) {\r
- // handle object parameter.\r
- this.loadParamsBySwaggerDefinition(propertyItem, swagger, property);\r
- } else {\r
- // skip\r
- }\r
-\r
- return propertyItem;\r
- });\r
- }\r
-\r
- private createStatusCodeTreeViewItem(nodeId: string): PlanTreeviewItem {\r
- return new PlanTreeviewItem('statusCode', `[${nodeId}].[statusCode]`, []);\r
- }\r
-\r
- private createResponseTreeViewItem(nodeId: string): PlanTreeviewItem {\r
- return new PlanTreeviewItem('response', `[${nodeId}].[responseBody]`, []);\r
- }\r
-\r
- public getPreNodes(nodeId: string, nodeMap: Map<string, WorkflowNode>, preNodes: WorkflowNode[]) {\r
- const preNode4CurrentNode = [];\r
- nodeMap.forEach(node => {\r
- if (this.isPreNode(node, nodeId)) {\r
- const existNode = preNodes.find(tmpNode => tmpNode.id === node.id);\r
- if (existNode) {\r
- // current node already exists. this could avoid loop circle.\r
- } else {\r
- preNode4CurrentNode.push(node);\r
- preNodes.push(node);\r
- }\r
- }\r
- });\r
-\r
- preNode4CurrentNode.forEach(node => this.getPreNodes(node.id, nodeMap, preNodes));\r
- }\r
-\r
- public isPreNode(preNode: WorkflowNode, id: string): boolean {\r
- const targetNode = preNode.connection.find(connection => connection.targetRef === id);\r
- return targetNode !== undefined;\r
- }\r
-\r
- public save() {\r
- console.log('****************** save data *********************');\r
- console.log(this.planModel);\r
-\r
- this.broadcastService.broadcast(this.broadcastService.saveEvent, this.planModel);\r
- }\r
-\r
- private createId() {\r
- const nodeMap = this.getNodeMap();\r
-\r
- for (let i = 0; i < nodeMap.size; i++) {\r
- const key = 'node' + i;\r
- if (!nodeMap.get(key)) {\r
- return key;\r
- }\r
- }\r
-\r
- return 'node' + nodeMap.size;\r
- }\r
-}\r
+/**
+ * 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 { Injectable } from '@angular/core';
+import { isNullOrUndefined } from 'util';
+
+import { PlanModel } from '../model/plan-model';
+import { PlanTreeviewItem } from '../model/plan-treeview-item';
+import { RestConfig } from '../model/rest-config';
+import { Swagger, SwaggerModel, SwaggerModelSimple, SwaggerPrimitiveObject, SwaggerReferenceObject } from '../model/swagger';
+import { ErrorEvent } from '../model/workflow/error-event';
+import { IntermediateCatchEvent } from '../model/workflow/intermediate-catch-event';
+import { NodeType } from '../model/workflow/node-type.enum';
+import { Parameter } from '../model/workflow/parameter';
+import { Position } from '../model/workflow/position';
+import { RestTask } from '../model/workflow/rest-task';
+import { SequenceFlow } from '../model/workflow/sequence-flow';
+import { StartEvent } from '../model/workflow/start-event';
+import { SubProcess } from '../model/workflow/sub-process';
+import { ToscaNodeTask } from '../model/workflow/tosca-node-task';
+import { WorkflowNode } from '../model/workflow/workflow-node';
+import { NodeTemplate } from '../model/topology/node-template';
+import { ValueSource } from '../model/value-source.enum';
+import { BroadcastService } from './broadcast.service';
+import { RestService } from './rest.service';
+import { SwaggerTreeConverterService } from './swagger-tree-converter.service';
+import { ScriptTask } from "../model/workflow/script-task";
+import { TimerEventDefinition, TimerEventDefinitionType } from "../model/workflow/timer-event-definition";
+
+/**
+ * ModelService
+ * provides all operations about plan model.
+ */
+@Injectable()
+export class ModelService {
+ public rootNodeId = 'root';
+
+ private planModel: PlanModel = new PlanModel();
+
+ constructor(private broadcastService: BroadcastService, private restService: RestService) {
+ this.broadcastService.planModel$.subscribe(plan => {
+ plan.nodes.forEach(node => {
+ switch (node.type) {
+ case NodeType[NodeType.startEvent]:
+ node.position.width = 56;
+ node.position.height = 56;
+ break;
+ case NodeType[NodeType.endEvent]:
+ node.position.width = 56;
+ node.position.height = 56;
+ break;
+ case NodeType[NodeType.restTask]:
+ node.position.width = 56;
+ node.position.height = 56;
+ break;
+ case NodeType[NodeType.errorStartEvent]:
+ case NodeType[NodeType.errorEndEvent]:
+ node.position.width = 26;
+ node.position.height = 26;
+ break;
+ case NodeType[NodeType.toscaNodeManagementTask]:
+ node.position.width = 56;
+ node.position.height = 56;
+ break;
+ case NodeType[NodeType.subProcess]:
+ node.position.width = 56;
+ node.position.height = 56;
+ break;
+ case NodeType[NodeType.intermediateCatchEvent]:
+ node.position.width = 56;
+ node.position.height = 56;
+ break;
+ case NodeType[NodeType.scriptTask]:
+ node.position.width = 56;
+ node.position.height = 56;
+ break;
+ case NodeType[NodeType.exclusiveGateway]:
+ case NodeType[NodeType.parallelGateway]:
+ node.position.width = 26;
+ node.position.height = 26;
+ break;
+ default:
+ node.position.width = 56;
+ node.position.height = 56;
+ break;
+ }
+ });
+ this.planModel = plan;
+ });
+ this.broadcastService.updateModelRestConfig$.subscribe(restConfigs => {
+ this.updateRestConfig(restConfigs);
+ });
+ }
+
+ public getChildrenNodes(parentId: string): WorkflowNode[] {
+ if (!parentId || parentId === this.rootNodeId) {
+ return this.planModel.nodes;
+ } else {
+ const node = this.getNodeMap().get(parentId);
+ if (node.type === 'subProcess') {
+ return (<SubProcess>node).children;
+ } else {
+ return [];
+ }
+ }
+ }
+
+ public getNodes(): WorkflowNode[] {
+ return this.planModel.nodes;
+ }
+
+ public getSequenceFlow(sourceRef: string, targetRef: string): SequenceFlow {
+ const node = this.getNodeMap().get(sourceRef);
+ if (node) {
+ const sequenceFlow = node.connection.find(tmp => tmp.targetRef === targetRef);
+ return sequenceFlow;
+ } else {
+ return null;
+ }
+ }
+
+ public addNode(name: string, type: string, left: number, top: number) {
+ const id = this.createId();
+ const workflowPos = new Position(left, top);
+ const node = this.createNodeByType(id, name, type, workflowPos);
+ this.planModel.nodes.push(node);
+ }
+
+ private createNodeByType(id: string, name: string, type: string, position: Position): WorkflowNode {
+ const bigPosition = new Position(position.left, position.top, 56, 56);
+ const smallPosition = new Position(position.left, position.top, 26, 26);
+ switch (type) {
+ case NodeType[NodeType.startEvent]:
+ let startEventNode: StartEvent = {
+ id: id, type: type, name: name, parentId: this.rootNodeId,
+ position: bigPosition, connection: [], parameters: []
+ };
+ return startEventNode;
+ case NodeType[NodeType.endEvent]:
+ let endEventNode: WorkflowNode = {
+ id: id, type: type, name: name, parentId: this.rootNodeId,
+ position: bigPosition, connection: []
+ };
+ return endEventNode;
+ case NodeType[NodeType.restTask]:
+ let restTaskNode: RestTask = {
+ id: id, type: type, name: name, parentId: this.rootNodeId,
+ position: bigPosition, connection: [], produces: [], consumes: [], parameters: [], responses: []
+ };
+ return restTaskNode;
+ case NodeType[NodeType.errorStartEvent]:
+ case NodeType[NodeType.errorEndEvent]:
+ let errorEventNode: ErrorEvent = {
+ id: id, type: type, name: '', parentId: this.rootNodeId,
+ position: smallPosition, connection: [], parameter: new Parameter('errorRef', '', ValueSource[ValueSource.String])
+ };
+ return errorEventNode;
+ case NodeType[NodeType.toscaNodeManagementTask]:
+ let toscaNodeTask: ToscaNodeTask = {
+ id: id, type: type, name: name, parentId: this.rootNodeId,
+ position: bigPosition, connection: [], input: [], output: [], template: new NodeTemplate()
+ };
+ return toscaNodeTask;
+ case NodeType[NodeType.subProcess]:
+ let subProcess: SubProcess = {
+ id: id, type: type, name: name, parentId: this.rootNodeId,
+ position: bigPosition, connection: [], children: []
+ };
+ return subProcess;
+ case NodeType[NodeType.intermediateCatchEvent]:
+ let intermediateCatchEvent: IntermediateCatchEvent = {
+ id: id, type: type, name: name, parentId: this.rootNodeId,
+ position: bigPosition, connection: [], timerEventDefinition: <TimerEventDefinition>{ type: TimerEventDefinitionType[TimerEventDefinitionType.timeDuration] }
+ };
+ return intermediateCatchEvent;
+ case NodeType[NodeType.scriptTask]:
+ let scriptTask: ScriptTask = {
+ id: id, type: type, name: name, parentId: this.rootNodeId,
+ position: bigPosition, connection: [], scriptFormat: 'JavaScript'
+ };
+ return scriptTask;
+ case NodeType[NodeType.exclusiveGateway]:
+ case NodeType[NodeType.parallelGateway]:
+ let getway: WorkflowNode = {
+ id: id, type: type, name: '', parentId: this.rootNodeId,
+ position: smallPosition, connection: []
+ };
+ return getway;
+ default:
+ let node: WorkflowNode = {
+ id: id, type: type, name: name, parentId: this.rootNodeId,
+ position: bigPosition, connection: []
+ };
+ return node;
+ }
+ }
+
+ public isNode(object: any): boolean {
+ return undefined !== object.type;
+ }
+
+ // public createNodeByJson(obj: any): WorkflowNode {
+ // let node;
+ // switch (obj.type) {
+ // case NodeType[NodeType.startEvent]:
+ // node = new StartEvent(obj.name, obj.id, obj.type, this.rootNodeId, obj.position);
+ // node.parameters = obj.parameters;
+ // return node;
+ // case NodeType[NodeType.restTask]:
+ // node = new RestTask(obj.name, obj.id, obj.type, this.rootNodeId, obj.position);
+ // node.
+ // case NodeType[NodeType.errorStartEvent]:
+ // return new ErrorEvent(type, id, type, this.rootNodeId, position);
+ // case NodeType[NodeType.errorEndEvent]:
+ // return new ErrorEvent(type, id, type, this.rootNodeId, position);
+ // case NodeType[NodeType.toscaNodeManagementTask]:
+ // return new ToscaNodeTask(type, id, type, this.rootNodeId, position);
+ // case NodeType[NodeType.subProcess]:
+ // return new SubProcess(type, id, type, this.rootNodeId, position);
+ // case NodeType[NodeType.intermediateCatchEvent]:
+ // return new IntermediateCatchEvent(type, id, type, this.rootNodeId, position);
+ // case NodeType[NodeType.scriptTask]:
+ // return new ScriptTask(type, id, type, this.rootNodeId, position);
+ // default:
+ // return new WorkflowNode(type, id, type, this.rootNodeId, position);
+ // }
+ // return node;
+ // }
+
+ public changeParent(id: string, originalParentId: string, targetParentId: string) {
+ if (originalParentId === targetParentId) {
+ return;
+ }
+
+ const node: WorkflowNode = this.deleteNode(originalParentId, id);
+ node.parentId = targetParentId;
+
+ if (targetParentId) {
+ this.addChild(targetParentId, node);
+ } else {
+ this.planModel.nodes.push(node);
+ }
+ }
+
+ public updatePosition(id: string, left: number, top: number, width: number, height: number) {
+ const node = this.getNodeMap().get(id);
+ node.position.left = left;
+ node.position.top = top;
+ node.position.width = width;
+ node.position.height = height;
+ }
+
+ public updateRestConfig(restConfigs: RestConfig[]): void {
+ this.planModel.configs = { restConfigs: restConfigs };
+ // console.log(this.planModel.configs);
+ }
+
+ public getNodeMap(): Map<string, WorkflowNode> {
+ const map = new Map<string, WorkflowNode>();
+ this.toNodeMap(this.planModel.nodes, map);
+ return map;
+ }
+
+ public getAncestors(id: string): WorkflowNode[] {
+ const nodeMap = this.getNodeMap();
+ const ancestors = [];
+
+ let ancestor = nodeMap.get(id);
+ do {
+ ancestor = this.getParentNode(ancestor.id, nodeMap);
+ if (ancestor && ancestor.id !== id) {
+ ancestors.push(ancestor);
+ }
+ } while (ancestor);
+
+ return ancestors;
+ }
+
+ private getParentNode(id: string, nodeMap: Map<string, WorkflowNode>): WorkflowNode {
+ let parentNode;
+ nodeMap.forEach((node, key) => {
+ if (NodeType[NodeType.subProcess] === node.type) {
+ const childNode = (<SubProcess>node).children.find(child => child.id === id);
+ if (childNode) {
+ parentNode = node;
+ }
+ }
+
+ });
+
+ return parentNode;
+ }
+
+ public isDescendantNode(node: WorkflowNode, descendantId: string): boolean {
+ if (NodeType[NodeType.subProcess] !== node.type) {
+ return false;
+ }
+ const tmp = (<SubProcess>node).children.find(child => {
+ return child.id === descendantId || (NodeType[NodeType.subProcess] === child.type && this.isDescendantNode(<SubProcess>child, descendantId));
+ });
+
+ return tmp !== undefined;
+ }
+
+ private toNodeMap(nodes: WorkflowNode[], map: Map<string, WorkflowNode>) {
+ nodes.forEach(node => {
+ if (node.type === 'subProcess') {
+ this.toNodeMap((<SubProcess>node).children, map);
+ }
+ map.set(node.id, node);
+ });
+ }
+
+ public addConnection(sourceId: string, targetId: string) {
+ const node = this.getNodeMap().get(sourceId);
+ if (node) {
+ const index = node.connection.findIndex(sequenceFlow => sequenceFlow.targetRef === targetId);
+ if (index === -1) {
+ const sequenceFlow: SequenceFlow = { sourceRef: sourceId, targetRef: targetId };
+ node.connection.push(sequenceFlow);
+ }
+ }
+ }
+
+ public deleteConnection(sourceId: string, targetId: string) {
+ const node = this.getNodeMap().get(sourceId);
+ if (node) {
+ const index = node.connection.findIndex(sequenceFlow => sequenceFlow.targetRef === targetId);
+ if (index !== -1) {
+ node.connection.splice(index, 1);
+ }
+ }
+ }
+
+ public deleteNode(parentId: string, nodeId: string): WorkflowNode {
+ const nodeMap = this.getNodeMap();
+
+ const nodes = this.getChildrenNodes(parentId);
+
+ // delete related connections
+ nodes.forEach(node => this.deleteConnection(node.id, nodeId));
+
+ // delete current node
+ const index = nodes.findIndex(node => node.id === nodeId);
+ if (index !== -1) {
+ const node = nodes.splice(index, 1)[0];
+ node.connection = [];
+ return node;
+ }
+
+ return null;
+ }
+
+ public addChild(parentId: string, child: WorkflowNode) {
+ this.getChildrenNodes(parentId).push(child);
+ }
+
+ public deleteChild(node: SubProcess, id: string): WorkflowNode {
+ const index = node.children.findIndex(child => child.id === id);
+ if (index !== -1) {
+ const deletedNode = node.children.splice(index, 1);
+ return deletedNode[0];
+ }
+
+ return null;
+ }
+
+ public getPlanParameters(nodeId: string): PlanTreeviewItem[] {
+ const preNodeList = new Array<WorkflowNode>();
+ this.getPreNodes(nodeId, this.getNodeMap(), preNodeList);
+
+ return this.loadNodeOutputs(preNodeList);
+ }
+
+ private loadNodeOutputs(nodes: WorkflowNode[]): PlanTreeviewItem[] {
+ const params = new Array<PlanTreeviewItem>();
+ nodes.forEach(node => {
+ switch (node.type) {
+ case NodeType[NodeType.startEvent]:
+ params.push(this.loadOutput4StartEvent(<StartEvent>node));
+ break;
+ case NodeType[NodeType.toscaNodeManagementTask]:
+ params.push(this.loadOutput4ToscaNodeTask(<ToscaNodeTask>node));
+ break;
+ case NodeType[NodeType.restTask]:
+ params.push(this.loadOutput4RestTask(<RestTask>node));
+ break;
+ default:
+ break;
+ }
+ });
+
+ return params;
+ }
+
+ private loadOutput4StartEvent(node: StartEvent): PlanTreeviewItem {
+ const startItem = new PlanTreeviewItem(node.name, `[${node.id}]`, [], false);
+ node.parameters.map(param =>
+ startItem.children.push(new PlanTreeviewItem(param.name, `[${param.name}]`, [])));
+ return startItem;
+ }
+
+ private loadOutput4ToscaNodeTask(node: ToscaNodeTask): PlanTreeviewItem {
+ const item = new PlanTreeviewItem(node.name, `[${node.id}]`, [], false);
+ item.children.push(this.createStatusCodeTreeViewItem(node.id));
+ const responseItem = this.createResponseTreeViewItem(node.id);
+ item.children.push(responseItem);
+
+ node.output.map(param =>
+ responseItem.children.push(new PlanTreeviewItem(param.name, `${responseItem.value}.[${param.name}]`, [])));
+ return item;
+ }
+
+ private loadOutput4RestTask(node: RestTask): PlanTreeviewItem {
+ const item = new PlanTreeviewItem(node.name, `[${node.id}]`, [], false);
+ item.children.push(this.createStatusCodeTreeViewItem(node.id));
+
+ if (node.responses.length !== 0) { // load rest responses
+ const responseItem = this.createResponseTreeViewItem(node.id);
+ item.children.push(responseItem);
+ // todo: should list all available response or only the first one?
+ if (node.responses[0]) {
+ const swagger = this.restService.getSwaggerInfo(node.restConfigId);
+ const SwaggerReferenceObject = node.responses[0].schema as SwaggerReferenceObject;
+ const swaggerDefinition = this.restService.getDefinition(swagger, SwaggerReferenceObject.$ref);
+ this.loadParamsBySwaggerDefinition(responseItem, swagger, swaggerDefinition);
+ }
+ }
+
+ return item;
+ }
+
+ private loadParamsBySwaggerDefinition(parentItem: PlanTreeviewItem, swagger: Swagger, definition: any) {
+ Object.getOwnPropertyNames(definition.properties).map(key => {
+ const property = definition.properties[key];
+ const value = `${parentItem.value}.[${key}]`;
+ const propertyItem = new PlanTreeviewItem(key, value, []);
+ parentItem.children.push(propertyItem);
+
+ // reference to swagger.ts function getSchemaObject()
+ if (property instanceof SwaggerReferenceObject) {
+ // handle reference parameter.
+ const propertyDefinition = this.restService.getDefinition(swagger, property.$ref);
+ this.loadParamsBySwaggerDefinition(propertyItem, swagger, propertyDefinition);
+ } else if (property instanceof SwaggerModelSimple) {
+ // handle object parameter.
+ this.loadParamsBySwaggerDefinition(propertyItem, swagger, property);
+ } else {
+ // skip
+ }
+
+ return propertyItem;
+ });
+ }
+
+ private createStatusCodeTreeViewItem(nodeId: string): PlanTreeviewItem {
+ return new PlanTreeviewItem('statusCode', `[${nodeId}].[statusCode]`, []);
+ }
+
+ private createResponseTreeViewItem(nodeId: string): PlanTreeviewItem {
+ return new PlanTreeviewItem('response', `[${nodeId}].[responseBody]`, []);
+ }
+
+ public getPreNodes(nodeId: string, nodeMap: Map<string, WorkflowNode>, preNodes: WorkflowNode[]) {
+ const preNode4CurrentNode = [];
+ nodeMap.forEach(node => {
+ if (this.isPreNode(node, nodeId)) {
+ const existNode = preNodes.find(tmpNode => tmpNode.id === node.id);
+ if (existNode) {
+ // current node already exists. this could avoid loop circle.
+ } else {
+ preNode4CurrentNode.push(node);
+ preNodes.push(node);
+ }
+ }
+ });
+
+ preNode4CurrentNode.forEach(node => this.getPreNodes(node.id, nodeMap, preNodes));
+ }
+
+ public isPreNode(preNode: WorkflowNode, id: string): boolean {
+ const targetNode = preNode.connection.find(connection => connection.targetRef === id);
+ return targetNode !== undefined;
+ }
+
+ public save() {
+ console.log('****************** save data *********************');
+ console.log(this.planModel);
+
+ this.broadcastService.broadcast(this.broadcastService.saveEvent, this.planModel);
+ }
+
+ private createId() {
+ const nodeMap = this.getNodeMap();
+
+ for (let i = 0; i < nodeMap.size; i++) {
+ const key = 'node' + i;
+ if (!nodeMap.get(key)) {
+ return key;
+ }
+ }
+
+ return 'node' + nodeMap.size;
+ }
+}
export class RestService {\r
\r
private restConfigs: RestConfig[] = [];\r
- private runtimeURL = '/openoapi/catalog/v1/sys/config';\r
- private msbPublishServiceURL = '/api/msdiscover/v1/publishservicelist';\r
+ // private runtimeURL = '/openoapi/catalog/v1/sys/config';\r
+ private runtimeURL = '/api/tenant';\r
+ // private msbPublishServiceURL = '/api/msdiscover/v1/publishservicelist';\r
+ private msbPublishServiceURL = '/api/mockarray';\r
\r
constructor(private broadcastService: BroadcastService, private http: Http, private noticeService: NoticeService) {\r
this.broadcastService.planModel$.subscribe(planModel => {\r
planModel.configs.restConfigs.forEach(element => {\r
- this.restConfigs.push(element);\r
+ this.addRestConfig(element);\r
});\r
});\r
- // this.initSwaggerInfoByMSB();\r
+ this.initSwaggerInfoByMSB();\r
}\r
\r
- public addRestConfig(): RestConfig {\r
- let index = 0;\r
- this.restConfigs.forEach(config => {\r
- const currentId = parseInt(config.id);\r
- if (currentId > index) {\r
- index = currentId;\r
- }\r
+ public addRestConfig(config: RestConfig) {\r
+ const idSet = new Set<string>();\r
+ this.restConfigs.forEach(rc => {\r
+ idSet.add(rc.id);\r
});\r
\r
- index += 1;\r
+ if(idSet.has(config.id)) {\r
+ return false;\r
+ } else {\r
+ this.restConfigs.push(config);\r
+ return true;\r
+ }\r
+ }\r
\r
- const restConfig = new RestConfig(index.toString(), 'new Config', '', '', '');\r
- this.restConfigs.push(restConfig);\r
+ public newRestConfig(): RestConfig {\r
+ const idSet = new Set<string>();\r
+ this.restConfigs.forEach(rc => {\r
+ idSet.add(rc.id);\r
+ });\r
\r
+ let index = 0;\r
+ for(; index <= idSet.size; index++) {\r
+ if(!idSet.has(index + '')) {\r
+ break;\r
+ }\r
+ }\r
+\r
+ const restConfig = new RestConfig(index.toString(), 'new Config', '', '', '');\r
return restConfig;\r
}\r
\r
// this service don't have sawgger file.\r
if ('/activiti-rest' !== serviceInfo.publish_url) {\r
const id = serviceInfo.serviceName + '.' + serviceInfo.version;\r
- restConfigs.push(new RestConfig(id, serviceInfo.serviceName, serviceInfo.version, serviceInfo.publish_url, ''));\r
+ this.addRestConfig(new RestConfig(id, serviceInfo.serviceName, serviceInfo.version, serviceInfo.publish_url, ''));\r
let swaggerUrl = '';\r
if (undefined !== serviceInfo.swagger_url && '' !== serviceInfo.swagger_url) {\r
swaggerUrl = serviceInfo.publish_url + '/' + serviceInfo.swagger_url;\r
*/
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
-import { RadioButtonModule, SplitButtonModule, TreeModule } from 'primeng/primeng';
import { RouterModule } from '@angular/router';
+import { RadioButtonModule } from 'primeng/primeng';
+import { TreeModule } from 'primeng/primeng';
+import { SplitButtonModule } from 'primeng/primeng';
const module = [
CommonModule,
FormsModule,
- RadioButtonModule,
+ ReactiveFormsModule,
+ // HttpModule,
RouterModule,
+ RadioButtonModule,
SplitButtonModule,
- TreeModule,
+ TreeModule
];
@NgModule({
-/**\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
-export class WorkflowUtil {\r
- public static deepClone(source: any) {\r
- if (source === null || typeof source !== 'object') {\r
- return source;\r
- } else {\r
- if (source instanceof Array) {\r
- const target = [];\r
- source.forEach(item => target.push(WorkflowUtil.deepClone(item)));\r
- return target;\r
- } else {\r
- const target = {};\r
- for (const key in source) {\r
- target[key] = WorkflowUtil.deepClone(source[key]);\r
- }\r
- return target;\r
- }\r
- }\r
- }\r
-}\r
+/**
+ * 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
+ */
+export class WorkflowUtil {
+ public static deepClone(source: any) {
+ if (source === null || typeof source !== 'object') {
+ return source;
+ } else {
+ if (source instanceof Array) {
+ const target = [];
+ source.forEach(item => target.push(WorkflowUtil.deepClone(item)));
+ return target;
+ } else {
+ const target = {};
+ for (const key in source) {
+ target[key] = WorkflowUtil.deepClone(source[key]);
+ }
+ return target;
+ }
+ }
+ }
+}
-{\r
- "WORKFLOW": {\r
- "BPMN_EVENT": "Event",\r
- "BPMN_TASK": "Task",\r
- "BPMN_GETWAY": "Getway",\r
- "BPMN_STRUCTURAL": "Structural",\r
- "SETTING": "Setting",\r
- "SAVE": "Save",\r
- "TEST": "Test",\r
- "BACK": "Back",\r
- "START_EVENT": "Start",\r
- "END_EVENT": "End",\r
- "ERROR_START_EVENT": "Error Start",\r
- "ERROR_END_EVENT": "Error End",\r
- "TOSCA_TASK": "TOSCA",\r
- "REST_TASK": "REST",\r
- "SCRIPT_TASK": "SCRIPT",\r
- "TIMER_EVENT": "Timer",\r
- "EXCLUSIVE_GATEWAY": "Exclusive",\r
- "PARALLEL_GATEWAY": "Parallel",\r
- "SUB_PROCESS": "SubProcess",\r
- "NODE_NAME": "Name",\r
- "NODE_TYPE": "Type",\r
- "TOSCA_NODE": "Node",\r
- "TOSCA_INTERFACE": "Interface",\r
- "TOSCA_OPERATION": "Operation",\r
- "REST_SERVICE": "Service",\r
- "REST_PATH": "Path",\r
- "REST_METHOD": "Method",\r
- "TIMER_TYPE": "Type",\r
- "TIMER_DURATION": "Duration",\r
- "TIMER_DATE": "Date",\r
- "TIMER_CYCLE": "Cycle",\r
- "CONNECTION_NAME": "Name",\r
- "CONNECTION_SOURCE": "Source",\r
- "CONNECTION_TARGET": "Target",\r
- "CONNECTION_CONDITION": "Condition",\r
- "SCRIPT_FORMAT":"Script Format",\r
- "SCRIPT":"Script",\r
-\r
- "MSG": {\r
- "SWAGGER_NOT_EXISTS": "Swagger did not exist, please check the 'swagger.json' or service status.",\r
- "SAVE_SUCCESS": "Save successful."\r
- }\r
- }\r
-}\r
+{
+ "WORKFLOW": {
+ "BPMN_EVENT": "Event",
+ "BPMN_TASK": "Task",
+ "BPMN_GETWAY": "Getway",
+ "BPMN_STRUCTURAL": "Structural",
+ "SETTING": "Setting",
+ "SAVE": "Save",
+ "TEST": "Test",
+ "BACK": "Back",
+ "START_EVENT": "Start",
+ "END_EVENT": "End",
+ "ERROR_START_EVENT": "Error Start",
+ "ERROR_END_EVENT": "Error End",
+ "TOSCA_TASK": "TOSCA",
+ "REST_TASK": "REST",
+ "SCRIPT_TASK": "SCRIPT",
+ "TIMER_EVENT": "Timer",
+ "EXCLUSIVE_GATEWAY": "Exclusive",
+ "PARALLEL_GATEWAY": "Parallel",
+ "SUB_PROCESS": "SubProcess",
+ "NODE_NAME": "Name",
+ "NODE_TYPE": "Type",
+ "TOSCA_NODE": "Node",
+ "TOSCA_INTERFACE": "Interface",
+ "TOSCA_OPERATION": "Operation",
+ "REST_SERVICE": "Service",
+ "REST_PATH": "Path",
+ "REST_METHOD": "Method",
+ "TIMER_TYPE": "Type",
+ "TIMER_DURATION": "Duration",
+ "TIMER_DATE": "Date",
+ "TIMER_CYCLE": "Cycle",
+ "CONNECTION_NAME": "Name",
+ "CONNECTION_SOURCE": "Source",
+ "CONNECTION_TARGET": "Target",
+ "CONNECTION_CONDITION": "Condition",
+ "SCRIPT_FORMAT":"Script Format",
+ "SCRIPT":"Script",
+
+ "MSG": {
+ "SWAGGER_NOT_EXISTS": "Swagger did not exist, please check the 'swagger.json' or service status.",
+ "SAVE_SUCCESS": "Save successful."
+ }
+ }
+}
-{\r
- "WORKFLOW": {\r
- "BPMN_EVENT": "事件",\r
- "BPMN_TASK": "任务",\r
- "BPMN_GETWAY": "网关",\r
- "BPMN_STRUCTURAL": "结构",\r
- "SETTING": "设置",\r
- "SAVE": "保存",\r
- "TEST": "测试",\r
- "BACK": "返回",\r
- "START_EVENT": "开始",\r
- "END_EVENT": "结束",\r
- "ERROR_START_EVENT": "异常开始",\r
- "ERROR_END_EVENT": "异常结束",\r
- "TOSCA_TASK": "TOSCA",\r
- "REST_TASK": "REST",\r
- "SCRIPT_TASK": "脚本",\r
- "TIMER_EVENT": "定时器",\r
- "EXCLUSIVE_GATEWAY": "唯一条件",\r
- "PARALLEL_GATEWAY": "并行条件",\r
- "SUB_PROCESS": "子流程",\r
- "NODE_NAME": "名称",\r
- "NODE_TYPE": "类型",\r
- "TOSCA_NODE": "节点",\r
- "TOSCA_INTERFACE": "接口",\r
- "TOSCA_OPERATION": "方法",\r
- "REST_SERVICE": "服务",\r
- "REST_PATH": "路径",\r
- "REST_METHOD": "方法",\r
- "TIMER_TYPE": "类型",\r
- "TIMER_DURATION": "间隔",\r
- "TIMER_DATE": "固定日期",\r
- "TIMER_CYCLE": "循环日期",\r
- "CONNECTION_NAME": "名称",\r
- "CONNECTION_SOURCE": "源",\r
- "CONNECTION_TARGET": "目标",\r
- "CONNECTION_CONDITION": "条件",\r
- "SCRIPT_FORMAT":"脚本类型",\r
- "SCRIPT":"脚本",\r
-\r
- "MSG": {\r
- "SWAGGER_NOT_EXISTS": "Swagger信息不存在请检查'swagger.json'或服务状态。",\r
- "SAVE_SUCCESS": "保存成功"\r
- }\r
- }\r
-}\r
+{
+ "WORKFLOW": {
+ "BPMN_EVENT": "事件",
+ "BPMN_TASK": "任务",
+ "BPMN_GETWAY": "网关",
+ "BPMN_STRUCTURAL": "结构",
+ "SETTING": "设置",
+ "SAVE": "保存",
+ "TEST": "测试",
+ "BACK": "返回",
+ "START_EVENT": "开始",
+ "END_EVENT": "结束",
+ "ERROR_START_EVENT": "异常开始",
+ "ERROR_END_EVENT": "异常结束",
+ "TOSCA_TASK": "TOSCA",
+ "REST_TASK": "REST",
+ "SCRIPT_TASK": "脚本",
+ "TIMER_EVENT": "定时器",
+ "EXCLUSIVE_GATEWAY": "唯一条件",
+ "PARALLEL_GATEWAY": "并行条件",
+ "SUB_PROCESS": "子流程",
+ "NODE_NAME": "名称",
+ "NODE_TYPE": "类型",
+ "TOSCA_NODE": "节点",
+ "TOSCA_INTERFACE": "接口",
+ "TOSCA_OPERATION": "方法",
+ "REST_SERVICE": "服务",
+ "REST_PATH": "路径",
+ "REST_METHOD": "方法",
+ "TIMER_TYPE": "类型",
+ "TIMER_DURATION": "间隔",
+ "TIMER_DATE": "固定日期",
+ "TIMER_CYCLE": "循环日期",
+ "CONNECTION_NAME": "名称",
+ "CONNECTION_SOURCE": "源",
+ "CONNECTION_TARGET": "目标",
+ "CONNECTION_CONDITION": "条件",
+ "SCRIPT_FORMAT":"脚本类型",
+ "SCRIPT":"脚本",
+
+ "MSG": {
+ "SWAGGER_NOT_EXISTS": "Swagger信息不存在请检查'swagger.json'或服务状态。",
+ "SAVE_SUCCESS": "保存成功"
+ }
+ }
+}
width: 160px;
}
-/*IE¹ö¶¯ÌõÉèÖÃ*/
+/*IE滚动条设置*/
body{
- /*Èý½Ç¼ýÍ·µÄÑÕÉ«*/
+ /*三角箭头的颜色*/
scrollbar-arrow-color: #00abff;
- /*¹ö¶¯Ìõ»¬¿é°´Å¥µÄÑÕÉ«*/
+ /*滚动条滑块按钮的颜色*/
scrollbar-face-color: #00abff;
- /*¹ö¶¯ÌõÕûÌåÑÕÉ«*/
+ /*滚动条整体颜色*/
scrollbar-highlight-color: transparent;
- /*¹ö¶¯ÌõÒõÓ°*/
+ /*滚动条阴影*/
scrollbar-shadow-color: #000;
- /*¹ö¶¯Ìõ¹ìµÀÑÕÉ«*/
+ /*滚动条轨道颜色*/
scrollbar-track-color: transparent;
}
-/*Chrome¹ö¶¯ÌõÉèÖÃ*/
-/*¹ö¶¯ÌõÕûÌ岿·Ö,±ØÐëÒªÉèÖÃ*/
+/*Chrome滚动条设置*/
+/*滚动条整体部分,必须要设置*/
::-webkit-scrollbar
{
width: 4px;
margin-right: 2px;
}
-/*¹ö¶¯ÌõµÄ¹ìµÀ*/
+/*滚动条的轨道*/
::-webkit-scrollbar-track
{
border-radius: 2px;
background-color: transparent;
}
-/*¹ö¶¯ÌõµÄ»¬¿é°´Å¥*/
+/*滚动条的滑块按钮*/
::-webkit-scrollbar-thumb{
border-radius: 2px;
background-color: #00abff;
}
-/*¹ö¶¯ÌõµÄÉÏÏÂÁ½¶ËµÄ°´Å¥*/
+/*滚动条的上下两端的按钮*/
::-webkit-scrollbar-button{
width: 0;
height: 0;