Do you really want a different processing to be dependant on the portlet instance id? Surely your portlet code should depend on a portlet instance.
Wouldn't it be better to add a property to your portlet and depending on the value of the property you have a different processing. That way you can create portlet instances with different processing.
You suggest to add a property to portlet . Is that mean adding preferences to portlet-instance.xml ? or something else ?
If it is by setting preferences then i am currently doing the exact thing if it is different please let me know.