Author Topic: How to transform connector of sysml-ibd with transformation templates or scripts  (Read 1506 times)

Kenny

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Hi,
I have several sysml internal block diagrams, where I connected the ports of block instances with "connectors". I want to generate a script from these IBD and get the connection information. I tried with transformation templates (section Connector), but no success. Also, with EA scripts, it is not possible to get the connection information. If I call  Repository.GetTreeSelectedObject().Connectors.Count, I get 0. The only way that I can see at the moment is to export XMI file from the package. However, I have to write some XMI parser to do my job. Does anyone know how to use EA functionality to extract connectors from block/class instances? From the XMI file, it seems that the information is part of the block/class instance.

Code: [Select]
<packagedElement xmi:type="uml:InstanceSpecification" xmi:id="EAID_6CEF6ED8_62D2_4e4b_9B7A_DEA66884003C" name="BUS" visibility="public" classifier="EAID_F50B1D1C_9B67_4a29_A13A_CCCC303059C1">
    <ownedPort xmi:type="uml:Port" xmi:id="EAID_E429196D_FDA1_4c66_BBBC_1C425296A4B0" name="ISOCKET" visibility="public" aggregation="composite" isService="true" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false">
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="EAID_LI000001_FDA1_4c66_BBBC_1C425296A4B0" value="1"/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="EAID_LI000002_FDA1_4c66_BBBC_1C425296A4B0" value="-1"/>
    </ownedPort>
    <ownedPort xmi:type="uml:Port" xmi:id="EAID_68C4CF3E_D92D_4cf3_A842_F3DBAB84CBE8" name="OSOCKET" visibility="public" aggregation="composite" isService="true" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false">
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="EAID_LI000003_D92D_4cf3_A842_F3DBAB84CBE8" value="1"/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="EAID_LI000004_D92D_4cf3_A842_F3DBAB84CBE8" value="-1"/>
    </ownedPort>
    <ownedConnector xmi:type="uml:Connector" xmi:id="EAID_4C9AFDEE_B1A6_42be_BC54_5DC86BD5DFB0" visibility="public">
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_SC000000_B1A6_42be_BC54_5DC86BD5DFB0" role="EAID_68C4CF3E_D92D_4cf3_A842_F3DBAB84CBE8"/>
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_DS000000_B1A6_42be_BC54_5DC86BD5DFB0" role="EAID_14D75233_4334_4331_AC67_F06398E9AD6E"/>
    </ownedConnector>
    <ownedConnector xmi:type="uml:Connector" xmi:id="EAID_60A940D5_CDD3_4b79_9ADE_D813294BC5D1" visibility="public">
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_SC000000_CDD3_4b79_9ADE_D813294BC5D1" role="EAID_68C4CF3E_D92D_4cf3_A842_F3DBAB84CBE8"/>
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_DS000000_CDD3_4b79_9ADE_D813294BC5D1" role="EAID_F8EB2E55_11B0_4935_9AAA_7ADF039A22A3"/>
    </ownedConnector>
    <ownedConnector xmi:type="uml:Connector" xmi:id="EAID_BEBF7DC1_AC76_4f13_8136_88923A750ABB" visibility="public">
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_SC000000_AC76_4f13_8136_88923A750ABB" role="EAID_68C4CF3E_D92D_4cf3_A842_F3DBAB84CBE8"/>
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_DS000000_AC76_4f13_8136_88923A750ABB" role="EAID_A599B2F7_E8EC_457c_A1C4_22D321169A42"/>
    </ownedConnector>
    <ownedConnector xmi:type="uml:Connector" xmi:id="EAID_F9DE3785_4D91_4229_B48C_EF67B66A090C" visibility="public">
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_SC000000_4D91_4229_B48C_EF67B66A090C" role="EAID_68C4CF3E_D92D_4cf3_A842_F3DBAB84CBE8"/>
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_DS000000_4D91_4229_B48C_EF67B66A090C" role="EAID_FA5761EE_9714_469a_92A8_B82702FDEF38"/>
    </ownedConnector>
</packagedElement>
« Last Edit: July 25, 2016, 07:46:18 pm by Kenny »