User centricity required by ubiquitous computing is about making services and information be prepared and delivered in the perspective of users rather than system elements. Task-oriented computing supports user centricity by representing users' goals in tasks. It bridges the gap between tasks and available services. This paper proposes a semantically-based generic model for describing tasks in ubiquitous computing environments. This model is used by a task selection algorithm that considers the context information of a user and the Surrounding environment. Additionally, this paper proposes a pattern-based task reconfiguration algorithm. The algorithms are illustrated by a demo application conducted in our test bed, and by other examples of tasks selected under diverse situations. Evaluation results show a reasonable time overhead for the task selection algorithm.