자산의 새 버전을 사용할 수 있게 되면 자산 관계가 자동으로 조정될 수 있습니다. 자산 간 관계에 대해 RelationshipRange가 설정될 수 있습니다. 범위는 관련 자산의 허용 가능한 최저 및 최고 버전을 지정합니다. 이 관계가 이 범위의 모든 자산을 가리켜야 하는지 아니면 해당 범위에서 최고 승인 버전의 자산만 가리켜야 하는지를 나타내는 플래그가 있습니다.
//Create a relationship range
RelationshipRange relationshipRange = new RelationshipRange();
relationshipRange.setHighestVersion("2.0");
relationshipRange.setHighestVersionType(RelationshipRange.LESS_THAN);
relationshipRange.setLowestVersion("1.5");
relationshipRange.setLowestVersionType(RelationshipRange.GREATER_THAN_OR_EQUAL_TO);
//Only relate to the highest version asset in the range
relationshipRange.setType(RelationshipRange.HIGHEST_VERSION);
//Creating/updating an asset relationship that has a range
RAMRelationship[] relationships = asset.setRelationshipRange(existingAsset, newRelationshipType, relationshipRange);
//Fetch relationship range
relationshipRange = relationships[0].getRelationshipRange();
//Remove relationship range
asset.removeRelationshipRange(existingAsset, newRelationshipType);