[great-dev] Re: [udm-users] RE: [great-users] "Com exception:
Object cannot bechanged"
Tivadar Szemethy
tiv at isis.vanderbilt.edu
Sat Apr 9 11:04:05 CDT 2005
Hello,
Thanks for the answers.
Looks like the problem can be solved by
1) identifying the archetype from a guard/AttrMap code using Endre's code
2) from the same guard/AttrMap create an association (defined in
CrossLinks) between the object and it's archetype
3) match this association from a subsequent GReAT rule
Let's say I have an association between two MyObjects (srcMyObject,
dstMyObject) defined in CrossLinks.
How do I create the association of step 2) ?
I tried to look at the generated code of a GReAT rule for creating such
association, and replicate it, but it did not work.
Thanks,
Tivadar
Endre Magyari wrote:
>
> Then the code is:
>
> Udm::Object o;
>
> if (o.isInstance())
> {
> //o is an instance, only it's type can be modified
> Udm::Object type = o.archetype();
> //modify type
> }
> else
> {
> //o is not an instance, it's either an normal object(model, fco,
> atom) or a derived object, which can be modified.
> //if it's a derived object, isSubtype() returns true
> };
>
>
>
> Note that this is generic code, but since all generated types are
> inherited from Udm::Object, isInstance(), isSubtype() works.
> For the generated classes in UDM API there is also available an
> Archetype()call, which is typed, it returns with an object of the
> same type.
>
>
> Endre
>
>
>
> On Fri, 8 Apr 2005 10:20:39 -0500, Attila Vizhanyo
> <viza at isis.vanderbilt.edu> wrote:
>
>> Tivadar wants to (1) query if an object is instance or not (2) if it is,
>> get access to its type object, and modify the type object.
>>
>>
>>> -----Original Message-----
>>> From: Endre Magyari
>>> Sent: Friday, April 08, 2005 2:06
>>> To: udm-users
>>> Cc: This is a list for GReAT developers to exchange
>>> development related thoughts and ideas
>>> Subject: [great-dev] Re: [udm-users] RE: [great-users] "Com
>>> exception: Object cannot bechanged"
>>>
>>>
>>>
>>>
>>>
>>> Attila,
>>>
>>> there is no UDM API which permits to modify an instance
>>> object - besides,
>>> Tivadar is talking about a COM exception thrown by MGA layer.
>>> So, what kind of solution did you mean ?
>>>
>>> Thanks,
>>> Endre
>>>
>>>
>>> On Thu, 7 Apr 2005 16:42:22 -0500, Attila Vizhanyo
>>> <viza at isis.vanderbilt.edu> wrote:
>>>
>>> > I believe these problems can be solved using the UDM API
>>> from Guard/
>>> > AttributeMapping code. I'm forwarding your post to the
>>> udm-users list.
>>> >
>>> > Thanks,
>>> > Attila
>>> >
>>> >
>>> >> -----Original Message-----
>>> >> From: Tivadar Szemethy
>>> >> Sent: Thursday, April 07, 2005 16:28
>>> >> To: great-users
>>> >> Subject: [great-users] "Com exception: Object cannot be changed"
>>> >>
>>> >>
>>> >> Hello,
>>> >>
>>> >> In a GReAT transformation, I have to make temporary
>>> modifications to
>>> >> my src model in order to make further processing easier. However,
>>> >> some of the objects in the src are Instances (as in General
>>> >> Properties/Type in the Attribute Panel in GME) of other objects
>>> >> defined in a "Model Library" folder in the src model.
>>> >>
>>> >> As I understand, instances cannot be modified.
>>> >> Therefore, I need to come up with a GReAT rule, which:
>>> >>
>>> >> a) checks whether the object in question is an Instance or not
>>> >> b) if it is, returns the corresponding "Template" object
>>> which can be
>>> >> modified
>>> >>
>>> >> How do I do this ?
>>> >>
>>> >> Thanks,
>>> >>
>>> >> Tivadar
>>> >> _______________________________________________
>>> >> great-users mailing list great-users at list.isis.vanderbilt.edu
>>> >> http://list.isis.vanderbilt.edu/mailman/listinfo/great-users
>>> >>
>>> > _______________________________________________
>>> > udm-users mailing list
>>> > udm-users at list.isis.vanderbilt.edu
>>> > http://list.isis.vanderbilt.edu/mailman/listinfo/udm-users
>>>
>>>
>>> _______________________________________________
>>> great-dev mailing list
>>> great-dev at list.isis.vanderbilt.edu
>>> http://list.isis.vanderbilt.edu/mailman/listinfo/great-dev
>>>
>> _______________________________________________
>> great-dev mailing list
>> great-dev at list.isis.vanderbilt.edu
>> http://list.isis.vanderbilt.edu/mailman/listinfo/great-dev
>
>
>
More information about the great-users
mailing list