diff --git a/vizoozie/vizoozie.py b/vizoozie/vizoozie.py old mode 100644 new mode 100755 index 56248bf..150cc4b --- a/vizoozie/vizoozie.py +++ b/vizoozie/vizoozie.py @@ -29,9 +29,15 @@ def getAttribute(self, node, attributeName): def getOK(self, node): ok = node.getElementsByTagName("ok")[0] return ok - + + def getError(self, node): + e = node.getElementsByTagName("error")[0] + return e + def processHeader(self, name): - output = "digraph{\nsize = \"8,8\";ratio=fill;node[fontsize=24];labelloc=\"t\";label=\"" + name + "\";\n" + parts = name.split('/') + wf_name = parts[-2] + output = "digraph{\nsize = \"8,8\";ratio=fill;node[fontsize=40];labelloc=\"t\";fontsize=80;label=\"" + wf_name + "\";\n" return output def processStart(self, doc): @@ -48,12 +54,20 @@ def processAction(self, doc): color = "white" for key, value in self.properties.iteritems(): if len(node.getElementsByTagName(key)) != 0: - color = value + if 'DoneMarker' in name: + color = 'cyan' + elif 'Poll' in name: + color = 'red' + else: + color = value break ok = self.getOK(node) - to = self.getTo(ok) + e = self.getError(node) + to_ok = self.getTo(ok) + to_error = self.getTo(e) output += '\n'+name.replace('-', '_') + " [shape=box,style=filled,color=" + color + "];\n" - output += '\n'+name.replace('-', '_') + " -> " + to.replace('-', '_') + ";\n" + output += '\n'+name.replace('-', '_') + " -> " + to_ok.replace('-', '_') + " [fontsize=40,label=ok,color=green];\n" + output += '\n'+name.replace('-', '_') + " -> " + to_error.replace('-', '_') + " [fontsize=40,label=err,color=red];\n" return output def processFork(self, doc):