2 Replies Latest reply on Oct 2, 2017 4:28 AM by Waldy

    Calculation Reaction Time. Arithmetic operation resulted in an overflow.

    Ekaterina Apprentice

      Hello!

      We have to count reaction time using calculation in process. On creating the request from Self-Service portal and email. In short, we should count UtcNow + 5 or +30 business minutes.

       

      I wrote the script and put it in the process:

      import System

      static def GetAttributeValue(Request):

        if Request._CPXEntryWay._name == "иное" or Request._CPXEntryWay._name == "телефон":

        Value = null

        return Value

       

        minutes = 30

        Value = DateTime.UtcNow

       

        if Request.RaiseUser._CPXVip != null:

       

        if Request.RaiseUser._CPXVip._name == "vip":

        if Request._CatalogueHierarchy != null:

        minutes = Request._CatalogueHierarchy._cpxreactiontime1

        if Request._CatalogueHierarchy == null:

        minutes = 5

       

        if Request.RaiseUser._CPXVip._name == "Обычный" or Request.RaiseUser._CPXVip._name == null:

        if Request._CatalogueHierarchy != null:

        minutes = Request._CatalogueHierarchy._cpxreactiontime2

       

        Start = DateTime.UtcNow

        Value = Start.AddMinutes(minutes)

        TimePeriod = Request.GetBusinessTime(Start,Value)

        if (TimePeriod.TotalSeconds) >= minutes*60:

        return Value

        min = minutes

        while (TimePeriod.TotalSeconds) < minutes*60:

       

       

        min = min + 60

        Value = Start.AddMinutes(min)

        TimePeriod = Request.GetBusinessTime(Start, Value)

       

        while (TimePeriod.TotalSeconds) > minutes*60:

       

       

        min = min - 1

        Value = Start.AddMinutes(min)

        TimePeriod = Request.GetBusinessTime(Start, Value)

       

        return Value

      This script works fine, when we're creating Request from web-portal. But when request is creating from email, we have next error in Framework logs^

      Calculation

      Action Value Calculation Unsuccessful at 2017-05-09 20:12:37.605

      Calculation successful for Attribute [_cpxReactionTimeGoal] on Class Type [RequestManagement.Request]

      On Object : Key = [e8a6166b-b342-4ae7-b5b8-2240271f193f]  Name = []

      Calculated Value = []

      FAILED

      Arithmetic operation resulted in an overflow.

       

      And "Reaction time" is null in that case.

       

      Can anybody help with it?

       

      Thanks in andvance!

      BR, Kate