diff options
author | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-08 11:36:53 +0800 |
---|---|---|
committer | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-08 11:36:53 +0800 |
commit | c705c43cceafb81434d6eee4ced0da7024c9c008 (patch) | |
tree | 5afe3ee47e876590abdd8c4ee1af8d1afeb1be3f /sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts | |
parent | 18b2330786d193afd150bf20e4054d965259de3a (diff) |
support set condition for gateway
support set condition for gateway(exclusive gateway)
Issue-ID: SDC-119
Change-Id: I479ed99eb45928d90bf7361de0208eef4b113776
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts')
-rw-r--r-- | sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts b/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts index 543b09f3..e4a9f38b 100644 --- a/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts +++ b/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts @@ -13,6 +13,7 @@ import { Injectable } from '@angular/core';
import * as jsp from 'jsplumb';
import { WorkflowProcessService } from "./workflow-process.service";
+import { BroadcastService } from "./broadcast.service";
/**
* JsPlumbService
@@ -22,7 +23,7 @@ import { WorkflowProcessService } from "./workflow-process.service"; export class JsPlumbService {
public jsplumbInstance;
- constructor(private processService: WorkflowProcessService) {
+ constructor(private processService: WorkflowProcessService, private broadcastService: BroadcastService) {
this.initJsPlumbInstance();
}
@@ -60,9 +61,15 @@ export class JsPlumbService { this.jsplumbInstance.bind('connection', info => {
this.processService.addSequenceFlow(info.connection.sourceId, info.connection.targetId);
- info.connection.bind('click', connection => {
- this.jsplumbInstance.select({ connections: [connection] }).delete();
- this.processService.deleteSequenceFlow(connection.sourceId, connection.targetId);
+ // info.connection.bind('click', connection => {
+ // this.jsplumbInstance.select({ connections: [connection] }).delete();
+ // this.processService.deleteSequenceFlow(connection.sourceId, connection.targetId);
+ // });
+
+ info.connection.bind('dblclick', connection => {
+ const sequenceFlow = this.processService.getSequenceFlow(connection.sourceId, connection.targetId);
+ this.broadcastService.broadcast(this.broadcastService.sequenceFlow, sequenceFlow);
+ this.broadcastService.broadcast(this.broadcastService.showSequenceFlow, true);
});
});
@@ -93,6 +100,18 @@ export class JsPlumbService { }
+ public setLabel(sourceId: string, targetId: string, label: string) {
+ const sourceNode = this.processService.getNodeById(sourceId);
+ const connections = this.jsplumbInstance.select({ source: sourceId, target: targetId });
+ connections.setLabel(label);
+ }
+
+ public deleteConnect(sourceId: string, targetId: string) {
+ const sourceNode = this.processService.getNodeById(sourceId);
+ const connectionSelection = this.jsplumbInstance.select({ source: sourceId, target: targetId });
+ connectionSelection.delete();
+ }
+
public remove(nodeId: string) {
this.jsplumbInstance.remove(nodeId);
}
|