Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » ocl strange behavior!
ocl strange behavior! [message #1088318] Fri, 16 August 2013 23:01 Go to next message
sohaib soso is currently offline sohaib sosoFriend
Messages: 33
Registered: March 2012
Member
Hi,
I want to perform an OCL check on a java model programmatically. I am using
IQueryResult to execute my query statement. Everything was working fine but
now I am facing umpredictable behavior and what was working before isn't
working anymore.
For example, the evaluation of the following query statement does not give
the correct result:
........
self.oclAsType(class).members->select(ocl expression)............
......
the same when I use "for loop statement":
Sequence{1..n}->any(ocl expression)
or
....
Sequence{1..n}->select(ocl expression)
.....
this is weird because in my ocl query statements, the part before
operations on collections such as (select() and any()) is evaluated and
gives exactlly
what I am expecting. Before the "x event", the evaluation was performed as
expected, but now I don't know what happened!Does anyone know what is the
problem and why collection's ocl opertions aren't working!?. Thanks in
advance.
Regards,
Chadi
Re: ocl strange behavior! [message #1089379 is a reply to message #1088318] Sun, 18 August 2013 16:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Since it was working and is no longer, you have probably done something
stupid, which is very unlikely to be diagnoseable from the minute hints
that you have given. You need to examine what changed, perhaps going
back to what was working, then progressing forward in smaller steps.

Regards

Ed Willink


On 17/08/2013 00:01, Sohaib wrote:
> Hi,
> I want to perform an OCL check on a java model programmatically. I am
> using IQueryResult to execute my query statement. Everything was
> working fine but now I am facing umpredictable behavior and what was
> working before isn't working anymore.
> For example, the evaluation of the following query statement does not
> give the correct result:
> ........
> self.oclAsType(class).members->select(ocl expression)............
> ......
> the same when I use "for loop statement":
> Sequence{1..n}->any(ocl expression)
> or
> ....
> Sequence{1..n}->select(ocl expression)
> .....
> this is weird because in my ocl query statements, the part before
> operations on collections such as (select() and any()) is evaluated
> and gives exactlly
> what I am expecting. Before the "x event", the evaluation was
> performed as expected, but now I don't know what happened!Does anyone
> know what is the problem and why collection's ocl opertions aren't
> working!?. Thanks in advance.
> Regards,
> Chadi
Re: ocl strange behavior! [message #1090911 is a reply to message #1089379] Tue, 20 August 2013 20:37 Go to previous messageGo to next message
sohaib soso is currently offline sohaib sosoFriend
Messages: 33
Registered: March 2012
Member
Hi

I examined my query statement and, as I said before, some parts that used to
work before ain't working although I haven't changed anything. this is a
part from my query (returns substring. example: List[] gives List):
I tried:
"_string.substring(1,4) " works
"_string.substring(1,(Sequence{1..6}->select(c|c=5)->first())-1) " fails
"_string.substring(1,(Sequence{1..6}->any(c|c=5))-1) " fails
"_string.substring(1,(Sequence{1..6}->size())-2) " works

Regards
Chadi

Hi

Since it was working and is no longer, you have probably done something
stupid, which is very unlikely to be diagnoseable from the minute hints
that you have given. You need to examine what changed, perhaps going
back to what was working, then progressing forward in smaller steps.

Regards

Ed Willink


On 17/08/2013 00:01, Sohaib wrote:
> Hi,
> I want to perform an OCL check on a java model programmatically. I am
> using IQueryResult to execute my query statement. Everything was working
> fine but now I am facing umpredictable behavior and what was working
> before isn't working anymore.
> For example, the evaluation of the following query statement does not give
> the correct result:
> ........
> self.oclAsType(class).members->select(ocl expression)............
> ......
> the same when I use "for loop statement":
> Sequence{1..n}->any(ocl expression)
> or
> ....
> Sequence{1..n}->select(ocl expression)
> .....
> this is weird because in my ocl query statements, the part before
> operations on collections such as (select() and any()) is evaluated and
> gives exactlly
> what I am expecting. Before the "x event", the evaluation was performed
> as expected, but now I don't know what happened!Does anyone know what is
> the problem and why collection's ocl opertions aren't working!?. Thanks
> in advance.
> Regards,
> Chadi

[Updated on: Wed, 21 August 2013 00:30]

Report message to a moderator

Re: ocl strange behavior! [message #1090920 is a reply to message #1090911] Tue, 20 August 2013 20:50 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

What help do you want?

Try reading your email and you might realise why I cannot help.

Regards

Ed Willink


On 20/08/2013 21:37, Sohaib wrote:
> Hi
>
> I examined my query statement and, as I said before, some parts that
> used to
> work before ain't working although I haven't changed anything. this is a
> part from my query (returns substring. example: List[] gives List):
> I tried:
> "_string.substring(1,4) " works
> "_string.substring(1,(Sequence{1..6}->select(c|c=5)->first())-1) " fails
> "_string.substring(1,(Sequence{1..6}->any(c|c=5))-1) " fails
> "_string.substring(1,(Sequence{1..6}->size())-2) " works
>
> Regards
> Chadi
>
> "Ed Willink" a écrit dans le message de groupe de discussion :
> kuqu79$ltt$1@xxxxxxxxe.org...
>
> Hi
>
> Since it was working and is no longer, you have probably done something
> stupid, which is very unlikely to be diagnoseable from the minute hints
> that you have given. You need to examine what changed, perhaps going
> back to what was working, then progressing forward in smaller steps.
>
> Regards
>
> Ed Willink
>
>
> On 17/08/2013 00:01, Sohaib wrote:
>> Hi,
>> I want to perform an OCL check on a java model programmatically. I am
>> using IQueryResult to execute my query statement. Everything was
>> working fine but now I am facing umpredictable behavior and what was
>> working before isn't working anymore.
>> For example, the evaluation of the following query statement does not
>> give the correct result:
>> ........
>> self.oclAsType(class).members->select(ocl expression)............
>> ......
>> the same when I use "for loop statement":
>> Sequence{1..n}->any(ocl expression)
>> or
>> ....
>> Sequence{1..n}->select(ocl expression)
>> .....
>> this is weird because in my ocl query statements, the part before
>> operations on collections such as (select() and any()) is evaluated
>> and gives exactlly
>> what I am expecting. Before the "x event", the evaluation was
>> performed as expected, but now I don't know what happened!Does anyone
>> know what is the problem and why collection's ocl opertions aren't
>> working!?. Thanks in advance.
>> Regards,
>> Chadi
>
Re: ocl strange behavior! [message #1091390 is a reply to message #1090911] Wed, 21 August 2013 12:41 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Chadi,

I think the syntax for integer ranges is simply

1..6

not

Sequence{1..6}

The latter creates a singleton sequence containing a sequence. i.e.,
it is equivalent to

Sequence{ Sequence{1, 2, 3, 4, 5, 6} }

HTH,

Christian


On 2013-08-20 20:37:59 +0000, Sohaib said:

> Hi
>
> I examined my query statement and, as I said before, some parts that used to
> work before ain't working although I haven't changed anything. this is a
> part from my query (returns substring. example: List[] gives List):
> I tried:
> "_string.substring(1,4) " works
> "_string.substring(1,(Sequence{1..6}->select(c|c=5)->first())-1) " fails
> "_string.substring(1,(Sequence{1..6}->any(c|c=5))-1) " fails
> "_string.substring(1,(Sequence{1..6}->size())-2) " works
>
> Regards
> Chadi
>
> "Ed Willink" a écrit dans le message de groupe de discussion :
> kuqu79$ltt$1@xxxxxxxxe.org...
>
> Hi
>
> Since it was working and is no longer, you have probably done something
> stupid, which is very unlikely to be diagnoseable from the minute hints
> that you have given. You need to examine what changed, perhaps going
> back to what was working, then progressing forward in smaller steps.
>
> Regards
>
> Ed Willink
>
>
> On 17/08/2013 00:01, Sohaib wrote:
>> Hi,
>> I want to perform an OCL check on a java model programmatically. I am
>> using IQueryResult to execute my query statement. Everything was
>> working fine but now I am facing umpredictable behavior and what was
>> working before isn't working anymore.
>> For example, the evaluation of the following query statement does not
>> give the correct result:
>> ........
>> self.oclAsType(class).members->select(ocl expression)............
>> ......
>> the same when I use "for loop statement":
>> Sequence{1..n}->any(ocl expression)
>> or
>> ....
>> Sequence{1..n}->select(ocl expression)
>> .....
>> this is weird because in my ocl query statements, the part before
>> operations on collections such as (select() and any()) is evaluated and
>> gives exactlly
>> what I am expecting. Before the "x event", the evaluation was
>> performed as expected, but now I don't know what happened!Does anyone
>> know what is the problem and why collection's ocl opertions aren't
>> working!?. Thanks in advance.
>> Regards,
>> Chadi
Re: ocl strange behavior! [message #1091408 is a reply to message #1091390] Wed, 21 August 2013 13:10 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Christian

You had me worried for a moment.

No. 1..6 is the syntax for a CollectionRangeCS which is a
CollectionLiteralPartCS that may contribute to a CollectionLiteralExpCS.

So any of Set{1..6}, Sequence{1..6} or OrderedSet{1..6} are viable

Sequence{1..6} is just a shorthand for Sequence{1, 2, 3, 4, 5, 6}.

So this is unlikely to be the problem.

Regards

Ed


On 21/08/2013 13:41, Christian W. Damus wrote:
> Hi, Chadi,
>
> I think the syntax for integer ranges is simply
>
> 1..6
>
> not
>
> Sequence{1..6}
>
> The latter creates a singleton sequence containing a sequence. i.e.,
> it is equivalent to
>
> Sequence{ Sequence{1, 2, 3, 4, 5, 6} }
>
> HTH,
>
> Christian
>
>
> On 2013-08-20 20:37:59 +0000, Sohaib said:
>
>> Hi
>>
>> I examined my query statement and, as I said before, some parts that
>> used to
>> work before ain't working although I haven't changed anything. this is a
>> part from my query (returns substring. example: List[] gives List):
>> I tried:
>> "_string.substring(1,4) " works
>> "_string.substring(1,(Sequence{1..6}->select(c|c=5)->first())-1) " fails
>> "_string.substring(1,(Sequence{1..6}->any(c|c=5))-1) " fails
>> "_string.substring(1,(Sequence{1..6}->size())-2) " works
>>
>> Regards
>> Chadi
>>
>> "Ed Willink" a écrit dans le message de groupe de discussion :
>> kuqu79$ltt$1@xxxxxxxxe.org...
>>
>> Hi
>>
>> Since it was working and is no longer, you have probably done something
>> stupid, which is very unlikely to be diagnoseable from the minute hints
>> that you have given. You need to examine what changed, perhaps going
>> back to what was working, then progressing forward in smaller steps.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 17/08/2013 00:01, Sohaib wrote:
>>> Hi,
>>> I want to perform an OCL check on a java model programmatically. I
>>> am using IQueryResult to execute my query statement. Everything was
>>> working fine but now I am facing umpredictable behavior and what was
>>> working before isn't working anymore.
>>> For example, the evaluation of the following query statement does
>>> not give the correct result:
>>> ........
>>> self.oclAsType(class).members->select(ocl expression)............
>>> ......
>>> the same when I use "for loop statement":
>>> Sequence{1..n}->any(ocl expression)
>>> or
>>> ....
>>> Sequence{1..n}->select(ocl expression)
>>> .....
>>> this is weird because in my ocl query statements, the part before
>>> operations on collections such as (select() and any()) is evaluated
>>> and gives exactlly
>>> what I am expecting. Before the "x event", the evaluation was
>>> performed as expected, but now I don't know what happened!Does
>>> anyone know what is the problem and why collection's ocl opertions
>>> aren't working!?. Thanks in advance.
>>> Regards,
>>> Chadi
>
>
Re: ocl strange behavior! [message #1091432 is a reply to message #1090920] Wed, 21 August 2013 12:39 Go to previous messageGo to next message
sohaib soso is currently offline sohaib sosoFriend
Messages: 33
Registered: March 2012
Member
Hi

my question is: besides writing a wrong query statement, are there any other
reasons that may cause my evaluation to fail? this is the same example (of
what I am stuck with) I gave before:
" 'List[]'.substring(1,4)" output:"List" works
"
'List[]'.substring(1,(Sequence{1..'List[]'.size()}->select(c|'List[]'.substring(c,c)='[')->first())-1)"
fails
"
'List[]'.substring(1,Sequence{1..'List[]'.size()}->any(c|'List[]'.substring(c,c)='[')-1)"
fails

I hope my question is clearer now!

Regards
chadi

>Hi
>
>What help do you want?
>
>Try reading your email and you might realise why I cannot help.
>
> Regards
>
> Ed Willink


On 20/08/2013 21:37, Sohaib wrote:
> Hi
>
> I examined my query statement and, as I said before, some parts that used
> to
> work before ain't working although I haven't changed anything. this is a
> part from my query (returns substring. example: List[] gives List):
> I tried:
> "_string.substring(1,4) " works
> "_string.substring(1,(Sequence{1..6}->select(c|c=5)->first())-1) " fails
> "_string.substring(1,(Sequence{1..6}->any(c|c=5))-1) " fails
> "_string.substring(1,(Sequence{1..6}->size())-2) " works
>
> Regards
> Chadi
>
> "Ed Willink" a écrit dans le message de groupe de discussion :
> kuqu79$ltt$1@xxxxxxxxe.org...
>
> Hi
>
> Since it was working and is no longer, you have probably done something
> stupid, which is very unlikely to be diagnoseable from the minute hints
> that you have given. You need to examine what changed, perhaps going
> back to what was working, then progressing forward in smaller steps.
>
> Regards
>
> Ed Willink
>
>
> On 17/08/2013 00:01, Sohaib wrote:
>> Hi,
>> I want to perform an OCL check on a java model programmatically. I am
>> using IQueryResult to execute my query statement. Everything was working
>> fine but now I am facing umpredictable behavior and what was working
>> before isn't working anymore.
>> For example, the evaluation of the following query statement does not
>> give the correct result:
>> ........
>> self.oclAsType(class).members->select(ocl expression)............
>> ......
>> the same when I use "for loop statement":
>> Sequence{1..n}->any(ocl expression)
>> or
>> ....
>> Sequence{1..n}->select(ocl expression)
>> .....
>> this is weird because in my ocl query statements, the part before
>> operations on collections such as (select() and any()) is evaluated and
>> gives exactlly
>> what I am expecting. Before the "x event", the evaluation was performed
>> as expected, but now I don't know what happened!Does anyone know what is
>> the problem and why collection's ocl opertions aren't working!?. Thanks
>> in advance.
>> Regards,
>> Chadi
>
Re: ocl strange behavior! [message #1091436 is a reply to message #1091408] Wed, 21 August 2013 13:45 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Ed,

Thanks. That serves me right for trusting my rusty OCL knowledge! :-)

cW


On 2013-08-21 13:10:59 +0000, Ed Willink said:

> Hi Christian
>
> You had me worried for a moment.
>
> No. 1..6 is the syntax for a CollectionRangeCS which is a
> CollectionLiteralPartCS that may contribute to a CollectionLiteralExpCS.
>
> So any of Set{1..6}, Sequence{1..6} or OrderedSet{1..6} are viable
>
> Sequence{1..6} is just a shorthand for Sequence{1, 2, 3, 4, 5, 6}.
>
> So this is unlikely to be the problem.
>
> Regards
>
> Ed
>
>
> On 21/08/2013 13:41, Christian W. Damus wrote:
>> Hi, Chadi,
>>
>> I think the syntax for integer ranges is simply
>>
>> 1..6
>>
>> not
>>
>> Sequence{1..6}
>>
>> The latter creates a singleton sequence containing a sequence. i.e., it
>> is equivalent to
>>
>> Sequence{ Sequence{1, 2, 3, 4, 5, 6} }
>>
>> HTH,
>>
>> Christian
>>
>>
>> On 2013-08-20 20:37:59 +0000, Sohaib said:
>>
>>> Hi
>>>
>>> I examined my query statement and, as I said before, some parts that used to
>>> work before ain't working although I haven't changed anything. this is a
>>> part from my query (returns substring. example: List[] gives List):
>>> I tried:
>>> "_string.substring(1,4) " works
>>> "_string.substring(1,(Sequence{1..6}->select(c|c=5)->first())-1) " fails
>>> "_string.substring(1,(Sequence{1..6}->any(c|c=5))-1) " fails
>>> "_string.substring(1,(Sequence{1..6}->size())-2) " works
>>>
>>> Regards
>>> Chadi
>>>
>>> "Ed Willink" a écrit dans le message de groupe de discussion :
>>> kuqu79$ltt$1@xxxxxxxxe.org...
>>>
>>> Hi
>>>
>>> Since it was working and is no longer, you have probably done something
>>> stupid, which is very unlikely to be diagnoseable from the minute hints
>>> that you have given. You need to examine what changed, perhaps going
>>> back to what was working, then progressing forward in smaller steps.
>>>
>>> Regards
>>>
>>> Ed Willink
>>>
>>>
>>> On 17/08/2013 00:01, Sohaib wrote:
>>>> Hi,
>>>> I want to perform an OCL check on a java model programmatically. I am
>>>> using IQueryResult to execute my query statement. Everything was
>>>> working fine but now I am facing umpredictable behavior and what was
>>>> working before isn't working anymore.
>>>> For example, the evaluation of the following query statement does not
>>>> give the correct result:
>>>> ........
>>>> self.oclAsType(class).members->select(ocl expression)............
>>>> ......
>>>> the same when I use "for loop statement":
>>>> Sequence{1..n}->any(ocl expression)
>>>> or
>>>> ....
>>>> Sequence{1..n}->select(ocl expression)
>>>> .....
>>>> this is weird because in my ocl query statements, the part before
>>>> operations on collections such as (select() and any()) is evaluated and
>>>> gives exactlly
>>>> what I am expecting. Before the "x event", the evaluation was
>>>> performed as expected, but now I don't know what happened!Does anyone
>>>> know what is the problem and why collection's ocl opertions aren't
>>>> working!?. Thanks in advance.
>>>> Regards,
>>>> Chadi
Re: ocl strange behavior! [message #1091631 is a reply to message #1088318] Wed, 21 August 2013 19:26 Go to previous messageGo to next message
sohaib soso is currently offline sohaib sosoFriend
Messages: 33
Registered: March 2012
Member
So does no one have a clue!!!?
Re: ocl strange behavior! [message #1091684 is a reply to message #1091631] Wed, 21 August 2013 21:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
We're not telepathic.


On 21/08/2013 20:26, chadi assem wrote:
> So does no one have a clue!!!?
Re: ocl strange behavior! [message #1092215 is a reply to message #1091684] Thu, 22 August 2013 13:29 Go to previous messageGo to next message
sohaib soso is currently offline sohaib sosoFriend
Messages: 33
Registered: March 2012
Member
Hi Ed

My ocl expression is syntactically correct. I show you in a previous example that when I use "'List[]'.substring(1,4)" it works, no problem. but when I replace it by

"'List[]'.substring(1,(Sequence{1..'List[]'.size()}->select(c|'List[]'.substring(c,c)='[')->first())-1)"

or

"'List[]'.substring(1,Sequence{1..'List[]'.size()}->any(c|'List[]'.substring(c,c)='[')-1)"

it does not work. I cannot find a syntax error! I cannot explain this behavior! if you have noticed a syntax error in those two expressions, please guide me, otherwise, what kind of information do you want? What do you need explained more clearly? I am not the expert here! may be you want more details? if so, what exactlly? Should I attach the whole project? Thank you for any help you can provide

regards
chadi
Re: ocl strange behavior! [message #1092270 is a reply to message #1092215] Thu, 22 August 2013 14:48 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

When I type any of your three expressions into either Classic or Xtext
OCL Console I get the result 'List'.

But you didn't say what constituted a problem for you so who knows?

Regards

Ed Willink


On 22/08/2013 14:29, chadi assem wrote:
> Hi Ed
>
> My ocl expression is syntactically correct. I show you in a previous
> example that when I use "'List[]'.substring(1,4)" it works, no
> problem. but when I replace it by
> "'List[]'.substring(1,(Sequence{1..'List[]'.size()}->select(c|'List[]'.substring(c,c)='[')->first())-1)"
>
> or
>
> "'List[]'.substring(1,Sequence{1..'List[]'.size()}->any(c|'List[]'.substring(c,c)='[')-1)"
>
>
> it does not work. I cannot find a syntax error! I cannot explain this
> behavior! if you have noticed a syntax error in those two expressions,
> please guide me, otherwise, what kind of information do you want? What
> do you need explained more clearly? I am not the expert here! may be
> you want more details? if so, what exactlly? Should I attach the whole
> project? Thank you for any help you can provide
>
> regards
> chadi
Re: ocl strange behavior! [message #1092477 is a reply to message #1092270] Thu, 22 August 2013 21:22 Go to previous messageGo to next message
sohaib soso is currently offline sohaib sosoFriend
Messages: 33
Registered: March 2012
Member
Hi Ed


what constitutes a problem for me is the fact that when I replace my first expression ("'List[]'.substring(1,4)") by one of the two other expressions my query does not work (I use IQueryResult). One last question. Couldn't be that using these two expression (select() and any()) within a if-else statemant or a forall() operation causes this behavior (affect the iteration)?

Regards

chadi

Ed Willink wrote on Thu, 22 August 2013 10:48
Hi

When I type any of your three expressions into either Classic or Xtext
OCL Console I get the result 'List'.

But you didn't say what constituted a problem for you so who knows?

Regards

Ed Willink


On 22/08/2013 14:29, chadi assem wrote:
> Hi Ed
>
> My ocl expression is syntactically correct. I show you in a previous
> example that when I use "'List[]'.substring(1,4)" it works, no
> problem. but when I replace it by
> "'List[]'.substring(1,(Sequence{1..'List[]'.size()}->select(c|'List[]'.substring(c,c)='[')->first())-1)"
>
> or
>
> "'List[]'.substring(1,Sequence{1..'List[]'.size()}->any(c|'List[]'.substring(c,c)='[')-1)"
>
>
> it does not work. I cannot find a syntax error! I cannot explain this
> behavior! if you have noticed a syntax error in those two expressions,
> please guide me, otherwise, what kind of information do you want? What
> do you need explained more clearly? I am not the expert here! may be
> you want more details? if so, what exactlly? Should I attach the whole
> project? Thank you for any help you can provide
>
> regards
> chadi

Re: ocl strange behavior! [message #1092729 is a reply to message #1092477] Fri, 23 August 2013 06:19 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You still don't say what you mean by does not work.

Does your machine catch fire?
Does your Skype connection drop out?
....
Throw an exception
Give a result different to your unstated expectation

It saves everyone a lot of wasted time if you provide a repro. e.g. a
zipped project with a launch configuration.

Regards

Ed Willink


On 22/08/2013 22:22, chadi assem wrote:
> Hi Ed
>
>
> what constitutes a problem for me is the fact that when I replace my
> first expression ("'List[]'.substring(1,4)") by one of the two other
> expressions my query does not work (I use IQueryResult). One last
> question. Couldn't be that using these two expression (select() and
> any()) within a if-else statemant or a forall() operation causes this
> behavior (affect the iteration)?
> Regards
>
> chadi
>
> Ed Willink wrote on Thu, 22 August 2013 10:48
>> Hi
>>
>> When I type any of your three expressions into either Classic or
>> Xtext OCL Console I get the result 'List'.
>>
>> But you didn't say what constituted a problem for you so who knows?
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 22/08/2013 14:29, chadi assem wrote:
>> > Hi Ed
>> >
>> > My ocl expression is syntactically correct. I show you in a
>> previous > example that when I use "'List[]'.substring(1,4)" it
>> works, no > problem. but when I replace it by
>> >
>> "'List[]'.substring(1,(Sequence{1..'List[]'.size()}->select(c|'List[]'.substring(c,c)='[')->first())-1)"
>> >
>> > or
>> >
>> >
>> "'List[]'.substring(1,Sequence{1..'List[]'.size()}->any(c|'List[]'.substring(c,c)='[')-1)"
>> >
>> >
>> > it does not work. I cannot find a syntax error! I cannot explain
>> this > behavior! if you have noticed a syntax error in those two
>> expressions, > please guide me, otherwise, what kind of information
>> do you want? What > do you need explained more clearly? I am not the
>> expert here! may be > you want more details? if so, what exactlly?
>> Should I attach the whole > project? Thank you for any help you can
>> provide
>> >
>> > regards
>> > chadi
>
>
Re: ocl strange behavior! [message #1096856 is a reply to message #1092729] Thu, 29 August 2013 00:14 Go to previous message
sohaib soso is currently offline sohaib sosoFriend
Messages: 33
Registered: March 2012
Member
Hi Ed

sorry for the late reply, I've just been so Busy Lately. About my problem, I found
that the iterator I've used in both expressions (iterator c) is already used in my
query (in an outer loop ). Thanx anyway for your time

Regards

Chadi


> Hi
>
> You still don't say what you mean by does not work.
>
> Does your machine catch fire?
> Does your Skype connection drop out?
> ....
> Throw an exception
> Give a result different to your unstated expectation
>
> It saves everyone a lot of wasted time if you provide a repro. e.g. a
> zipped project with a launch configuration.
>
> Regards
>
> Ed Willink
>
>
> On 22/08/2013 22:22, chadi assem wrote:
>> Hi Ed
>>
>>
>> what constitutes a problem for me is the fact that when I replace my
>> first expression ("'List[]'.substring(1,4)") by one of the two other
>> expressions my query does not work (I use IQueryResult). One last
>> question. Couldn't be that using these two expression (select() and
>> any()) within a if-else statemant or a forall() operation causes this
>> behavior (affect the iteration)?
>> Regards
>>
>> chadi
>>
>> Ed Willink wrote on Thu, 22 August 2013 10:48
>>> Hi
>>> >
>>> > When I type any of your three expressions into either Classic or
>>> > Xtext OCL Console I get the result 'List'.
>>> >
>>> > But you didn't say what constituted a problem for you so who knows?
>>> >
>>> > Regards
>>> >
>>> > Ed Willink
>>> >
>>> >
>>> >On 22/08/2013 14:29, chadi assem wrote:
>>>> > Hi Ed
>>>> >
>>>> > My ocl expression is syntactically correct. I show you in a
>>>> > previous > example that when I use "'List[]'.substring(1,4)" it
>>>> > works, no > problem. but when I replace it by
>>>> >
>>>> >"'List[]'.substring(1,(Sequence{1..'List[]'.size()}->select(c|'List
>>>> >[]'.substring
>>>> >(c,c)='[')->first())-1)"
>>>>
>>>> > or
>>>> >
>>>> >
>>>> >"'List[]'.substring(1,Sequence{1..'List[]'.size()}->any(c|'List[]'.substring
>>>> >(c,c)='[')-1)"
>>>> >
>>>> >
>>>> > it does not work. I cannot find a syntax error! I cannot explain
>>>> > this > behavior! if you have noticed a syntax error in those two
>>>> > expressions, > please guide me, otherwise, what kind of information
>>>> > do you want? What > do you need explained more clearly? I am not the
>>>> > expert here! may be > you want more details? if so, what exactlly?
>>>> > Should I attach the whole > project? Thank you for any help you can
>>>> > provide
>>>> >
>>>> > regards
>>>> > chadi
>
>
Previous Topic:Content Assist in Xtext OCL Console
Next Topic:(Pivot) Parsing OCL Document which complements a UML model
Goto Forum:
  


Current Time: Tue Apr 16 18:28:07 GMT 2024

Powered by FUDForum. Page generated in 0.16405 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top