fsubtypes not working as expected

 I am trying to implement a callback inherit from LLIAPI::NodeCallbacks, then overwrite CBCategoriesUpdatePost function.

 I have set fSubTypes = {848}. But the overwrite function is always being called no matter what the node type is when I change category attribute value.

 I played with Setup and __Init function, but it does not help. Am I missing something here? How can I limit the callback to only specified node type?


Comments

  • Your code looks right, though you do not need the '0 Setup', nor setting .fSubtypes in the __Init feature (nor the override of __Init feature for that matter).  Also I cannot tell that you are overriding the correct object but if your code is being called at all you must be!  How do you know the function is being called no matter what subtype?

    One thing you can do is put a break in $LLIAPI.NodeCallbackSubsystem.Get() and see exactly what is going on when your callback is being asked for (or in LLAIPI.LLNode.NodeCategoriesUpdate, step into the "for cb in .GetCallbacks('CBCategoriesUpdatePost')" line).

    Cheers...
  • dluo
    edited May 15, 2020 #3
    Thank you, John. It's good to know where to trouble shoot it.

    I removed '0 Setup' and __init, rebuilt the module. Then I set a break in $LLIAPI.NodeCallbackSubsystem.Get(). The issue magically disappeared. It's confirmed to still working fine after break point is cleared. 

    In the test, I updated category attribute value on various type of nodes. Previously it always stop at break point in my callback function. Now I can see it only stops when the node being updated is the correct type.

    I did rebuilt the module and restart the service in eclipse multiple times before. But somehow it worked today.
  • the __Init fires when the server starts so if you want to know if it was actually being run you could say Echo("I am in Trimet __Init") you would see that in thread0.log long before you see the successful thing like "Port 2099 listening"

    In the new type, you are using the override Dynamic subtypes would be akin to you using the GUI and finding override object source and in that none alphabetically sorted huge list if you picked, for example, the Documentation script it would get thrown in code that is probably how you got the __Init there or it might have been an old module that used builder you imported...Gload to know things are working... @John Simon is the guy...