How to initialize the attributes of variables in an OCL query [message #758458] |
Wed, 23 November 2011 06:00  |
Eclipse User |
|
|
|
Hi,
I wrote an OCL query in which there are two variables:
Patient.allInstances()->select(pat : Patient |
pat.genderCode.code = sex.code
and pat.observations->select(obs : Observation | obs.code.code = 'width'
and obs.value.oclIsTypeOf(ISODatatypes::PQ))->exists(obs : Observation |
obs.value.oclAsType(ISODatatypes::PQ).greaterOrEqual(width).value))->size()
Variables are:
sex type of CD
width type of PQ
I can write an XMI file which proves that the syntax and semantic are correct.
Now I'd like to initialize the attributes of these variables (sex, width) with values but I do not know if it's possible and if so how?
Thank you in advance.
|
|
|
Re: How to initialize the attributes of variables in an OCL query [message #758566 is a reply to message #758458] |
Wed, 23 November 2011 12:25  |
Eclipse User |
|
|
|
Hi
There are no uninitialized variables in OCL.
It seems that your variables are parameters of a query in which case
they are bound by the query invocation.
I'm not clear what technology you use for a 'query', I'm really puzzled
by the reference to XMI, so I'll just resort to a Java analogy, where in
int aQuery(sex CD, width PQ)
sex and width are 'initialised' by the invocation
aQuery(someSex, aWidth);
Regards
Ed Willink
On 23/11/2011 11:00, david.ouagne wrote:
> Hi,
>
> I wrote an OCL query in which there are two variables:
>
>
> Patient.allInstances()->select(pat : Patient |
> pat.genderCode.code = sex.code and
> pat.observations->select(obs : Observation | obs.code.code = 'width'
> and obs.value.oclIsTypeOf(ISODatatypes::PQ))->exists(obs :
> Observation |
> obs.value.oclAsType(ISODatatypes::PQ).greaterOrEqual(width).value))->size()
>
>
> Variables are:
>
> sex type of CD
> width type of PQ
>
> I can write an XMI file which proves that the syntax and semantic are
> correct.
>
> Now I'd like to initialize the attributes of these variables (sex,
> width) with values but I do not know if it's possible and if so how?
>
> Thank you in advance.
|
|
|
Powered by
FUDForum. Page generated in 0.21191 seconds