Hi,
since a few weeks we are trying to set up some elements with Dynamic Virtual Elements (DVE). Some of the relations works good but we have seen in one Video related to this theme, that some times, some SNMP Tables need a Trigger and a QAction to fill up it. We have already tryed but we didn´t the way to do that. We have read a lot of protocols examples but we are not capable. Could anyone help us to find the way to set up the link between a Foreign Key and a Primary Key to fill up a a DVE - SNMP Table.
Thanks
Francisco
Hi Fransisco,
There's a few topics to unpack here.
First, a QAction with a table PID as trigger will be executed when that table changes, but not if those changes are made through a QAction. So in case of SNMP tables, if a poll cycle happened and any of the data changed, it should trigger the QAction.
Second, SNMP tables only mesh with columns of type "custom", and not "retrieved". The retrieved columns need to be at the end of the table definition as far as I remember.
Third, once you've filled up your additional column with the desired values, which I presume is your FK to another table here, we need to make sure the FK is defined correctly. It needs two things to work:
- The "foreignkey=" option on the column definition with the PID of the linked table (e.g. <ColumnOption idx="10" pid="1011" type="custom" options=";foreignKey=1100"/>).
- A relation path that lets dataminer know the correct way of resolving these links (Protocol.Relations.Relation, e.g. <Relation path="100;200">). This may seem arbitrary for just two linked tables, but is crucial for more complex setups.
Fourth, there's multiple ways to set up DVEs structurally. You could add the DVE column to the SNMP table, which doesn't give you a lot of control over the lifetime of the DVE. This is often paired with a state column to avoid losing a DVE as soon as the row is removed from the device. Another way is to keep a separate table and link with a foreign key to allow for some more control. But I believe the best practices here fall into the domain of the protocol development team, their protocol examples, and the development guide.
Hello Francisco,
If the column is “not initialized”, then it is not being filled in correctly. Are you sure your qaction is using the correct calls to set these cells? Have you checked the element’s logging for any error that might be linked to your sets, giving us some indication of what is going wrong?
Hi Francisco,
As stated by Floris, your column is currently not correctly being filled in so your next step is to identify where it fails. To find that out, I would follow the following approach:
1. Is the QAction correctly triggered?
Adding a protocol.Log(…) call as first thing in that QAction entry point will allow to check this. If the log entry doesn’t appear in the element logging, your QAction is not firing -> double check the different xml attributes on the QAction XML tag (mostly the QAction@trigger and the QAction@row attributes probably.
2. Is the call meant to update that column correctly executed?
Adding a protocol.Log(…) call next to the call meant to update the column will allow to check this. I the log entry doesn’t appear in the element logging, something is wrong in the logic of the QAction code.
3. Is the call meant to update that column actually working?
Which DataMiner call are you using here? If a call allowing to set multiple table entries in bulk is used (ex: FillArray, FillArrayWithColumn, etc), then the column type retrieved is necessary and then that column needs to be located towards the end of the table (as in after all snmp columns of it). If a call allowing to set only one entry/row a the time (ex: SetParameterIndexByKey, SetRow), then both a column with type ‘custom’ and ‘retrieved’ will do. But ‘custom’ will be required if the column needs to be followed by snmp columns for backward compatibility reasons.
Extra remark: If you’re familiar with it, everything part of the investigation I described via logging can also be achieved via DIS Inject feature which basically allows one to step through code at run-time making such investigations very convenient.
Hi Floris,
first of all, thanks for your tips.
About the use of type “custom” instead of “retrieved”, I have change it, but for the moment I saw no effect.
I think that the third point is the clue for that issue. I have already set the “foreignKey” option and the Relations between the two SNMP Tables (100;200) as you have explained.
I have followed the instrucctions shown in three differents protocol examples and Videos and it doesn´t matters what I do, the FK Column at Table 200 related to table 100 is always “not initialized”.
I hope the Protocol Development Team could be able to help me to find the mistake to this issue.
I will keep trying. Thank you very much.
Francisco