[deepamehta-devel] changing label config of existing topic type

Robert Schuster robert.schuster.rs01 at gmail.com
Tue Jan 17 18:57:23 CET 2017


Hi Jörg,
I tried to fix the Proposal type on my own and it seemed the following
code would bring proper values to the "Include in Label" child of the
association:

TopicType tt = dm4.getTopicType(NS("proposal"));
tt.getAssocDef("dm4.datetime.date#dm4.events.from").getChildTopics().set("dm4.core.include_in_label",
false);
tt.getAssocDef("dm4.datetime.date#dm4.events.to").getChildTopics().set("dm4.core.include_in_label",
false);

In DM 4.8.4+4.8.5 this leads to a ClassCastException:

Caused by: java.lang.ClassCastException:
de.deepamehta.core.impl.AssociationModelImpl cannot be cast to
de.deepamehta.core.model.AssociationDefinitionModel
    at
de.deepamehta.core.impl.AssociationDefinitionModelImpl.postUpdate(AssociationDefinitionModelImpl.java:170)
    at
de.deepamehta.core.impl.DeepaMehtaObjectModelImpl.update(DeepaMehtaObjectModelImpl.java:400)
    ... 31 more

Do you think this needs to be fixed in DM? Should I file a bug report?

All the best,
Robert

On 17.01.2017 17:20, Robert Schuster wrote:
> Hi Jörg,
> ok I got it now.
>
> Yes, you were right, the "Include in Label" topics are missing for two
> of "Proposal"'s child types. These are:
>
> "dm4.events.from"
> "dm4.events.to"
>
> I added those to the Proposal in an earlier migration by running:
>
>         return dm4.getTopicType(topicTypeUri)
>             .addAssocDef(
>                
> mf.newAssociationDefinitionModel("dm4.core.aggregation_def",
> "dm4.events.from",
>                     topicTypeUri, "dm4.datetime.date",
> "dm4.core.many", "dm4.core.one"))
>             .addAssocDef(
>                
> mf.newAssociationDefinitionModel("dm4.core.aggregation_def",
> "dm4.events.to",
>                     topicTypeUri, "dm4.datetime.date",
> "dm4.core.many", "dm4.core.one"));
>
>
> (This means other types in my project affected by this problem too but
> its harmless because I am not changing their label config atm).
>
> I understand, that I need to fix those types now. But at the same time
> creating an association definition with the above method should not
> result in broken types, right?
>
> All the best,
> Robert
>
> On 17.01.2017 16:57, Jörg Richter wrote:
>>
>> Hi Robert,
>>
>> "assoc def" (= Association Definition) is just a generic term for
>> either a "Composition Definition" or an "Aggregation Definition",
>> that is the very associations that are used to define your composite
>> types.
>>
>> As an example in the attached screenshot you see the 2 assoc defs of
>> the "Note" type. When you select an assoc def, in the detail panel
>> you're supposed to see an "Include in Label (1) (Composition)" entry.
>> This is the topic (of type "Include in Label") that holds the
>> (boolean) "Include in Label" value for that assoc def. (In the
>> screenshot the Include in Label topics for both assoc defs are
>> revealed in the topicmap.) Each assoc def is expected to be
>> associated with exactly one Include in Label topic.
>>
>> Please check if the Include in Label topics exist for all assoc defs
>> of your problematic parent type. My hypothesis is that (at least) one
>> of the Include in Label topics are missing in your DB. If you can
>> confirm that we can see how to repair your DB.
>>
>>
>>
>>
>>> On 17 Jan 2017, at 16:22, Robert Schuster
>>> <robert.schuster.rs01 at gmail.com
>>> <mailto:robert.schuster.rs01 at gmail.com>> wrote:
>>>
>>> I can't quite follow here. What topic (type) exactly you mean with
>>> "the assoc def". I could only find the "Include in Label" with its
>>> 107 instantiations. Should I start from the Proposol topic type?
>>
>>
>>
>
> -- 
> Robert Schuster
> freiberuflicher Softwareingenieur
>
> RS01 - IT-Systemanalyse und -entwicklung Robert Schuster
> Brückenstraße 4 • 12439 Berlin
> +49 157 798 00 310
> robert.schuster.rs01 at gmail.com
>

-- 
Robert Schuster
freiberuflicher Softwareingenieur

RS01 - IT-Systemanalyse und -entwicklung Robert Schuster
Brückenstraße 4 • 12439 Berlin
+49 157 798 00 310
robert.schuster.rs01 at gmail.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deepamehta.de/pipermail/devel-lists.deepamehta.de/attachments/20170117/5dfeec31/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 59347 bytes
Desc: not available
URL: <http://lists.deepamehta.de/pipermail/devel-lists.deepamehta.de/attachments/20170117/5dfeec31/attachment.png>


More information about the devel mailing list