Information Catalog Manager Programming Guide and Reference

FLGRelation

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

pszSrcFLGID (PSZ) -- input
Points to the 16-character, system-generated unique identifier of the source object instance.

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:

Attachment relationship
FLGID of a non-Attachment category object instance to which a Comments is being attached or detached

Contact relationship
FLGID of an Elemental or Grouping category object instance for which a Contact is being defined or removed

Contains relationship
FLGID of the Grouping category container object instance

Link relationship
FLGID of an Elemental or Grouping category object instance for which a peer relationship with another object instance is to be created or deleted

pszTrgFLGID (PSZ) -- input
Points to the 16-character, system-generated unique ID of the target object. This includes the 6-character object type ID and the 10-character instance ID. The FLGID you specify depends on the type of relationship you want to create or delete:

Attachment relationship
FLGID of an Attachment category object instance being attached or detached

Contact relationship
FLGID of a Contact category object instance being defined or removed

Contains relationship
FLGID of the Elemental or Grouping category object instance being added or removed from the Grouping source container

Link relationship
FLGID of an Elemental or Grouping category object instance for which a peer relationship with another object instance is to be created or deleted

RelType (FLGRELTYPE) -- input
Identifies the type of relationship being created or deleted. Valid values are:
A
Attachment
C
Contains
L
Link
T
Contact

RelOpt (FLGRELOPTION) -- input
Specifies the action being performed. Valid values are:
C
Create the relationship
D
Delete the relationship

pExtCode (PFLGEXTCODE) -- output
Points to an extended code associated with the reason code. See Appendix D, Information Catalog Manager reason codes to see if a meaningful extended code is associated with the returned reason code.

Reason code (APIRET)
Represents the execution result of this API call.

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).

Examples

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);
 


[ Top of Page | Previous Page | Next Page ]