def undo(self, ignore_files=False): Container.put("is_undo", True) ticket = self.get_value("ticket", no_exception=True) try: xml = self.get_xml_value("transaction") nodes = xml.get_nodes("transaction/*") nodes.reverse() # if there is an error, report it but do what you can for node in nodes: node_name = xml.get_node_name(node) if node_name == "sobject": SObjectUndo.undo(node) elif not ignore_files and node_name == "file": FileUndo.undo(node, ticket) elif node_name == "table": action = Xml.get_attribute(node, "action") if action == 'drop': TableDropUndo.undo(node) else: TableUndo.undo(node) elif node_name == "alter": AlterTableUndo.undo(node) finally: Container.put("is_undo", False)
def undo(my, ignore_files=False): Container.put("is_undo", True) ticket = my.get_value("ticket", no_exception=True) try: xml = my.get_xml_value("transaction") nodes = xml.get_nodes("transaction/*") nodes.reverse() # if there is an error, report it but do what you can for node in nodes: node_name = xml.get_node_name(node) if node_name == "sobject": SObjectUndo.undo(node) elif not ignore_files and node_name == "file": FileUndo.undo(node, ticket) elif node_name == "table": action = Xml.get_attribute(node,"action") if action == 'drop': TableDropUndo.undo(node) else: TableUndo.undo(node) elif node_name == "alter": AlterTableUndo.undo(node) finally: Container.put("is_undo", False)