I'm trying to understand the various types of references that two objects can have in a Genexus knowledge base.
For example:
KBObject obj = KBObject.Get(objRef.Model, r.From);
r.ReferenceType ??
r.LinkType ??
r.LinkTypeInfo ??
What do ReferenceType (Hard, Weak, WeakExternal, etc.), LinkType (1, 2, 4, etc.), and LinkTypeInfo (BL, R1I1U1B1, etc.) mean?
I've searched through the documentation and code examples, but I couldn't find any relevant information. Could someone provide an explanation or point me to relevant documentation or code examples?
Here goes a summary of the possible values each field can take:
ReferenceType:
- 0: Weak reference. A reference to an object that does not forbid that object to be deleted. For example, literals to be translated.
- 1: Hard reference. A reference to an object that does not allow the object to be deleted. E.g. A procedure A that call another procedure B. You cannot delete B unless you remove the call from A to B.
- 2: Weak external reference. For example, you have a dynamic call in some object with certain signature. Upon specifying such object, weak external references to every possible callable object with that signature are added.
Link Type:
- 1: Used Object. The reference links two objects. For example, a static call from an object to another object.
- 2: Parent. The reference to the parent object.
- 3: Category. A reference to a category the object belongs to
- 4: UsedEntity. A reference to an object but that does not in itself make the target object to be required for specification (included in the call tree of the object). For example if you use a for each with base transaction, the base transaction does not belong to the call tree of the object just because it is used in such construct.
Link Type Info:
For table references, indicates whether the linked table is Read, Inserted, Updated, Deleted and/or is used as a Base table.
The format is: RnInUnBn where n
is either 0
or 1
indicating the usage (0
not used for this operation, 1
used for this operation)