ngx-rs-ant 1.7.2 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1578,14 +1578,15 @@ class CamundaBpmnViewerComponent {
1578
1578
  constructor() {
1579
1579
  this.activeActivities = [];
1580
1580
  }
1581
- ngOnInit() {
1582
- this.viewer.importXML(this.xml).then(() => {
1583
- this.canvas.zoom('fit-viewport');
1584
- for (const activity of this.activeActivities || []) {
1585
- this.canvas.addMarker(activity, 'process-active-node');
1586
- }
1581
+ set xml(xml) {
1582
+ this._xml = xml;
1583
+ setTimeout(() => {
1584
+ this.loadXml();
1587
1585
  });
1588
1586
  }
1587
+ get xml() {
1588
+ return this._xml;
1589
+ }
1589
1590
  ngAfterViewInit() {
1590
1591
  this.viewer = new Viewer({
1591
1592
  container: this.viewerContainer.nativeElement,
@@ -1598,6 +1599,18 @@ class CamundaBpmnViewerComponent {
1598
1599
  this.viewer._container.removeChild(logo);
1599
1600
  }
1600
1601
  this.canvas = this.viewer.get('canvas');
1602
+ this.loadXml();
1603
+ }
1604
+ loadXml() {
1605
+ if (!this.xml) {
1606
+ return;
1607
+ }
1608
+ this.viewer.importXML(this.xml).then(() => {
1609
+ this.canvas.zoom('fit-viewport');
1610
+ for (const activity of this.activeActivities || []) {
1611
+ this.canvas.addMarker(activity, 'process-active-node');
1612
+ }
1613
+ });
1601
1614
  }
1602
1615
  }
1603
1616
  CamundaBpmnViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CamundaBpmnViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });