Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional XmlRule that doesn't break the transformation #141

Closed
geirolz opened this issue Dec 3, 2020 · 0 comments
Closed

Optional XmlRule that doesn't break the transformation #141

geirolz opened this issue Dec 3, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request nice to have Feature proposal nice to have
Milestone

Comments

@geirolz
Copy link
Owner

geirolz commented Dec 3, 2020

AS user
IW to define an XmlRule that doesn't break the transformation process if target is missing or if it fails
SO we can create a system to define mandatory or not an XmlRule.

We can define a new type OptionalXmlRule and creare an hierarchy with sealed trait BaseXmlRule. Current type XmlRule will inherit from BaseXmlRule and it will mantain his name even if a better name should be MandatoryXmlRule, maybe we can use a type alias.

At this point transformer engine will process all rules pattern matching hover them following the right behavior.

API Syntax proposal

sealed trait BaseXmlRule
case class MandatoryXmlRule extends BaseXmlRule
case class OptionalXmlRule extends BaseXmlRule

type XmlRule = MandatoryXmlRule

val xmlrule : XmlRule = root.missing.node => Append(<foo />)
val optXmlRule : OptionalXmlRule = rule.optional
val mandatoryXmlRule : MandatoryXmlRule = optXmlRule.mandatory
@geirolz geirolz added enhancement New feature or request nice to have Feature proposal nice to have labels Dec 3, 2020
@geirolz geirolz added this to the v2.4.0 milestone Dec 3, 2020
@geirolz geirolz self-assigned this May 6, 2021
geirolz added a commit that referenced this issue May 12, 2021
Fix #141 Optional XmlRule that doesn't break the transformation
geirolz added a commit that referenced this issue May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nice to have Feature proposal nice to have
Projects
None yet
Development

No branches or pull requests

1 participant