Commit 9913e8ae authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add metadata to the graph

parent d4aa8f19
......@@ -183,7 +183,8 @@ if __name__ == '__main__':
elif args["cmd_object"] == "rerun":
wfmanager.rerun_workflow(args["workflow_id"])
elif args["cmd_object"] == "execution_graph":
print wfmanager.get_workflow_execution_graph(args["workflow_id"])
workflow = wfmanager.get_workflow(args["workflow_id"])
print workflow.get_execution_graph()
elif args["cmd_object"] == "status":
if args["workflow_id"]:
workflow = wfmanager.get_workflow(args["workflow_id"])
......
......@@ -291,12 +291,14 @@ class JFlowServer (object):
@jsonify
def get_workflows_status(self, **kwargs):
if kwargs.has_key("workflow_id"):
workflow = self.wfmanager.get_workflow(kwargs["workflow_id"])
if kwargs["display"] == "list":
workflow = self.wfmanager.get_workflow(kwargs["workflow_id"])
return self.jsonify_workflow_status(workflow)
elif kwargs["display"] == "graph":
g = self.wfmanager.get_workflow_execution_graph(kwargs["workflow_id"])
return {"edges": g.edges(), "vertices": g.vertices()}
g = workflow.get_execution_graph()
status = self.jsonify_workflow_status(workflow)
status["edges"] = g.edges()
return status
else:
status = []
workflows = self.wfmanager.get_workflows()
......
......@@ -112,10 +112,6 @@ class WorkflowsManager(object):
def get_output_directory(self):
return self.config_reader.get_work_directory()
def get_workflow_execution_graph(self, workflow_id):
workflow = self.get_workflow(workflow_id)
return workflow.get_execution_graph()
def get_workflows(self):
workflows = []
......
......@@ -158,7 +158,10 @@
$this.$element.html(alert_message);
},
success: function(data) {
console.log(data)
// prepare the container
$this.$element.html("");
$this.$element.height(500);
......@@ -167,10 +170,8 @@
// prepare the data
var nodes = new Array(),
edges = new Array();
for (var i in data.vertices) {
if (data.vertices[i] != null) {
nodes.push({ data: { id: data.vertices[i], name: data.vertices[i] } });
}
for (var i in data.components) {
nodes.push({ data: { id: data.components[i].name, name: data.components[i].name} });
}
for (var i in data.edges) {
if (data.edges[i][0] != null && data.edges[i][1] != null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment