Skip to content

(core): remove extraction of sub-objects in activities requirements

Description

Now, when defining a requirement in an activity, there is no need to define a corresponding AppConfig parameter to "replace" it with the corresponding key. In short, the same key is used for the requirement and the parameter, and there is no need to give a complicated object "path":

  • Before:
    <!-- Activity used to export a model series. -->
<extension implements="sight::activity::extension::Activity">
...
    <requirements>
        <requirement name="modelSeries" type="sight::data::ModelSeries" minOccurs="1" maxOccurs="1" />
    </requirements>        
    <appConfig id="xxx">
        <parameters>
            <parameter replace="model" by="@values.modelSeries" />
        </parameters>
    </appConfig>
</extension>
  • After:
<extension implements="sight::activity::extension::Activity">
...
    <requirements>
        <requirement name="modelSeries" type="sight::data::ModelSeries" minOccurs="1" maxOccurs="1" />
    </requirements>        
    <appConfig id="xxx" />
</extension>

Limitation

However, this simplification implies some limitations:

  1. The key must match for both requirement and AppConfig parameter. There is no way to "replace" them on the fly like before. We really believe this is fine as the ability to have a different name only complicate both xml (you need to specify the "mapping") and C++ code, with no real added value.
  2. As we can only access to the "required" object, we cannot "walk" through the object hierarchy and extract sub-objects. For example, it is no more possible to have an Image as AppConfig parameter which is extracted from a required ImageSeries. This can be easily adapted with the use of the new extraction services (SGetImage, SGetMesh, ...) in AppConfig code.

Closes #824 (closed)

How to test it?

  • Launch unit tests
  • Try ExActivities, ExDicomSegmentation (VTKMesher activity)
Edited by Didier WECKMANN

Merge request reports