Hi,
I’m implementing Product Line Engineering where I need to derive specific product instances from a configurable base model. My goal is to:
1. Load a base model with variable configuration (e.g., `[0..*]` multiplicity)
2. Read a feature configuration that specifies concrete values (e.g., `[4]`)
3. Programmatically generate a derived product model with fixed configuration
When I try to create the derived model using the API and serialize it with `syside.pprint()`, I get:
RuntimeError: Specialization can only be printed in KerML mode
### Base Model (base.sysml)
package VehiclePLE {
part def Wheel { }
// 150% base with variable multiplicity
part def Vehicle_Base {
part wheels : Wheel [0..*];
}
}
### Feature Configuration (using PLEML library from SysAND)
```sysml
#featureConfiguration def Sedan_Config :> VehicleProductLine {
#feature :>> useWheels \[4\]; // Specifies exactly 4 wheels for this product
}
```
### Programmatic Derivation
```python
# Load model and find base
model = syside.try_load_model([“base.sysml”, “features.sysml”])
base_vehicle = # … find Vehicle_Base
# Create derived 100% model
_, sedan = pkg.children.append(syside.OwningMembership, syside.PartDefinition)
sedan.declared_name = “Sedan_100”
# Add specialization (:> Vehicle_Base)
sedan.heritage.insert(0, syside.Specialization, base_vehicle)
# Add redefinition (part redefines wheels [4])
base_wheels = # … find wheels in base_vehicle
_, wheels_redef = sedan.children.append(syside.FeatureMembership, syside.PartUsage)
wheels_redef.declared_name = “wheels”
wheels_redef.heritage.insert(0, syside.Redefinition, base_wheels)
# Try to serialize - FAILS
output = syside.pprint(sedan) # RuntimeError: Specialization can only be printed in KerML mode
All API calls succeed and the model exists in memory, but serialization to SysML v2 fails.
### Questions
1. Is programmatic product derivation (creating specialized instances from a base model) a supported use case?
2. If so, how can I serialize the derived model to SysML v2 format?
Thanks!
