Yii Dynamical Validation. Is There Another Way?

I have some model. Depending on value of typeId some params should be required

    typeId=1	Required:		param2	param3	param4	param5	param6	param7		param9	

    typeId=2	Required:	param1		param3	param4	param5					

    typeId=3	Required:	param1		param3					param8	param9	

    typeId=4	Required:	param1		param3							

    typeId=5	Required:	param1									param10

So i solved it in this way:

    public function rules()


        return array(

            array('typeId, param1, param2', 'numerical', 'integerOnly'=>true),

            array('param3, param4, param5, param6, param7, param8, param9', 'length', 'max'=>20),

            array('param10, param11', 'length', 'max'=>255),

            array('created, deleted', 'safe'),


            array('typeId', 'required', 'on'=>'insert, update'),

            array('typeId', 'exist', 'attributeName'=>'id', 'className'=>'Type', 'message'=>'Select {attribute}'),


            array('id, typeId, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, created, deleted', 'safe', 'on'=>'search'),            


            //dynamic rules


            array('param1', 'required', 'on'=>'type2, type3, type4, type5'),

            array('param1', 'exist', 'attributeName'=>'id', 'className'=>'Param1', 'message'=>'Select {attribute}', 'on'=>'type2, type3, type4, type5'),


            array('param2', 'required', 'on'=>'type1'),

            array('param2', 'exist', 'attributeName'=>'id', 'className'=>'Param2', 'message'=>'Select {attribute}', 'on'=>'type1'),

            array('param3', 'required', 'on'=>'type1, type2, type3, type4'),

            array('param4', 'required', 'on'=>'type1, type2'),

            array('param5', 'required', 'on'=>'type1, type2'),

            array('param6', 'required', 'on'=>'type1'),

            array('param7', 'required', 'on'=>'type1'),

            array('param8', 'required', 'on'=>'type3'),


            array('param9', 'required', 'on'=>'type1, type3'),

            array('param10', 'required', 'on'=>'type5'),





    public function validate($attributes=null, $clearErrors=true)






            foreach($this->getValidators() as $validator)



            //validate dynamic rules






                    foreach($this->getValidators() as $validator)






            return !$this->hasErrors();



            return false;



    public function getSubscenario($typeId)




            case Signal::TYPE_1:

                return 'type1';

            case Signal::TYPE_2:

                return 'type2';

            case Signal::TYPE_3:

                return 'type3';

            case Signal::TYPE_4:

                return 'type4';

            case Signal::TYPE_5:

                return 'type5';


                return false;



Is there another way?