@valtimo/process-management 13.48.0 → 13.49.0

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.
@@ -21,7 +21,7 @@ import Modeler from 'bpmn-js/lib/Modeler';
21
21
  import camundaPlatformBehaviors from 'camunda-bpmn-js-behaviors/lib/camunda-platform';
22
22
  import CamundaBpmnModdle from 'camunda-bpmn-moddle/resources/camunda.json';
23
23
  import { isEqual } from 'lodash';
24
- import { filter, BehaviorSubject, Subject, Subscription, combineLatest, switchMap, of, tap, map as map$1, startWith, from, take, merge } from 'rxjs';
24
+ import { filter, BehaviorSubject, Subject, Subscription, combineLatest, switchMap, of, tap, catchError, EMPTY, map as map$1, startWith, from, take, merge } from 'rxjs';
25
25
  import { distinctUntilChanged, map, filter as filter$1 } from 'rxjs/operators';
26
26
  import * as i2$1 from '@valtimo/form';
27
27
  import { toObservable } from '@angular/core/rxjs-interop';
@@ -2290,7 +2290,11 @@ class ProcessManagementBuilderComponent {
2290
2290
  this.selectedProcessDefinitionXml$ = this.processManagementEditorService.selectionProcessDefinition$.pipe(filter(selectedProcessDefinition => !!selectedProcessDefinition?.id), distinctUntilChanged((previous, current) => isEqual(previous, current)), tap(selectedProcessDefinition => {
2291
2291
  this.loading$.next(true);
2292
2292
  this.pageTitleService.setCustomPageTitle(selectedProcessDefinition?.name || '-');
2293
- }), switchMap(selectedProcessDefinition => this.processService.getProcessDefinitionXml(selectedProcessDefinition.id)), tap(result => {
2293
+ }), switchMap(selectedProcessDefinition => this.processService.getProcessDefinitionXml(selectedProcessDefinition.id).pipe(catchError(error => {
2294
+ this.logger.error('Failed to load process definition XML', error);
2295
+ this.loading$.next(false);
2296
+ return EMPTY;
2297
+ }))), tap(result => {
2294
2298
  this.cleanUpListenersOnModeler();
2295
2299
  this._autofilledElements = result.autofilledElements ?? [];
2296
2300
  this.processManagementEditorService.setAutofilledElements(this._autofilledElements);
@@ -3324,22 +3328,13 @@ class ProcessManagementBuilderComponent {
3324
3328
  }
3325
3329
  initProcessDefinition() {
3326
3330
  this._subscriptions.add(this._selectedProcess$
3327
- .pipe(filter(selectedProcess => selectedProcess !== null && selectedProcess !== 'create'), distinctUntilChanged((previous, current) => isEqual(previous, current)), tap(() => this.loading$.next(true)))
3331
+ .pipe(filter(selectedProcess => selectedProcess !== null && selectedProcess !== 'create'), distinctUntilChanged((previous, current) => isEqual(previous, current)))
3328
3332
  .subscribe(result => {
3329
3333
  const processDefinitionResult = result;
3330
- this.cleanUpListenersOnModeler();
3331
- this._autofilledElements = processDefinitionResult.autofilledElements ?? [];
3332
- this.processManagementEditorService.setAutofilledElements(this._autofilledElements);
3333
- this._bpmnModeler?.importXML(processDefinitionResult.bpmn20Xml).then(() => {
3334
- this.highlightAutofilledElements();
3335
- });
3336
- this._bpmnViewer?.importXML(processDefinitionResult.bpmn20Xml).then(() => {
3337
- this.highlightAutofilledElements();
3338
- });
3334
+ // Diagram and loading owned by selectedProcessDefinitionXml$ — a second import re-rendered the panel
3339
3335
  this.canInitializeDocument$.next(!!processDefinitionResult?.processCaseLink?.canInitializeDocument);
3340
3336
  this.startableByUser$.next(!!processDefinitionResult?.processCaseLink?.startableByUser);
3341
3337
  this.draft$.next(!!processDefinitionResult?.draft);
3342
- this.loading$.next(false);
3343
3338
  }));
3344
3339
  }
3345
3340
  openParamsAndContextSubscription() {