3 Replies Latest reply on Jan 4, 2018 8:54 AM by GBellido_KBC

    AF Custom Data References and Analysis

    GBellido_KBC

      I have created a Custom DR that returns the context timestamp converted from the local AF time to an specific Timezone.

      Both my GetValue and GetValues method seem to be working. I can retrieve interpolated values at times and by count:

      I would like to use this CDR as input of an Analysis. So I created a test analysis which concatenates a string with “Time on Site” value every 5 minutes. I tried first with an Analysis DR as output, which works.

      If I do a Time Series Data of the “AnalysisTest” attribute I can do Sampled and Plot calls too. If I evaluate the calculations I get good values also:

      However, if I try Preview Results, I think the context time is not being passed correctly.

      When debugging, I see a couple of things:

       

      1. The context time passed is 1-Jan-1970… instead of using any of the trigger times.
      2. Clicking Preview Results call the InterpolatedValue data method, which returns 1 value using GetValue method, instead calling InterpolatedValuesAtTimes or PlotedValues.

       

      Is there any step that I could be missing?

       

      Do you have any example that could help with this?

       

      Thanks,

      Gabriel

        • Re: AF Custom Data References and Analysis
          dmoler

          Hi Gabriel,

           

          The issue is likely that a value is getting cached in the AFDataCache and there is no event that is triggering evaluation, so a single event (at the effective date of the element which is AFTime.MinValue by default) is being cached and extrapolated for all other events. What does your data reference return for GetInputs and SupportedDataMethods? What version of AFSDK are you using?

           

          David

          1 of 1 people found this helpful
          • Re: AF Custom Data References and Analysis
            Rick Davin

            Hi Gabriel,

             

            Thanks for including some detailed graphics.  In addition to Sampled and Plot could you also include Archived data?

             

            What is the actual source for the "Time on Site" attribute?  In other words, where does it get its data?

             

            Does your CDR implement a data pipe?  If not, see Implementing the AFDataPipe in a Custom Data Reference.

              • Re: AF Custom Data References and Analysis
                GBellido_KBC

                Hi David and Rick.

                 

                Thank you for your quick replies!

                 

                I think I figured it out.

                 

                My GetInputs returns the attribute “TimeZoneId”, which has none DR and the value is a string which indicates the target time zone ID. Because of this, I thought the analisys (scheduled, 5 min) would always use interpolations and that I was never going to need the RecordedValues data method.

                 

                However, this is wrong. I tried including RecordedValues in my supported data methods and it works. Analysis uses the RecordedValues data method even if none of the inputs supports archived data.

                Just in case this helps to anyone in the future, AF Version is 2.9.2.8185.

                 

                Thank you,

                 

                Gabriel