setInstanceId()

Sets the instance ID of the relationship in which the Participant instance is participating.

Syntax

void setInstanceId(int id)
 

Parameters

id
Instance ID of the relationship.

Return values

None.

Exceptions

RelationshipRuntimeException - See "Handling exceptions".

Notes

One use of setInstanceId() is to remove the relationship instance ID when you want to pass a participant instance as a parameter to the

Participant() or create() methods. In this case, you set the instance ID to the constant INVALID_INSTANCE_ID.

Examples

// wipe out the relationship instance ID
 myParticipant.setInstanceId(Participant.INVALID_INSTANCE_ID);
  
 // pass the participant instance to the create() method
 int newRelId = create(myParticipant);
 

See also

getInstanceId(), Creating relationship definitions, "Transforming with a submap"

Copyright IBM Corp. 2003