Expressions - try-catch (or try-except) clause
in any expression, is there a way to use the try-catch (try-except) clause? If yes, what is the syntax?
The reason why I need it:
If we have the code with getXPath including filter syntax
If there was 1 item found, an object pointing directly to that item will be returned (for example, no "size()" method is then available).
However, if there were 2 or more items found, a list will be returned (".size()" method IS available and we need that one!).
So we need to handle that.
Let me also state that this inconsistent behaviour above is not good... a list should be returned every time, not sometimes object, sometimes list... as there is then twice the work required as two separate blocks of code need to be written, one in case of one found item (returned object) and on in case if two or more found items (returned list) + additional handling... might report it as an idea to get fixed in next versions...
PS: I didn't select a "Category" for this topic as from all of the available options none seems to be relevant directly to expressions (nevertheless if it's for validation, actions, execution script on entry/save/exit...) in Bizagi.
My Bizagi Studio version: 11.2.5.0528 (July 26, 2021).