import { WorkflowProcessService } from "./workflow-process.service";\r
import { BroadcastService } from "./broadcast.service";\r
import { Subscription } from 'rxjs/Subscription';\r
+import { WorkflowNode } from "../model/workflow/workflow-node";\r
\r
/**\r
* JsPlumbService\r
\r
}\r
\r
+ public connectNodes() {\r
+ const nodes: WorkflowNode[] = this.processService.getProcess();\r
+ nodes.forEach(node => this.connect4OneNode(node));\r
+ }\r
+\r
+ public connect4OneNode(node: WorkflowNode) {\r
+ node.sequenceFlows.forEach(sequenceFlow => {\r
+ const connection = this.jsplumbInstance.connect({\r
+ source: sequenceFlow.sourceRef,\r
+ target: sequenceFlow.targetRef,\r
+ });\r
+ if (sequenceFlow.condition) {\r
+ connection.setLabel(sequenceFlow.condition);\r
+ }\r
+ });\r
+ }\r
+\r
public setLabel(sourceId: string, targetId: string, label: string) {\r
const sourceNode = this.processService.getNodeById(sourceId);\r
const connections = this.jsplumbInstance.select({ source: sourceId, target: targetId });\r