(this article is more for myself and for future documentation, but it might be interesting for people struggling with Generic Menus.)
For my Interaction Project one main goal is that you can add Flags easily to an Actionable Object Flag Dependency.
Meaning : If there is a chest which can be opened, then you add a flag to it like „open“. The open and the close action then depend and act on the state of that flag.
For adding a flag dependency to an Actionable Object, I wanted a fast, organized and quick way to choose a flag. For this I use an Generic Menu in the Editor Script for the Flag Dependency Class, a custom Property Drawer.

(Of course, if you have multiple chest this gets a bit confusing when they have the same name, but I will add a menu entry for the flags in the current editied AO. Also there are some more ways to group AOs, like region, area, group, scene…)
My first approach used simply the flag names. But this did not work out. I need a unique identifier for each flag. That is necessary cause Actionable Objects Flag Dependencies can depend on flags from other AOs. Also to be able to clone an Actionable Object easily, for example windows or doors, you need to be able to create the flags with the same name but with another unique identifier.
Also there was one small problem I solved for this to work : Since there can be more than one Action in an AO logically, the menu in each of these has to report to the AO which Action actually used a menu to create a new flag dependency.
I solved this by adding the unique property path to the return value of the selected menu item.
flagNameToAdd = property.propertyPath + "\n" + flagNameToAdd;
Here I still use the flag name instead of the flag uniquie uint identifier.
Then the next „trick“ I used is to place the selected menu item string into an member of the FlagDependencyDrawer. In the next OnGUI the drawer checks if the member variable is empty, if not, it parses the content and creates the Flag Property accordingly. It also makes sure that the string is for this drawer, which seems a bit redundent, but seemed necessary at the time.
if (property.propertyPath == propertyPath)