Date: 2025-02-06
Version: v0.5.1
Status: 🔧 IN PROGRESS
The Topology Template already has full input/output support (API + template + property page UI), but there was a bug in the property page output validation that has been fixed. Node Templates do NOT support inputs/outputs per TOSCA v1.3 spec and should not be modified to add this support.
| Element | Inputs? | Outputs? | Spec Reference | Notes |
|---|---|---|---|---|
| Topology Template | ✅ YES | ✅ YES | TOSCA v1.3 § 5.9 | Parameters defining template inputs/outputs |
| Service Template | ✅ YES | ✅ YES | TOSCA v1.3 § 5.8 | Parameters at service level |
| Node Template | ❌ NO | ❌ NO | TOSCA v1.3 § 5.10 | Uses properties, requirements, capabilities instead |
| Node Type | ❌ NO | ❌ NO | TOSCA v1.3 § 5.11 | Uses properties, attributes, requirements, capabilities |
Key Distinction: Node templates use properties (set node type property values) and requirements, NOT input/output parameters.
All required methods exist in TTopologyTemplate:
// Input operations
public void addInputs(TParameter obj)
public List<TParameter> getInputs()
public boolean removeInputs(TParameter obj)
// Output operations
public void addOutputs(TParameter obj)
public List<TParameter> getOutputs()
public boolean removeOutputs(TParameter obj)File: src/main/java/fr/softeam/toscadesigner/api/tosca/standard/class_/TTopologyTemplate.java
Handlebars template includes outputs section (added in this session):
File: src/main/resources/fr/softeam/templates/TTopologyTemplate.hbs
Lines: 16-23 (outputs section added)
The property page TTopologyTemplatePropertyPage displays inputs/outputs in tabular format:
// Lines 138-151: Already defined UI for inputs/outputs
table.addProperty("Inputs", getToscaValue(members_elt),
getAddRemove(inputs, extractModelElements(this._element.getInputs())));
table.addProperty("Outputs", getToscaValue(members_elt),
getAddRemove(outputs, extractModelElements(this._element.getOutputs())));File: src/main/java/fr/softeam/toscadesigner/handlers/propertypages/topologyTemplate/TTopologyTemplatePropertyPage.java
Lines: 75-95, 138-151
Issue: Line 89 had incorrect stereotype check for outputs validation:
// BEFORE (Line 89 - WRONG):
if ((elt5 != null) && (elt5.isStereotyped(IToscaDesignerPeerModule.MODULE_NAME,
TNodeTemplate.STEREOTYPE_NAME))) { // ❌ WRONG - checking TNodeTemplate instead of TParameterFix Applied:
// AFTER (Line 89 - CORRECT):
if ((elt5 != null) && (elt5.isStereotyped(IToscaDesignerPeerModule.MODULE_NAME,
TParameter.STEREOTYPE_NAME))) { // ✅ CORRECTFile Modified: src/main/java/fr/softeam/toscadesigner/handlers/propertypages/topologyTemplate/TTopologyTemplatePropertyPage.java
Per TOSCA v1.3 spec, Node Templates:
- Do NOT have input/output parameters
- Use properties (values assigned to node type properties)
- Use requirements (resolved dependencies to capabilities)
- Use capabilities (derived from node type)
- Use attributes (derived from node type)
TNodeTemplate.java is generated from the Modelio UML model (see: "WARNING: GENERATED FILE - DO NOT EDIT" header). Since the model doesn't define inputs/outputs for node templates (correctly, per TOSCA spec), the proxy class doesn't have these methods.
Existing TNodeTemplate Property Page: src/main/java/fr/softeam/toscadesigner/handlers/propertypages/topologyTemplate/TNodeTemplatePropertyPage.java
Correctly shows:
- Name, Min/Max Instances
- Node Type reference
- Requirements, Deployment Artifacts
Does NOT show (and should not):
- Inputs/Outputs (not in TOSCA spec)
Note: The existing property page UI is for editing properties of an already-created element. The user's original request mentioned "buttons in the palette of that diagram editor" for creating inputs/outputs in the diagram.
This requires separate diagram tool registration (palette buttons), which is distinct from property page UI.
Status: Not yet addressed in this session - requires finding Modelio diagram action registration mechanism.
Maven build in progress (packaging JAR with fixes).
Expected outcome: ✅ Build should complete successfully with the property page bug fix.
- Maven build completes successfully (Exit Code: 0)
- Topology template with inputs/outputs exports correctly to YAML
- Property page correctly validates and adds/removes TParameter inputs
- Property page correctly validates and adds/removes TParameter outputs (bug fix verification)
- Export example file with inputs/outputs and verify structure
| Component | Status | Location |
|---|---|---|
| TTopologyTemplate API | ✅ Complete | api/tosca/standard/class_/TTopologyTemplate.java |
| Handlebars Template | ✅ Complete | resources/fr/softeam/templates/TTopologyTemplate.hbs |
| Property Page UI | ✅ Complete (Bug Fixed) | handlers/propertypages/topologyTemplate/TTopologyTemplatePropertyPage.java |
| TNodeTemplate API | ✅ Not Needed | N/A - TOSCA spec compliant (no I/O) |
| Diagram Palette Buttons | ⏳ Not Addressed | Requires separate investigation |
- Verify the build completes successfully with the property page bug fix
- Test the topology template inputs/outputs in the property page UI
- Export and validate YAML output includes inputs/outputs sections
- Document to users that Node Templates correctly do NOT support inputs/outputs per TOSCA v1.3
- Optional: If users need to create inputs/outputs via diagram palette buttons (separate UI feature from property pages), investigate Modelio diagram action registration mechanism
- TTopologyTemplate.hbs - Added outputs rendering section
- TTopologyTemplatePropertyPage.java - Fixed output validation bug (Line 89)