Skip to content

Possibility to indicate a slot cannot have a value/cannot exist based on constraint #2312

Answered by pkalita-lbl
stanleyj-edsn asked this question in Q&A
Discussion options

You must be logged in to vote

A combination of rules on a class definition and value_presence might work for you. Something like this:

classes:
  MyClass:
    slots:
      - attribute_a
      - attribute_b
    rules:
      - description: no attribute_b if attribute_a is foo
        preconditions:
          slot_conditions:
            attribute_a:
              equals_string: foo
        postconditions:
          slot_conditions:
            attribute_b:
              value_presence: ABSENT

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stanleyj-edsn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants