Asle Frantzen

Update frequency of custom DR (rollup)?

Discussion created by Asle Frantzen Champion on Mar 8, 2012
Latest reply on Mar 10, 2012 by Asle Frantzen



We have decided to use the Rollup custom DR found here in the vCampus site, and it works like a charm in the different levels of the AF tree.




But we're using these 'state' attributes in a ProcessBook overview display, and it takes 12 seconds to reload all the values - and of course, ProcessBook hangs while doing this. So I was trying to find out if I could set a cache time limit for these values, and in the GetInputs method of the Rollup DR it's set up to reload the list of attributes if the last read happened more than 10 seconds ago.

public override AFAttributeList GetInputs(object context)
            // Return the list of attributes we are interested in.
            // AFSDK will then proved the values for these attributes in the GetValue call.
            // This is much more efficient than asking for them one-by-one in GetValue, because
            // the calls can be batched, and redundant requests for attributes can be eliminated.
            // Reload the attributes if more than 10 seconds has passed since the last calculation
            // This handles changes in heirarchy.  Do this less frequently if possible.
            TimeSpan tsSinceLastCalculation = DateTime.UtcNow.Subtract(dtLastLoadAttribute);
            if (tsSinceLastCalculation.Seconds > 10 || paramAttributes == null)
                paramAttributes = null;
            return paramAttributes;



I've tried to increase this limit from 10 to 120, but it doesn't seem to have any effect. PB still hangs while trying to update these every 5 seconds.


Any idea on how to increase the caching time for these values? If possible at all.