Hi Yasmine,
Please use diagram’s save method which helps to serialize the Diagram as JSON. This JSON data can be converted to string and stored for future use. Please refer to the code example and help documentation.
Code example:
var diagram = $("#ejControl_0").ejDiagram("instance");
//get the serialized JSON
var savedDiagram = diagram.save();
//stringify the serialized JSON
var string = JSON.stringify(savedDiagram);
Regards,
Shyam G