When creating a model variant, the failure mode Effects are included in the variant, but the failure mode Causes are not. For Causes that come from an Error Collection this is a lot of additional work for a variant model with > 100 components and > 200 failure modes.
I've written the attached script that matches variant component and failure mode names with the original model, and using Factory.createRelation I'm able to get the Causes assigned for small models. The variant model failure mode causes match the original and are visible in the UI, as expected, after the script runs
However, while the script reports that it is assigning causes to failure modes when run against large models, the Causes are not visible in the UI after the script completes.
I don't know if there is some memory issue I'm running into with large models, but it fails to assign a single cause and the error log does not report any memory issues. Medini continues to function normally.
Is there something I'm missing in the script or something else I need to consider to get this working against larger models?