Skip to content

Commit

Permalink
FIX: Use modling component from dmnjs to edit datatype of dmn input e…
Browse files Browse the repository at this point in the history
…xpression
  • Loading branch information
davidibl committed Apr 4, 2020
1 parent 5616a6b commit ca69b92
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/app/components/dmnModeller/dmnModeller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { DataModelService } from '../../services/dataModelService';
import { DmnXmlService } from '../../services/dmnXmlService';
import { EventService } from '../../services/eventService';
import { distinctUntilChanged } from 'rxjs/internal/operators/distinctUntilChanged';
import { DOCUMENT } from "@angular/common";
import { DOCUMENT } from '@angular/common';
import { DmnModelService } from '../../services/dmnModelService';
import { SaveStateService } from '../../services/saveStateService';
import { ExportService } from '../../services/exportService';
Expand Down Expand Up @@ -437,8 +437,14 @@ export class DmnModellerComponent implements AfterViewInit, OnInit {
});
this._dataModelService
.getDatatypeByPath(literalExpression.text)
.pipe(take(1), map(type => this.getDmnByJsonType(type)), filter(type => !!type))
.subscribe(value => literalExpression.typeRef = value);
.pipe(
take(1),
map(type => this.getDmnByJsonType(type)),
filter(type => !!type),
filter(type => literalExpression.typeRef !== type))
.subscribe(value =>
this._modeller.getActiveViewer().get('modeling')
.editInputExpressionTypeRef(literalExpression, value));
}

private initDrdListeners() {
Expand Down Expand Up @@ -542,7 +548,8 @@ export class DmnModellerComponent implements AfterViewInit, OnInit {
.pipe(
take(1),
map(type => this.getDmnByJsonType(type)),
filter(type => !!type)
filter(type => !!type),
filter(type => column.inputExpression.typeRef !== type)
)
.subscribe(value => {
if (column.inputExpression.typeRef === value) { return; }
Expand Down

0 comments on commit ca69b92

Please sign in to comment.