Later versions of the GELLO editor improve the writability of code when getting a casted value from an observation, and also when as part of that process applying an existence test.

Methods like .asCD() replace .value.oclAsType(CD) and .oclIfUndefined()  replace extra lines of code. This is particularly useful when using the GELLO within archetypes.


For example this:

Let tumourSite: CD= If template.Examples.Tumour_site
                                     .value.oclAsType(CD).oclIsDefined() 
                                        then  
                           template.Examples.Tumour_site
                                   .value.oclAsType(CD)
                   else null endif

can be rewritten as this:

Let tumourSite: CD= template.Examples.Tumour_site.asCD().oclIfUndefined(null)



Most types have these methods now, ie asBoolean(), asString() ..