How to get id of diagrams using openApi?

Hi guys
I want to know how to find the id that the user has assigned to a diagram in my plugin?
By id I mean what I specified in the image below not what the getId() method of IDiagramUIModel interface returns.

Best regards

I guess this is not a property of every type of diagram. I would look into its specific interface IBusinessProcessDiagramUIModel. There are a bunch of id-related methods, but don’t ask me which one is the one you want :sweat_smile:

Hi Mamad,

I am asking our engineers and will give you an answer as soon as possible.

Best regards,
Jick Yeung

Hi Mamad,

Setting and getting of ID was not supported. Our engineers have just added the following methods:

setUserID(…), getUserID()

You can now advance to the latest patch build (16_3_20210540aa or higher) to obtain the fix. For details, please read:

Best regards,
Jick Yeung

1 Like

@Jick, can we have “user-generated” IDs for model elements and diagram elements as well? In this case I’m not interesting in showing this ID to the user, but it would be interesting to have a custom ID such that plugins could exchange elements between projects while avoiding duplicating them.

Hi claudenirmf,

Thank you for your reply. Our ‘tagged value’ feature allows you to define custom attributes for your model elements. You can edit it via GUI (Right-click on a shape and select Open Specification… from the popup menu) and the OpenAPI. Is this what you need?

Unfortunately, the tagged value feature is not supported for diagrams.

You also mentioned that you do not want to show the ID to users, in case tagged value is not what you want, you may consider keeping a mapping of model element ID and the IDs you generate elsewhere (e.g. a database / physical file).

Best regards,
Jick Yeung

Thank you so much for your support :clap: :pray:

You’re welcome. :slight_smile:

That’s the point, tagged values offer a lot of flexibility but: (i) they are accessible to users, which is undesirable in some cases; and (ii) they can be shown in diagrams. If users could show only a subset of their tagged values in diagrams I would be happy with your suggestion, but this is a new thread entirely, so I’ll stop here.