The area of Urban Computing has emerged from the paradigm of Ubiquitous Computing. Urban Computing shares the same requirements with its predecessor. However, Urban Computing needs to support spontaneous social groups. Therefore, a key requirement of Urban Computing is spontaneity, which is about composing services during runtime, without having predefined templates of applications. This paper leverages the approach of task-oriented computing, in order to compose a task by extending an existing task template with new or substitute functionality. The inclusion of new functionality is realized by analyzing the history of task execution. The appropriateness of the task composition mechanism is illustrated by an example scenario in our campus.