Skip to content

Commit

Permalink
feature(405222): included nodes and connectors property
Browse files Browse the repository at this point in the history
  • Loading branch information
VijayalakshmirSF4471 committed Dec 20, 2024
1 parent 365d994 commit 1fce807
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</div>
<div>
<ejs-diagram class="diagram-container" #diagram
id="diagram" [width]="'100%'" [height]="649"
[layout]="layout" [getNodeDefaults]="getNodeDefaults"
id="diagram" [width]="'100%'" [height]="649" [nodes]="nodes"
[connectors]="connectors" [layout]="layout" [getNodeDefaults]="getNodeDefaults"
[getConnectorDefaults]="getConnectorDefaults" (created)="onDiagramCreated()" [selectedItems]="selectedItems"
(onUserHandleMouseDown)="onUserHandleMouseDown($event)" (click)="onNodeClick($event)" [snapSettings]="snapSettings">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export class WorkflowDiagramComponent implements AfterViewInit {
public chatWorkflowBlockTypeEnum = ChatWorkflowBlockTypeEnum;
// public data: RuleData[] = RULE_DATA;
public data: RuleData2[] = RULE_DATA3;
public nodes: NodeModel[] = [];
public connectors: ConnectorModel[] = [];
public closeOnDocumentClick: boolean = true;
public sidebarInput: string = '';
public ddlFields: Object = { text: 'label', value: 'value' };
Expand Down Expand Up @@ -145,7 +147,8 @@ export class WorkflowDiagramComponent implements AfterViewInit {
height: 150 + (buttonCount * 25),
addInfo: item
};
this.diagram.addNode(nodedata);
this.nodes.push(nodedata);
// this.diagram.addNode(nodedata);

// Create connectors from success_rule_id
if (item['successRuleId']) {
Expand All @@ -155,7 +158,8 @@ export class WorkflowDiagramComponent implements AfterViewInit {
targetID: `node${item['successRuleId']}`,
// annotations: [{ content: 'success', alignment: 'Center'}]
};
this.diagram.addConnector(connectorData);
this.connectors.push(connectorData);
// this.diagram.addConnector(connectorData);
}
// if (item.branchDetails) {
// item.branchDetails.forEach(branch: any => {
Expand All @@ -170,6 +174,7 @@ export class WorkflowDiagramComponent implements AfterViewInit {
// });
// }
});
this.diagram.refresh();
}

public onDiagramCreated(): void {
Expand Down

0 comments on commit 1fce807

Please sign in to comment.