From c705c43cceafb81434d6eee4ced0da7024c9c008 Mon Sep 17 00:00:00 2001 From: Lvbo163 Date: Fri, 8 Sep 2017 11:36:53 +0800 Subject: support set condition for gateway support set condition for gateway(exclusive gateway) Issue-ID: SDC-119 Change-Id: I479ed99eb45928d90bf7361de0208eef4b113776 Signed-off-by: Lvbo163 --- .../sequence-flow/sequence-flow.component.css | 43 ++++++++++++++++ .../sequence-flow/sequence-flow.component.html | 53 ++++++++++++++++++++ .../sequence-flow/sequence-flow.component.ts | 57 ++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.css create mode 100644 sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.html create mode 100644 sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.ts (limited to 'sdc-workflow-designer-ui/src/app/components/sequence-flow') diff --git a/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.css b/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.css new file mode 100644 index 00000000..a2d481d4 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.css @@ -0,0 +1,43 @@ +/** + * 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 + */ + +.wm-sequence-flow-wrapper { + background-color: white; + position: fixed; + width: 500px; + height: 100%; + border-left: 1px solid #00aaff; + z-index: 2000; + right: 0; + top: 0; + bottom: 0; + padding-left: 20px; + margin-bottom: 0; + padding-right: 20px; + padding-top: 40px; + -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); + border-radius: 0; + overflow-y: scroll; +} + +.edit { + display: none; +} + +.editing .view { + display: none; +} + +.editing .edit { + display: block; +} diff --git a/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.html b/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.html new file mode 100644 index 00000000..3a4c6635 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.html @@ -0,0 +1,53 @@ + + +
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
diff --git a/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.ts b/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.ts new file mode 100644 index 00000000..0109e273 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/components/sequence-flow/sequence-flow.component.ts @@ -0,0 +1,57 @@ +/** + * 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 } from '@angular/core'; +import { TreeNode } from 'primeng/primeng'; + +import { SequenceFlow } from '../../model/workflow/sequence-flow'; +import { BroadcastService } from '../../services/broadcast.service'; +import { JsPlumbService } from '../../services/jsplumb.service'; +import { WorkflowProcessService } from '../../services/workflow-process.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-sequence-flow', + styleUrls: ['./sequence-flow.component.css'], + templateUrl: 'sequence-flow.component.html', +}) +export class SequenceFlowComponent implements AfterViewInit { + public sequenceFlow: SequenceFlow; + public show = false; + + constructor(private broadcastService: BroadcastService, + private processService: WorkflowProcessService, + private jsPlumbService: JsPlumbService) { + + } + + public ngAfterViewInit() { + this.broadcastService.showSequenceFlow$.subscribe(show => this.show = show); + this.broadcastService.sequenceFlow$.subscribe(tmp => this.sequenceFlow = tmp); + } + + public conditionChanged(condition: string) { + this.sequenceFlow.condition = condition; + this.jsPlumbService.setLabel(this.sequenceFlow.sourceRef, this.sequenceFlow.targetRef, condition); + } + + public delete() { + this.show = false; + + this.processService.deleteSequenceFlow(this.sequenceFlow.sourceRef, this.sequenceFlow.targetRef); + this.jsPlumbService.deleteConnect(this.sequenceFlow.sourceRef, this.sequenceFlow.targetRef); + } +} -- cgit 1.2.3-korg