The goal is to assign a visio file (.vdsx) to an element, via protocol.
I found the NotifyType(444) /*NT_ASSIGN_ELEMENT_VDX */
...which appears to do what I want, but I cannot find how to make it work.
There should be no need for a Notify message to do this. Specifically, for a protocol visio, you should be able to use the UpdateProtocolActiveVisioMessage message. Make sure to fill in the protocol name and the name of the visio file you uploaded to the right location (likely with CreateProtocolFileMessage) in an earlier step.
The question specifically mentioned assigning the visio through the protocol. For assigning a specific element visio, there is also a message, which is UpdateElementActiveVisioMessage.
The notify message may read like it assigns to an element, but it’s a legacy message, so I’m pretty sure it assigns to a protocol as well (since assigning to a specific element has not existed for that long yet).
Indeed, I’m already using the UpdateElementActiveVisioMessage, together with the CreateElementFileMessage to make this work. However, we are always advised not to use SLNet calls, so I was trying to avoid them. Also, if there is no other option, what do you think would be the best way to acknowledge the visio file is synced so the UpdateElementActiveVisioMessage can be executed afterward, and not before.
I would say NotifyType is the worse of the 2 evils though. Not sure if you have ever gotten advise on the use of those messages?
Your question about the upload… Does the “CreateProtocolFileMessage” not send a response?
The CreateElementFileMessage does send a response – an error code.
I don’t believe it accounts for the sync, because on the customer – which has a heavily loaded DMS – I need to Sleep() between this call and the UpdateElementActiveVisioMessage to make it work properly. Without the Sleep(), it does not “find” the file.
Is the UpdateProtocolActiveVisioMessage equivalent to the Notify 444?
From the name, it seems that one assigns the “global” protocol visio that applies to all elements while the Notify mentioned in the question refers to assigning a Visio just to one specific element.