Creates or deletes the following relationships between two object instances:
Authorization
Administrator or authorized user (all relationships); user (Attachment relationships only)
Syntax
APIRET APIENTRY FLGRelation( PSZ pszSrcFLGID,
PSZ pszTrgFLGID,
FLGRELTYPE RelType,
FLGRELOPTION RelOpt,
PFLGEXTCODE pExtCode );
Parameters
Characters 1-6 of this ID identify the object type of this instance.
Characters 7-16 of this ID are the system-generated unique instance identifier.
The FLGID you specify depends on the type of relationship that you want to create or delete:
See Appendix D, Information Catalog Manager reason codes for an explanation of the returned reason codes.
Usage
Prerequisite
Before deleting an object instance, you must delete all relationships where the object instance contains other object instances.
Controlling updates to your information catalog
To keep your program as synchronized as possible with your information catalog, you should include a call to FLGCommit (see FLGCommit) after FLGRelation completes successfully. If FLGRelation does not complete successfully, include a call to FLGRollback (see FLGRollback).
Figure 136 shows the C language code required to call the FLGRelation API call to create a relationship defining objects contained by an object instance. In the sample code, MYBUSGP is an instance of a Business Group object type (a Grouping object), and IMAGE-A is an instance of an Image object type (an Elemental object).
Figure 136. Sample C language call to FLGRelation
APIRET rc; // Declare reason code
UCHAR pszSrcFLGID[FLG_ID_LEN + 1];
UCHAR pszTrgFLGID[FLG_ID_LEN + 1];
FLGRELTYPE RelType=FLG_CONTAINER_RELATION;
FLGRELOPTION RelOpt=FLG_CREATE_RELATION;
FLGEXTCODE ExtCode=0; // Declare extended code
.
. /* set values for pszSrcFLGID and pszTrgFLGID */
.
rc = FLGRelation (pszSrcFLGID,
pszTrgFLGID,
RelType,
RelOpt,
&ExtCode);