Apparatus and method for controlling a powertrain system