Set Progress status using Capella-Groovy

Hello everyone,

I’m looking for a way to set elements progress status using script (I’m using capella-groovy addon made by Felix Dorner). For example : an element status is ‘TO_BE_REVIEWED’ as shown on the picture below

I want to set the status ‘REVIEWED_OK’ using capella-groovy.

I tried with the method setStatus(). But I could just free the status (set it to the default null state) by typing ‘element.setStatus()’. I got this result :

The problem came when I tried to choose a status (by typing for example element.setStatus(‘REVIEWED_OK’), the following exception message appears :

So I tried with this syntaxe : element.setStatus(org.polarsys.capella.core.data.capellacore.EnumerationPropertyLiteral)
When I type this, their no exception message, but nothing happens. The status stay the same.

I think a more general question is : how to manipulate “Enumeration Property Literal” objects and their containers, “Enumeration Property Type” using capella-groovy ?

If anybody has an idea on how to deal with this, please, let me know.

Thanks a lot,
Christian KOUMLAH MBEY

Try to go to capella preferences, and open the node Capella->Project Explorer and select “Project” under displayable Capella concepts. You will now see some additional Elements in the explorer that were previously hidden. One of these elements is an EnumeratinPropertyValue named “ProgressStatus”, with the children literals DRAFT, …

When you set the progress status on any Capella element, what actually happens that the field stores a reference to the corresponding element in the current capella project.

If you want to do that in Groovy, you will first need to find these literals, and then set the reference to one of these values.

Copyright © Eclipse Capella, the Eclipse Capella logo, Eclipse and the Eclipse logo are Trademarks of The Eclipse Foundation.