Skip to content

Commit

Permalink
chore: allow to delete outgoing relationships filtered by their name
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGiulianelli committed Mar 7, 2023
1 parent f547bea commit 13c4ed8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ class DigitalTwinManager : RoomDigitalTwinManager, MedicalTechnologyDigitalTwinM
}
}

private fun DigitalTwinsClient.deleteOutgoingRelationships(sourceId: String) {
private fun DigitalTwinsClient.deleteOutgoingRelationships(sourceId: String, relationshipName: String? = null) {
this.listRelationships(sourceId, BasicRelationship::class.java).forEach {
this.deleteRelationship(it.sourceId, it.id)
if (relationshipName == null || it.name == relationshipName) {
this.deleteRelationship(it.sourceId, it.id)
}
}
}

Expand Down

0 comments on commit 13c4ed8

Please sign in to comment.