Universal Robots Forum

NOTICE: Behavioral change for isDefined and getTitle

In the PolyScope release of March 2019, we will perform a behavioral change in the URCaps API.
The change will not break compatibility with the API itself, but the behavior of some methods are affected, which can cause Exceptions to be thrown in some cases.

The implementation of the two overridden methods isDefined() and getTitle() in the Contribution-class has the purpose, of helping the user understand the purpose of the node, and whether this requires more data, to be valid.
The methods are called very frequently, and therefore these methods should by good practice only rely on existing values,. that are present in the DataModel.

To improve system performance, enforce good coding practice and increase the API robustness, some changes are planned to the URCaps implementation in PolyScope, that may affect existing URCaps.

Change planned:

Any modification to a) the DataModel or b) the child sub-tree within the scope of the overridden isDefined() or getTitle() calls in the Contribution will throw an Exception. This will occur, even if the changes are inside an UndoableChanges scope.

What you should do:

Ensure, that your URCap does not modify the DataModel or the child sub-tree within the methods isDefined() or getTitle().

General practice

The values returned by both methods, should solely rely on data retrieved from the DataModel.
No other actions should be performed in these methods.

Planned release:

March 1st 2019

2 Likes