> On 06 Oct 2015, at 11:27, Balazs Lengyel <[email protected]> wrote:
> 
> Having statements default/mandatory in the model that seem to mean something, 
> but practically have no effect is most confusing.

They do have an effect but only in some contexts:

- default on a leaf(-list) inside a case applies when the case is designated as 
default,

- mandatory applies if some nodes from that case exist.

The latter condition requires that no two cases contain data nodes of the same 
name - in your example, if "scen12-num1" is present, it is impossible to 
determine whether it comes from case A/A or B. So this should be an error.

Lada

> Balazsd
> 
> On 2015-10-06 11:24, Balazs Lengyel wrote:
>> Hello,
>> Some more corner cases for embedded choices, with my solutions in them. How 
>> an average operator or even model implementer would figure these out is 
>> anyone's guess. regards Balazs
>> 
>>           choice scen9 {
>>               case A {
>>                   choice subChoiceA {
>>                       mandatory true;        // this mandatory has 
>> absolutely no effect as the case A above might not exist
>>                       case A {
>>                           leaf scen12-num1 { type uint8; default 1; }       
>> // this default has absolutely no effect
>>                                    // if the leaf exists it has a value if 
>> you delete it the whole choice scen9 becomes empty
>>                       }
>>                       case B {
>>                           leaf scen12-num2 { type uint8; }
>>                       }
>>                   }
>>               }
>>               case B {
>>                   leaf scen12-num1 { type uint8; }
>>               }
>>           }
>> 
> 
> -- 
> Balazs Lengyel                       Ericsson Hungary Ltd.
> Senior Specialist
> ECN: 831 7320
> Mobile: +36-70-330-7909              email: [email protected]
> 
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C




_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to