OCLOperators whentrue
No edit summary
No edit summary
Line 2: Line 2:


boolean.case(dothis):boolean
boolean.case(dothis):boolean
Example:
let x=SomeObject.SomeEnum in (  
  (x=#Enum1).case(SomeObject.DoYourThing1);  
  (x=#Enum2).case(SomeObject.DoYourThing2);  
  (x=#Enum3).case(SomeObject.DoYourThing3)
)

Revision as of 10:09, 4 December 2021

This page was created by Hans.karlsen@mdriven.net on 2021-12-04. Last edited by Stephanie@mdriven.net on 2025-02-11.

When having immutable ocl expression you always return a value - and the the OCLOperators_TrueFalse is good, but when using the MDriven Action-Language that allows updates of objects another construct is introduced to compact things even more:

boolean.case(dothis):boolean

Example:

let x=SomeObject.SomeEnum in (  
  (x=#Enum1).case(SomeObject.DoYourThing1);  
  (x=#Enum2).case(SomeObject.DoYourThing2);  
  (x=#Enum3).case(SomeObject.DoYourThing3) 
)
MDriven Chat

How would you like to chat today?

Setting up your conversation…

This may take a few moments