Driven/flexible parts (assembly and sub-assembly)

Hello.

 

I need help and advise with the following:

A cylinder modelled as an assembly of two parts (piston rod and the body) is inserted into another assembly. Then the sylinder becomes sub-assembly in another assembly. The question is: how can I make the parts of the cylinder (primarily piston rod) to be driven/flexible such that the stroke of the cylinder changes with the parameters of the main assembly?