DROOLS-236: BZ-1000385: BZ-1000384: fixing serialization when TMS is dinamically enabled/disabled
(cherry picked from commit 6476b17d45728092b6d0f9ccaf2ea25b3e21bdea)