Parsing and running rules with metadata