Hi,
this is some fragment of my code to generate file .uml (with Topcased 2.0
is work correctly). This code generate this same file .uml with Topcased
2.0 and Topcased 2.1. But witth Topcased 2.1 the "UML Model with TOPCASED"
function don't generate file .umldi correctly. My code I put in Sample
Service (example from Topcased).
public static void createClassDiagram(String selectedDiagram) {
ResourceSet resourceSet = new ResourceSetImpl(); // Create a
resource set
Resource resource =
resourceSet.getResource(URI.createPlatformResourceURI(selectedDiagram.toString()),
true);
Resource r = resourceSet.createResource( //tworzenie diagramu
UML
URI.createPlatformResourceURI(
resource.getURI().toPlatformString(true).substring(1,
resource.getURI().toPlatformString(true).length()-
resource.getURI().fileExtension().length())+"uml", true));
Package package_ = UMLFactory.eINSTANCE.createPackage();
r.getContents().add(package_);
package_.setName(resource.getURI().lastSegment()+"Packet");
Class clazz=null;
if(!resource.getURI().fileExtension().toString().equalsIgnoreCase("dodokum"))
{
System.out.println("Bez diagramu:
"+resource.getURI().fileExtension().toString());
return;
}
//pomocnicze tabelki
Map<Integer, Class> mObiekty = new HashMap<Integer, Class>();
//Przeplyw(#)-Class
Map<Integer, Dokument> mDokumenty = new IdentityHashMap<Integer,
Dokument>(); //Przeplyw(#)-Dokument
Map<Przeplyw, String> lPrzeplywy = new HashMap<Przeplyw,
String>(); //Przeplyw(object)-label
Map<Integer, Decyzja> mDecyzje = new HashMap<Integer,
Decyzja>(); //Przeplyw(#)-Decision
Map<Integer, Dokument> mDoki = new IdentityHashMap<Integer,
Dokument>(); //Przeplyw(#)-Dokument
TreeIterator<EObject> iterator = resource.getAllContents();
//petla
po wszystkich zasobach DOD
while (iterator.hasNext()) {
EObject object = iterator.next();
if(object instanceof Obiekt) {
// create classes
clazz = UMLFactory.eINSTANCE.createClass();
clazz.setPackage(package_);
clazz.setName(((Obiekt) object).getNazwa());
ListIterator<Zwiazek> it = ((Obiekt)
object).getZwiazki().listIterator();
while(it.hasNext())
mObiekty.put(((Zwiazek)
it.next()).hashCode(), clazz);
} else {
.............
.............
.............
} }
Iterator itPrz = lPrzeplywy.entrySet().iterator();
while(itPrz.hasNext()) { //przeglądanie przepływów
......
......
......
......
if(cl1!=null && cl2!=null && !cl1.equals(cl2)) { //
tutaj możemy
tworzyć asocjacje dla klas!!!
Iterator itPrz2 =
lPrzeplywy.entrySet().iterator();
Map.Entry pairsP2 = null;
while(itPrz2.hasNext()) { //przeglądanie
przepływów
pairsP2 = (Map.Entry) itPrz2.next();
if(((Integer)
pairsD2.getKey()).equals((Integer)
pairsP2.getKey().hashCode())) {
break;
}
}
createAssociation(cl1, true,
AggregationKind.NONE_LITERAL, "przeplyw"
+pairsP2.getValue().toString().toLowerCase(), 1, 1,
cl2, false,
AggregationKind.NONE_LITERAL,
"przeplyw"+pairsP.getValue().toString().toLowerCase(), 1, 1);
}
}
try {
r.save(null) ;
}
catch (IOException e) {
e.printStackTrace() ;
}
System.out.println("Class Diagram generated:"+r .getURI());
}
On Pt Września 12 2008, 9:08 am, Raphael FAUDOU wrote:
> Hi Jurek,
> could you post your model or a simplified model that illustrates this
> regression? It will help us investigate,
> thanks TOPCASED team
>
>
> J.Niepostyn a écrit :
>
>> Hi,
>> with Topcased 2.0 I created .umldi without any problems. With Topcased
>> 2.1 I created .umldi, but without associations (only classes).
>> Is there some bug ?
>> Regards,
>> Jurek.
>>
>>
>>
>> _______________________________________________
>> Topcased-users mailing list
>> [email protected]
>> http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users
>>
>>
>>
>>
>
> -
>
>
>
> _______________________________________________
> Topcased-users mailing list
> [email protected]
> http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users
_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users