def validate!
      errors = []
      errors << "Name must be specified" unless @name
      errors << "Definition or tree must be specified" unless @definition || @tree
      begin
        build_tree!
      rescue Invalid
        errors << "Definition is not a valid process definition"
      end
      raise Invalid, "Validation failed: #{errors.join(', ')}" unless errors.empty?
      true
    end
def validate!
      errors = []
      errors << "Name must be specified" unless @name
      errors << "Definition or tree must be specified" unless @definition || @tree
      begin
        build_tree!
      rescue Invalid
        errors << "Definition is not a valid process definition"
      end
      raise Invalid, "Validation failed: #{errors.join(', ')}" unless errors.empty?
      true
    end
@public
 Initialize a new ProcessDefinition, supplying a name (required), and
 definition or a tree (one of which is required).  The definition should
 be a string with a Bumbleworks.define_process block, and the tree should
 be an actual Ruote tree.

 @public
 Validates the ProcessDefinition by checking existence and uniqueness of
 name, existence of one of definition or tree, and validity of definition.
 Raises a Bumbleworks::ProcessDefinition::Invalid exception if errors are
 found, otherwise returns true