summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-09-11 17:02:30 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-09-11 17:02:30 +0800
commit68cb7b98a377b8de053817c386095006c0793569 (patch)
treedc12de11d12af8635cddab40faa0d2f7d7c59275 /sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
parentc5f5d9b03e04ee1dfea490ecabc5c4b54760d062 (diff)
add sequence flow after page refreshed
fix the issue of sequence flow error after page refresh. Issue-ID: SDC-307 Change-Id: I068ff91850fe1e917d0d896afdaa617aea0e9fee 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.ts18
1 files changed, 18 insertions, 0 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 06cb2b0f..dc1d800f 100644
--- a/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
+++ b/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
@@ -15,6 +15,7 @@ import * as jsp from 'jsplumb';
import { WorkflowProcessService } from "./workflow-process.service";
import { BroadcastService } from "./broadcast.service";
import { Subscription } from 'rxjs/Subscription';
+import { WorkflowNode } from "../model/workflow/workflow-node";
/**
* JsPlumbService
@@ -139,6 +140,23 @@ export class JsPlumbService {
}
+ public connectNodes() {
+ const nodes: WorkflowNode[] = this.processService.getProcess();
+ nodes.forEach(node => this.connect4OneNode(node));
+ }
+
+ public connect4OneNode(node: WorkflowNode) {
+ node.sequenceFlows.forEach(sequenceFlow => {
+ const connection = this.jsplumbInstance.connect({
+ source: sequenceFlow.sourceRef,
+ target: sequenceFlow.targetRef,
+ });
+ if (sequenceFlow.condition) {
+ connection.setLabel(sequenceFlow.condition);
+ }
+ });
+ }
+
public setLabel(sourceId: string, targetId: string, label: string) {
const sourceNode = this.processService.getNodeById(sourceId);
const connections = this.jsplumbInstance.select({ source: sourceId, target: targetId });