The core capability of a rational agent is to choose its next action in a rational fashion, a capability that can be put to good use by a designer to satisfy the design objectives of an agent system. In agent programming languages for rational agents, such choices are derived from the agent's beliefs and goals. At any one time, an agent can typically choose from multiple actions, which may all lead to goal achievement. Existing approaches usually select one of those actions non-deterministically. In this paper, we propose the use of goals as hard constraints and qualitative preferences as soft constraints for choosing a most preferred action among the available ones. We use temporal logic for the representation of various kinds of goals and preferences, leading to a uniform framework for integrating goals and preferences into agent programming.