final Collection<Activity > cactivity = process.getAllActivities (); for (Activity acty : cactivity) { Element activi= new Element("activity"); racine.addContent(activi); Attribute id = new Attribute("idref",acty.getId()); activi.setAttribute(id); Element time = new Element ("time"); time.setText(Integer.toString(acty.getTime())); activi.addContent(time); }  this.doc = document;
final Collection<Activity> cactivity = process.getAllActivities(); for (Activity acty : cactivity) { Element activi = new Element("activity"); racine.addContent(activi); Attribute id = new Attribute("idref", acty.getId()); activi.setAttribute(id); Element time = new Element("time"); time.setText(Integer.toString(acty.getTime()));  activi.addContent(time);  HashMap hashmap = acty.getHM(); Set s = hashmap.keySet(); Iterator its  = s.iterator();  while(its.hasNext()) { Integer key = (Integer) its.next(); Element iteration = new Element("iteration"); activi.addContent(iteration); Attribute idit = new Attribute("id_ite", key.toString() ); iteration.setAttribute(idit); TimeCouple tc = acty.gethmTime(key); Element timeElapsed = new Element("timeElapsed"); timeElapsed.setText(Integer.toString(tc.getTimeElapsed())); iteration.addContent(timeElapsed); Element timeRemaining = new Element("timeRemaining"); timeRemaining.setText(Integer.toString(tc.getTimeRemaining ())); iteration.addContent(timeRemaining); } Element done = new Element("done"); done.setText(Boolean.toString(acty.getDone())); activi.addContent(done); }  this.doc = document;
	public void loadModel(Process process)	{		final Element racine = new Element("stats");		final Document document = new Document(racine);        // r?cup?ration des activit?s via le processus        final Collection<Activity > cactivity = process.getAllActivities ();        for (Activity acty : cactivity)        {        	 Element activi= new Element("activity");             racine.addContent(activi);             Attribute id = new Attribute("idref",acty.getId());             activi.setAttribute(id);             Element time = new Element ("time");             time.setText(Integer.toString(acty.getTime())); // Cast Int - Integer -> string             activi.addContent(time);        }                    this.doc = document;			}