@@ -7317,16 +7317,18 @@ public void addEntity(Entity srcent, Entity trgent, int xx)
73177317 private void reconstructAssociation(String ename1,
73187318 String ename2, int xs, int ys, int xe,
73197319 int ye, int c1, int c2, String role2,
7320- String role1, Vector stereotypes, Vector wpoints)
7320+ String role1, Vector stereotypes, Vector wpoints, Expression initExpr )
73217321 { Entity e1 =
73227322 (Entity) ModelElement.lookupByName(ename1,entities);
73237323 Entity e2 =
73247324 (Entity) ModelElement.lookupByName(ename2,entities);
7325+
73257326 if (e1 == null || e2 == null)
73267327 { System.out.println("!! Error in data, no entities " +
73277328 e1 + " " + e2);
73287329 return;
73297330 }
7331+
73307332 if ("null".equals(role1))
73317333 { role1 = null; }
73327334
@@ -7369,6 +7371,7 @@ else if (stereotypes.contains("qualified"))
73697371 ast.unsetQualifier();
73707372 ast.setQualifier(qatt);
73717373 }
7374+
73727375 if (stereotypes.contains("associationClass"))
73737376 { int acind = stereotypes.indexOf("associationClass");
73747377 if (acind + 1 < stereotypes.size())
@@ -7387,9 +7390,13 @@ else if (stereotypes.contains("qualified"))
73877390 }
73887391 }
73897392 }
7393+
73907394 System.out.println(">> Reconstructed association class: " + acent + " " + sline);
73917395 }
73927396
7397+ if (initExpr != null)
7398+ { ast.setInitialExpression(initExpr); }
7399+
73937400 associations.add(ast);
73947401 e1.addAssociation(ast);
73957402 if (role1 != null && role1.length() > 0)
@@ -15892,7 +15899,7 @@ else if (s.equals("Activity:"))
1589215899 (PreAssociation) preassociations.get(i);
1589315900 reconstructAssociation(p.e1name,p.e2name,p.xs,p.ys,
1589415901 p.xe,p.ye,p.card1,p.card2,
15895- p.role2,p.role1,p.stereotypes, p.wpoints);
15902+ p.role2,p.role1,p.stereotypes, p.wpoints, p.initialExpression );
1589615903 }
1589715904
1589815905 for (int j = 0; j < preentities.size(); j++)
@@ -16143,7 +16150,7 @@ else if (s.equals("Activity:"))
1614316150 (PreAssociation) preassociations.get(i);
1614416151 reconstructAssociation(p.e1name,p.e2name,p.xs,p.ys,
1614516152 p.xe,p.ye,p.card1,p.card2,
16146- p.role2,p.role1,p.stereotypes, p.wpoints);
16153+ p.role2,p.role1,p.stereotypes, p.wpoints, p.initialExpression );
1614716154 }
1614816155
1614916156 for (int j = 0; j < preentities.size(); j++)
@@ -17849,7 +17856,7 @@ private void loadKM3FromText(String xmlstring)
1784917856 reconstructAssociation(pa.e1name,pa.e2name,xs,ys,
1785017857 xe,ye,pa.card1,pa.card2,
1785117858 pa.role2, pa.role1, pa.stereotypes,
17852- new Vector());
17859+ new Vector(), pa.initialExpression );
1785317860 }
1785417861 }
1785517862
@@ -18019,7 +18026,7 @@ else if (oldtype instanceof Type)
1801918026
1802018027 reconstructAssociation(pa.e1name,pa.e2name,xs,ys,
1802118028 xe,ye,pa.card1,pa.card2,
18022- pa.role2, pa.role1, pa.stereotypes, new Vector());
18029+ pa.role2, pa.role1, pa.stereotypes, new Vector(), pa.initialExpression );
1802318030 }
1802418031 }
1802518032 }
0 commit comments