Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fvilla committed Dec 5, 2024
1 parent 60884be commit fa0b35c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public class ObservableBuilder implements Observable.Builder {
// withDeclaration() and the
// builder is merely building it.
private boolean declarationIsComplete = false;
private String urn;

// marks the observable to build as dereifying for a resolution of inherents TODO check if this is
// still relevant
Expand Down Expand Up @@ -178,7 +179,7 @@ public ObservableBuilder(ObservableBuilder other) {
this.caused = other.caused;
this.comparison = other.comparison;
this.compresent = other.compresent;
// this.context = other.context;
this.urn = other.urn;
this.inherent = other.inherent;
this.cooccurrent = other.cooccurrent;
this.goal = other.goal;
Expand Down Expand Up @@ -208,6 +209,7 @@ public ObservableBuilder(ObservableBuilder other) {
public ObservableBuilder withDeclaration(KimConcept declaration) {
this.declaration = (KimConceptImpl) declaration;
this.declarationIsComplete = true;
this.urn = declaration.getUrn();
return this;
}

Expand Down Expand Up @@ -797,6 +799,7 @@ public Concept buildConcept() throws KlabValidationException {
// finalize the concept by recomputing its URN
if (declaration instanceof KimConceptImpl impl) {
impl.finalizeDefinition();
this.urn = impl.getUrn();
}

// if (scope.hasErrors()) {
Expand Down Expand Up @@ -1448,6 +1451,11 @@ public Observable build() throws KlabValidationException {
ret.setDescriptionType(this.descriptionType);
}

if (this.urn != null) {
// override the precomputed URN
ret.setUrn(this.urn);
}

return ret;
}

Expand Down

0 comments on commit fa0b35c

Please sign in to comment.