Question

source code files are not working if installed from clio

Hi All,

I have a requirement where SLA of Case is being defined in a new custom object. FOr that I have written below source code schema

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terrasoft.Common;
using Terrasoft.Core.Configuration;
using Terrasoft.Core;
using Terrasoft.Core.Entities;
using CalendarsTimeUnit = Terrasoft.Configuration.Calendars.TimeUnit;
using SystemSettings = Terrasoft.Core.Configuration.SysSettings;
using Terrasoft.Configuration;
using Terrasoft.Configuration.SLMExtensions;

namespace Terrasoft.Configuration
{
    class EqtCaseTermStrategyByQueryType : BaseTermStrategy<CaseTermInterval, CaseTermStates>
    {
        protected class StrategyData
        {
            public Guid EqtQueryTypeId
            {
                get;
                set;
            }
            public Guid PriorityId
            {
                get;
                set;
            }
            public Guid ServiceItemId
            {
                get;
                set;
            }
            public Guid ServicePactId
            {
                get;
                set;
            }
        }
        protected StrategyData _strategyData;

        private TimeTerm GetTerm(Entity entity, string timeUnitColumnName, string timeValueColumnName,
            Guid calendarId)
        {
            var term = new TimeTerm();
            var timeUnitName = entity.GetTypedColumnValue<string>(timeUnitColumnName);
            CalendarsTimeUnit timeUnit;
            if (Enum.TryParse(timeUnitName, out timeUnit))
            {
                term.Type = timeUnit;
            }
            term.Value = entity.GetTypedColumnValue<int>(timeValueColumnName);
            term.CalendarId = calendarId;
            return term.ConvertToMinutes();
        }
        public EqtCaseTermStrategyByQueryType(UserConnection userConnection, Dictionary<string, object> args)
            : base(userConnection)
        {
            _strategyData = args.ToObject<StrategyData>();
        }

        public override CaseTermInterval GetTermInterval(CaseTermStates mask)
        {
            var logger = global::Common.Logging.LogManager.GetLogger("QueryTypeSLALogger");
            var result = new CaseTermInterval();
            logger.Info("Strategy Selected");
            var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "EqtQueryType");

            string reactionTimeUnitColumnName = esq.AddColumn("EqtSLAResponseTimeUnit.Code").Name;
            string reactionTimeValueColumnName = esq.AddColumn("EqtSLAResponseTimeValue").Name;
            string resolutionTimeUnitColumnName = esq.AddColumn("EqtSLAResolutionTimeUnit.Code").Name;
            string resolutionTimeValueColumnName = esq.AddColumn("EqtSLAResolutionTimeValue").Name;
            //string CalendarColumnName = esq.AddColumn("EqtCalendar").Name;
            esq.AddColumn("EqtCalendar");

            var queryTypeRecord = esq.GetEntity(UserConnection, _strategyData.EqtQueryTypeId);
            Guid calendarId = queryTypeRecord.GetTypedColumnValue<Guid>("EqtCalendarId");
            if (calendarId == default(Guid))
            {
                return result;
            }
            if (!mask.HasFlag(CaseTermStates.ContainsResponse))
            {
                result.ResponseTerm =
                    GetTerm(queryTypeRecord, reactionTimeUnitColumnName, reactionTimeValueColumnName, calendarId);
                logger.Info("Response Time Calculated");
            }

            if (!mask.HasFlag(CaseTermStates.ContainsResponse))
            {
                result.ResolveTerm =
                    GetTerm(queryTypeRecord, resolutionTimeUnitColumnName, resolutionTimeValueColumnName, calendarId);
                logger.Info("Resolution Time Calculated");
            }
            return result;
            throw new NotImplementedException();
        }
    }
}

It works fine as expected in my local Environment. But, We have CI/CD pipeline where the package is being installed using clio. when it is installed in the DEV Env using clio, functionality is not working.

For testing purposes, I created a vanilla Environment and deployed using installed applications. It worked fine.

 

How can I overcome this issue now?

Like 0

Like

1 comments

Hi,

 

Are you sure that the reason is in the clio installation? What did the installation logs say, was the installation successful? Also does this logic triggers in the dev app to which the package with this source code was installed? Additionally have you tried to compile the app after the installation of the package?

Show all comments