Repository navigation
fix(drd): always export a name for DRG elements - #1061
Open
EnesKartal wants to merge 1 commit into
Open
EnesKartal wants to merge 1 commit into
EnesKartal wants to merge 1 commit into
Conversation
The DMN schema requires a name on decisions, business knowledge models, input data, knowledge sources and decision services. Elements created from the palette or context pad had no name until one was typed in, and erasing a name removed the attribute again, so the exported XML failed schema validation. Create these elements with an empty name, and keep an empty name when the label is erased. Closes bpmn-io#1057
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Closes #1057
The DMN 1.3 schema requires
nameon every DRG element. A decision, business knowledge model, input data or knowledge source created from the palette or context pad had nonameuntil the user typed one, and erasing a name with direct editing removed the attribute again. The exported XML then failed XSD validation (Attribute 'name' must appear on element 'decision').This change:
name=""inElementFactorywhen the new business object has no name. The default variable thatCreateShapeBehavioradds to decisions and input data takes this name, so it getsname=""too.name=""when a name is erased insetLabel, instead of removing the attribute. As suggested in the issue, an empty name is the default even after the name is erased.Text annotations are not changed.
Test plan
ElementFactorySpeccases: the four element types are created withname === '', and a given name is kept.LabelEditingProviderSpec > should remove label: it now expects''where it expected the attribute to be removed.Before the fix (targeted specs):
After the fix, the full
dmn-js-drdsuite passes (# tests 471,✗ fail 0), andeslintpasses on the changed files.Steps to try out: in the DRD modeler, add a decision from the palette, close direct editing without typing, then export. The decision and its variable now have
name="".Checklist
Ensure you provide everything we need to review your contribution:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool