Added logic to check the state owner type coherence for rule effect and selected goal state while selecting the right rule.