SPC: Attribute name in control limits script

I would like to set control limits based on the attribute name in the Control Limits calculation script (designer, enterprise level Quality configuration). The idea is to have a custom database table with product code, attribute and fixed values for limits (UCL, USL, …). These limits should be synchronized across the SPC charts.

So, I would like to put a simple query into the control limits calculation (seems as a best place and then just use the default calculate popup of SPC charts). I can get the product code (from the sample - id is part of the SPC data sent to this script in the event). But I can’t find a way how to get the AttributeName. I know that it’s one of the parameters of the: system.quality.spc.controllimit.calcControlLimitValue which I guess is just the manual way how to call the calculation. So, I think it should accessible somehow.

Is there a way how to get this information in the script? Is my idea correct?

Thanks,

Michal