Software systems execute tasks that depend on different types of resources. However, the variability of resources may interfere with the ability of software systems to execute important tasks. In this paper, we present a proactive and reactive resource-driven adaptation framework that supports different types of resources and is based on the prioritisation of tasks. In our previous work, we defined a task modelling notation called SERIES. This paper builds on that notation and focuses on the adaptation process to improve resource utilisation by substituting tasks with their variants, substituting resources with alternative ones, executing tasks in a different order, or cancelling the execution of low-priority tasks. The framework was evaluated in terms of the percentage of executed critical task requests, average criticality of the executed task requests in comparison to the non-executed ones, overhead, and scalability. The evaluation was executed using two datasets related to a medicine consumption system and a manufacturing system. The evaluation results showed that the proposed framework increased the number of executed critical task requests and the average criticality of the executed task requests under resource variability with marginal overhead.