HMI Dynamic subscription is specifically designed to do this.
Checkout the Sinolta Advanced sample projects. They demonstrate how to use Dynamic substitution along with Classes