首页 > 解决方案 > Can't add InputPin as a Node of an Activity (Eclipse/Epsilon)

问题描述

I'm writing a model-to-model transformation at the moment. Here is a part of my ETL file:

rule process2activity
    transform p : input!Process                 
    to a : UMLOutput!Activity{

    ...

    var ip : new UMLOutput!InputPin;    
    var op : new UMLOutput!OutputPin;


    ip.activity = a;                    
    op.activity = a;
    ...
}

When I validate my output, I get: "The opposite features 'activity' of 'Input Pin' and 'node' of 'Activity test' do not refer to each other".

The "activity" feature of my Input Pin is displayed correctly. However, the "node" feature of my Activities are empty.

What is strange though is that when I try this:

a.nodes.println();

I DO get both Pins returned. But they do not show up in the "Properties" window of my model.

Any ideas?

标签: eclipseumlmodelingemfecore

解决方案


没有元模型信息很难判断。似乎活动节点是1:1的相反关系。所以op.activity = a实际上导致activity从ip.activity关系中移除,即activity只能与一个pin相关。


推荐阅读