[great-users] Getting an unexpected runtime error duringmodeltransformation
Daniel Balasubramanian
daniel at isis.vanderbilt.edu
Thu Nov 26 21:59:11 CST 2009
Hi Gurkan,
Glad to hear you got it working! The reason may be that the method call
FacmOrdCon_InsTypEl_MscInsEv.Precedence()
doesn't return an int; if you look at the definition of the Precedence() method, you'll see that it returns a Udm wrapper object around an int, and this wrapper may not have the '+' operator overloaded to give the result you expect. When you do the following calls
__int64 p;
FacmOrdCon_InsTypEl_MscInsEv.GetIntValue("Precedence",p);
FamOrdCon_InsTypEl_MscInsEv1.SetIntValue("Precedence",p+4);
a value of (p+4) is passed as the second parameter to 'SetIntValue', which doesn't rely on operator overloading at all.
Cheers,
Daniel
-----Original Message-----
From: great-users-bounces at list.isis.vanderbilt.edu on behalf of Gürkan Özhan
Sent: Thu 11/26/2009 6:15 PM
To: great-users
Subject: Re: [great-users] Getting an unexpected runtime error duringmodeltransformation
Dear All,
I have good news! Being inspired from Gabor's "Does the failiung
rule have attribute mapping code?" question, I focused my attention to
the 3 rules that got the error on different occasions, for
AttributeMapping. I discovered that all the three had
AttributeMappings, like many others.
At a first attemp, I deleted AttributeMappings from them and
bingo, the transformation worked! When I examined the scripts, I found
that they had a specific part where a source model Connection's
attribute value is manipulated and carried to the target model. A part
of the original snippet is:
FamOrdCon_InsTypEl_MscInsEv1.Precedence()=FacmOrdCon_InsTypEl_MscInsEv.Precedence()+4;
FamOrdCon_InsTypEl_MscInsEv1.Temperature()=FacmOrdCon_InsTypEl_MscInsEv.Temperature();
...
The Precedence field is an integer and Temperature is an
enumeration. I suspected the usage of Precedence assignment and
changed the code to (I remembered this type of usage from the
House2Order example):
__int64 p;
FacmOrdCon_InsTypEl_MscInsEv.GetIntValue("Precedence",p);
FamOrdCon_InsTypEl_MscInsEv1.SetIntValue("Precedence",p+4);
FamOrdCon_InsTypEl_MscInsEv1.Temperature()=FacmOrdCon_InsTypEl_MscInsEv.Temperature();
...
This difference resulted in success and the error is gone now. I have
litte idea why and how this worked. If you have understood why this
change solved the problem,I would be very interested in hearing the
explanation.
Kind regards,
Gurkan
On Tue, Nov 24, 2009 at 4:41 PM, Gabor Karsai <gabor at isis.vanderbilt.edu> wrote:
> Dear Gurkan,
>
> This seems like a GME problem - which GME are you using? We had a new release recently and the latest GReAT works only with that. Does the failiung rule have attribute mapping code? If so, could you post it?
> Also, as a workaround, you may want to try to convert the models into XML files (using udmpcopy) and run the transform on that.
>
> Thanks,
> -- Gabor
>
>> -----Original Message-----
>> From: great-users-bounces at list.isis.vanderbilt.edu [mailto:great-users-
>> bounces at list.isis.vanderbilt.edu] On Behalf Of Gürkan Özhan
>> Sent: Friday, November 20, 2009 7:57 PM
>> To: great-users
>> Subject: [great-users] Getting an unexpected runtime error during modeltransformation
>>
>> Dear GReAT users,
>> I get an unexpected runtime error during a model transformation
>> exercise. The pruned versions of the source model are successfully
>> transformed, but the current one, which has a modest size gets the
>> error:
>>
>> A top level error pane displays:
>> Exception: Com exception: Lock value in storage is invalid.
>>
>> The pane beneath reads:
>> Executing Rule: DurableMsg-Inst-ReqProv
>>
>> The error is reached after some 10 minutes from the start of the
>> transformation. A typical sample model would be even bigger than the
>> current one that got the error. Any help is very much appreciated.
>>
>> I can provide the transformation definition, the source and target
>> metamodels and the sample source model uppon requested.
>>
>> Best regards,
>>
>>
>> Gurkan Ozhan
_______________________________________________
great-users mailing list
great-users at list.isis.vanderbilt.edu
http://list.isis.vanderbilt.edu/mailman/listinfo/great-users
More information about the great-users
mailing list