OCLInvalid Error [message #658697] |
Wed, 09 March 2011 08:56  |
Eclipse User |
|
|
|
Hello every body here,
I have just a question , you can note it from the two Ocl expressions:
First One:
Association.allInstances()-> select(asso:Association|(asso.name.substring(1,9)='DR!{Hamad ') )
Results:
<<evlvAddDomainAssociation, evlvRenamedAssociation>> <Association> DR!{Hamada, Ramada}HO!{Hima, barhoom}
the second one:
Association.allInstances()-> select(asso:Association|(asso.name.substring(1,(10))='DR!{Ha mada') )
Results:
OclInvalid
The question is what is the problem with there in the second OCL constraint?
best regards to all of you.
|
|
|
|
|
|
Re: OCLInvalid Error [message #658764 is a reply to message #658762] |
Wed, 09 March 2011 12:35   |
Eclipse User |
|
|
|
Hello All,
Thanks for the reply ,
but I still have the same problem, whenever I use number >9 it gives me the same invalid .
Association.allInstances()-> select(asso:Association|(asso.name.substring(1,9)='DR!{Hamad ') )
Results:
<<evlvAddDomainAssociation, evlvRenamedAssociation>> <Association> DR!{Hamada, Ramada}HO!{Hima, barhoom}
the second one:
Association.allInstances()-> select(asso:Association|(asso.name.substring(1,10)='DR!{Hama da, Ramada}HO!{Hima') )
Results:
OclInvalid
So what is the problem now,? do not care about the blank , it occurs just here in this text ,
Thanx for your help,
Regards
|
|
|
Re: OCLInvalid Error [message #658768 is a reply to message #658764] |
Wed, 09 March 2011 12:50   |
Eclipse User |
|
|
|
Hi
Note that the substring selection is within a select, so if ANY
Association has less than 9/10 charcters you will get invalid.
Regards
Ed Willink
On 09/03/2011 17:35, Hussam wrote:
> Hello All,
> Thanks for the reply ,
>
>
> but I still have the same problem, whenever I use number >9 it gives
> me the same invalid .
>
> Association.allInstances()->
> select(asso:Association|(asso.name.substring(1,9)='DR!{Hamad ') )
>
>
> Results:
> <<evlvAddDomainAssociation, evlvRenamedAssociation>> <Association>
> DR!{Hamada, Ramada}HO!{Hima, barhoom}
>
>
> the second one:
>
> Association.allInstances()->
> select(asso:Association|(asso.name.substring(1,10)='DR!{Hama da,
> Ramada}HO!{Hima') )
>
>
> Results:
> OclInvalid
>
>
> So what is the problem now,? do not care about the blank , it occurs
> just here in this text ,
> Thanx for your help,
>
> Regards
|
|
|
|
Re: OCLInvalid Error [message #658782 is a reply to message #658771] |
Wed, 09 March 2011 13:32  |
Eclipse User |
|
|
|
Hi Hussam
In the same way as Java.
Guard an access to an invalid index with a bounds check.
Regards
Ed Willink
On 09/03/2011 18:16, Hussam wrote:
> Thanx ED Willink,
>
> I think you got what I want to do,
>
> I need to query some association according to substring, how to do
> that out of the select statement?
>
> Regards
|
|
|
Powered by
FUDForum. Page generated in 0.69318 seconds