addParticipant()

Adds a new participant to a relationship instance.

Syntax

To add a new participant to an existing relationship instance:

int addParticipant
  (String relDefName,
 String partDefName,
 int instanceId,BusObj partData)
  
 int addParticipant
  (String relDefName, 
 String partDefName,
  int instanceId,String partData)
  
 int addParticipant
  (String relDefName,
 String partDefName,int instanceId,
 long partData)
  
 int addParticipant
  (String relDefName,
 String partDefName,int instanceId,
 int partData)
  
 int addParticipant
  (String relDefName,
 String partDefName,
 int instanceId, 
 double partData)
  
 int addParticipant
  (String relDefName,
 String partDefName,
 int instanceId, float partData)
  
 int addParticipant
  (String relDefName,
 String partDefName,
 int instanceId,
 boolean partData)
 

To add a participant to a new relationship instance:

int addParticipant
  (String relDefName, 
 String partDefName,
       BusObj partData)
 int addParticipant
  (String relDefName, 
 String partDefName,
       String partData)
 int addParticipant
  (String relDefName, 
 String partDefName,
       long partData)
 int addParticipant
  (String relDefName, 
 String partDefName,
       int partData)
 int addParticipant
  (String relDefName, 
 String partDefName,
       double partData)
 int addParticipant
  (String relDefName, 
 String partDefName,
       float partData)
 int addParticipant
  (String relDefName, 
 String partDefName,
       boolean partData)
 

To add an existing participant instance to a relationship instance:

int addParticipant(Participant participant)
 

Parameters

relDefName
Name of the relationship definition.
partDefName
Name of the participant definition.
instanceId
Relationship instance ID of the relationship instance to receive the new participant.
partData
Data to associate with the participant. Can be one of the following data types: BusObj, String, long, int, double, float, boolean.
participant
Participant to add to the relationship.

Return values

Returns an integer representing the instance ID of the relationship to receive the new participant.

Exceptions

RelationshipRuntimeException - See "Handling exceptions".

Notes

The first form of the method adds a new participant to the relationship instance you specify. Each variation supports a different data type for the data to associate with the participant.

The second form, since it does not specify a relationship instance, creates a new relationship instance and adds the new participant. In this case, the return value is the instance ID of the newly created relationship instance. Each variation supports a different data type for the data to associate with the participant.

The third form adds the participant instance you pass to the relationship instance specified in the participant instance. If the participant instance has no relationship instance ID, a new relationship instance is created and the new instance ID is returned.

The addParticipant() method is a class method declared as static. You can call this method from an existing relationship instance or by referencing the Relationship class.

See also

create()

Copyright IBM Corp. 2003