This is the rules engine's details. You could use it to build the logic and traversal in whatever language you like.