Exemplo n.º 1
0
 protected override string GetOverridenOwnerGroup(bool isCreation, CrudOperationData jsonObject)
 {
     return(null);
 }
        //HAP-1170
        private Activity[] PushExtraActivitiesForFailure(Activity[] serviceIncidentActivity, CrudOperationData jsonObject)
        {
            var activity = new Activity {
                type             = "WOActivity",
                ActionLogSummary = "Check Customer Input"
            };
            var sequence = int.Parse(jsonObject.GetUnMappedAttribute("activitysequence"));


            var flexFields = new List <FlexFieldsFlexField> {
                new FlexFieldsFlexField {
                    id       = "0",
                    mappedTo = "STATUS",
                    Value    = "WAPPR",
                },
                new FlexFieldsFlexField {
                    id       = "0",
                    mappedTo = "WOSEQUENCE",
                    Value    = (sequence + 1).ToString()
                },
                new FlexFieldsFlexField {
                    id       = "0",
                    mappedTo = "OWNERGROUP",
                    Value    = "I-EUS-DE-CSC-IMC-HLCIMAC"
                }
            };

            //
            activity.FlexFields     = ArrayUtil.PushRange(activity.FlexFields, flexFields);
            serviceIncidentActivity = ArrayUtil.Push(serviceIncidentActivity, activity);


            activity = new Activity {
                type             = "WOActivity",
                ActionLogSummary = jsonObject.GetUnMappedAttribute("#tasksummary")
            };

            flexFields = new List <FlexFieldsFlexField> {
                new FlexFieldsFlexField {
                    id       = "0",
                    mappedTo = "STATUS",
                    Value    = "WAPPR",
                },
                new FlexFieldsFlexField {
                    id       = "0",
                    mappedTo = "WOSEQUENCE",
                    Value    = (sequence + 2).ToString()
                },
                new FlexFieldsFlexField {
                    id       = "0",
                    mappedTo = "OWNERGROUP",
                    Value    = "C-HLC-WW-ITCALL"
                }
            };
            //
            activity.FlexFields = ArrayUtil.PushRange(activity.FlexFields, flexFields);
            return(ArrayUtil.Push(serviceIncidentActivity, activity));
        }
        private void HandlePRLINES(MaximoOperationExecutionContext maximoTemplateData, CrudOperationData crudDataEntity, object sr)
        {
            var prlines = (IEnumerable <CrudOperationData>)crudDataEntity.GetRelationship("prline");

            var recordKey = crudDataEntity.Id;
            var user      = SecurityFacade.CurrentUser();

            w.CloneArray((IEnumerable <CrudOperationData>) crudDataEntity.GetRelationship("prline"), sr, "PRLINE",
                         delegate(object integrationObject, CrudOperationData crudData)
            {
                if (ReflectionUtil.IsNull(integrationObject, "PRLINENUM"))
                {
                    w.SetValue(integrationObject, "PRLINENUM", 1);
                }
                var enterdate = sr;
                w.SetValueIfNull(integrationObject, "ENTERDATE", DateTime.Now.FromServerToRightKind());
                w.SetValueIfNull(integrationObject, "TAX1", 0);
                w.SetValueIfNull(integrationObject, "TAX2", 0);
                w.SetValueIfNull(integrationObject, "TAX3", 0);
                w.SetValueIfNull(integrationObject, "TAX4", 0);
                w.SetValueIfNull(integrationObject, "TAX5", 0);
                w.SetValueIfNull(integrationObject, "ISSUE", false);
                w.SetValueIfNull(integrationObject, "CHARGESTORE", false);
                w.SetValueIfNull(integrationObject, "RECEIPTREQD", false);
                w.SetValueIfNull(integrationObject, "LOADEDCOST", 0);
                w.SetValueIfNull(integrationObject, "PRORATESERVICE", false);
                w.SetValueIfNull(integrationObject, "CONVERTTORFQ", false);
                w.SetValueIfNull(integrationObject, "INSPECTIONREQUIRED", false);
                w.SetValueIfNull(integrationObject, "ISDISTRIBUTED", false);
                w.SetValueIfNull(integrationObject, "LINECOST", 0);
                w.SetValueIfNull(integrationObject, "LINETYPE", "ITEM");
                w.SetValueIfNull(integrationObject, "ENTERBY", user.Login);
                w.SetValueIfNull(integrationObject, "SITEID", user.SiteId);
                w.SetValueIfNull(integrationObject, "ORGID", user.OrgId);
                w.SetValueIfNull(integrationObject, "ENTEREDASTASK", false);
                w.SetValueIfNull(integrationObject, "CONVERTTOCONTRACT", false);
                w.SetValueIfNull(integrationObject, "LANGCODE", "EN");
                w.SetValueIfNull(integrationObject, "CONVERSION", 1);
                w.SetValueIfNull(integrationObject, "HASID", false);
                w.SetValueIfNull(integrationObject, "PRLINENUM", 0);
                w.SetValueIfNull(integrationObject, "MKTPLCITEM", false);
                w.SetValueIfNull(integrationObject, "TAXEXEMPT", false);
                w.SetValueIfNull(integrationObject, "CONSIGNMENT", false);
                w.SetValueIfNull(integrationObject, "ITEMNUM", "test");

                ReflectionUtil.SetProperty(integrationObject, "action", OperationType.Add.ToString());
            });
        }
Exemplo n.º 4
0
        //protected override void HandleMaterials(MaximoOperationExecutionContext maximoTemplateData, CrudOperationData entity, object wo) {
        //    var materials = (IEnumerable<CrudOperationData>)entity.GetRelationship("matusetrans");
        //    var newMaterials = materials.Where(r => r.GetAttribute("matusetransid") == null);
        //    var recordKey = entity.Id;
        //    var user = SecurityFacade.CurrentUser();
        //    var crudOperationDatas = newMaterials as CrudOperationData[] ?? newMaterials.ToArray();

        //    WsUtil.CloneArray(crudOperationDatas, wo, "MATUSETRANS", delegate(object integrationObject, CrudOperationData crudData) {
        //        var itemsetid = (string)crudOperationDatas[0].GetAttribute("item_.itemsetid");
        //        var qtyRequested = (double)WsUtil.GetRealValue(integrationObject, "QTYREQUESTED");

        //        WsUtil.SetValue(integrationObject, "MATUSETRANSID", -1);

        //        WsUtil.SetValue(integrationObject, "QUANTITY", -1 * qtyRequested);
        //        WsUtil.SetValue(integrationObject, "CURBAL", 3.00);
        //        WsUtil.SetValue(integrationObject, "PHYSCNT", 15.00);
        //        WsUtil.SetValue(integrationObject, "UNITCOST", 17.36);
        //        WsUtil.SetValue(integrationObject, "ACTUALCOST", 17.36);
        //        WsUtil.SetValue(integrationObject, "CONVERSION", 1.00);
        //        WsUtil.SetValue(integrationObject, "ISSUETYPE", "RETURN");
        //        WsUtil.SetValue(integrationObject, "CURRENCYCODE", "USD");
        //        WsUtil.SetValue(integrationObject, "LINETYPE", "ITEM");
        //        WsUtil.SetValue(integrationObject, "TOSITEID", user.SiteId.ToUpper());
        //        WsUtil.SetValue(integrationObject, "CONSIGNMENT", false);

        //        WsUtil.SetValue(integrationObject, "LINECOST", 0);
        //        WsUtil.SetValue(integrationObject, "OUTSIDE", false);
        //        WsUtil.SetValue(integrationObject, "ROLLUP", false);
        //        WsUtil.SetValue(integrationObject, "ENTEREDASTASK", false);
        //        WsUtil.SetValue(integrationObject, "ITEMSETID", itemsetid);
        //        WsUtil.SetValue(integrationObject, "ENTERBY", user.Login.ToUpper());
        //        WsUtil.SetValue(integrationObject, "ORGID", user.OrgId.ToUpper());
        //        WsUtil.SetValue(integrationObject, "SITEID", user.SiteId.ToUpper());
        //        WsUtil.SetValue(integrationObject, "REFWO", recordKey);
        //        WsUtil.SetValue(integrationObject, "ACTUALDATE", DateTime.Now.FromServerToRightKind(), true);
        //        WsUtil.SetValue(integrationObject, "TRANSDATE", DateTime.Now.FromServerToRightKind(), true);
        //        WsUtil.SetValue(integrationObject, "TRANSDATE", DateTime.Now.FromServerToRightKind(), true);
        //        WsUtil.SetValue(integrationObject, "ENTERDATE", DateTime.Now.FromServerToRightKind(), true);


        //        ReflectionUtil.SetProperty(integrationObject, "action", OperationType.AddChange.ToString());
        //    });
        //}

        protected override void HandleMaterials(MaximoOperationExecutionContext maximoTemplateData, CrudOperationData entity, object wo)
        {
            var materials          = (IEnumerable <CrudOperationData>)entity.GetRelationship("matusetrans");
            var newMaterials       = materials.Where(r => r.GetAttribute("matusetransid") == null);
            var recordKey          = entity.Id;
            var user               = SecurityFacade.CurrentUser();
            var crudOperationDatas = newMaterials as CrudOperationData[] ?? newMaterials.ToArray();

            WsUtil.CloneArray(crudOperationDatas, wo, "MATUSETRANS", delegate(object integrationObject, CrudOperationData crudData) {
                var itemsetid    = (string)crudOperationDatas[0].GetAttribute("item_.itemsetid");
                var qtyRequested = (double)WsUtil.GetRealValue(integrationObject, "QTYREQUESTED");
                WsUtil.SetValue(integrationObject, "MATUSETRANSID", -1);


                WsUtil.SetValue(integrationObject, "ITEMNUM", "PK-NO1-7006");
                WsUtil.SetValue(integrationObject, "STORELOC", "NO1");
                WsUtil.SetValue(integrationObject, "TRANSDATE", DateTime.Now.FromServerToRightKind(), true);
                WsUtil.SetValue(integrationObject, "ACTUALDATE", DateTime.Now.FromServerToRightKind(), true);
                WsUtil.SetValue(integrationObject, "QUANTITY", -1);
                WsUtil.SetValue(integrationObject, "CURBAL", 3);
                WsUtil.SetValue(integrationObject, "PHYSCNT", 7);
                WsUtil.SetValue(integrationObject, "UNITCOST", 17.36);
                WsUtil.SetValue(integrationObject, "ACTUALCOST", 17.36);
                WsUtil.SetValue(integrationObject, "CONVERSION", 1);
                WsUtil.SetValue(integrationObject, "ASSETNUM", "400-153");
                WsUtil.SetValue(integrationObject, "ENTERBY", "JMALONG");
                WsUtil.SetValue(integrationObject, "MEMO", "123");
                WsUtil.SetValue(integrationObject, "OUTSIDE", false);
                WsUtil.SetValue(integrationObject, "ISSUETO", "DHELMS");
                WsUtil.SetValue(integrationObject, "ROLLUP", false);
                WsUtil.SetValue(integrationObject, "BINNUM", "AL001");
                WsUtil.SetValue(integrationObject, "ISSUETYPE", "ISSUE");
                WsUtil.SetValue(integrationObject, "GLDEBITACCT", "5030-100-101");
                WsUtil.SetValue(integrationObject, "LINECOST", 17.36);
                WsUtil.SetValue(integrationObject, "FINANCIALPERIOD", "QTR3_7");
                WsUtil.SetValue(integrationObject, "CURRENCYCODE", "USD");
                WsUtil.SetValue(integrationObject, "CURRENCYUNITCOST", 17.36);
                WsUtil.SetValue(integrationObject, "CURRENCYLINECOST", 17.36);
                WsUtil.SetValue(integrationObject, "LOCATION", "22335");
                WsUtil.SetValue(integrationObject, "DESCRIPTION", "FILTER  FUEL / CAT 1R-0751");
                WsUtil.SetValue(integrationObject, "EXCHANGERATE", 1);
                WsUtil.SetValue(integrationObject, "SPAREPARTADDED", false);
                WsUtil.SetValue(integrationObject, "QTYREQUESTED", 1);
                WsUtil.SetValue(integrationObject, "ORGID", "BSAKSS");
                WsUtil.SetValue(integrationObject, "SITEID", "KOD016");
                WsUtil.SetValue(integrationObject, "REFWO", "41772");
                WsUtil.SetValue(integrationObject, "ENTEREDASTASK", false);
                WsUtil.SetValue(integrationObject, "LINETYPE", "ITEM");
                WsUtil.SetValue(integrationObject, "ITEMSETID", "ITEM2");
                WsUtil.SetValue(integrationObject, "CONDRATE", 100);
                WsUtil.SetValue(integrationObject, "COMMODITYGROUP", "AUTO");
                WsUtil.SetValue(integrationObject, "COMMODITY", "FILTERS");
                WsUtil.SetValue(integrationObject, "TOSITEID", "KOD016");
                WsUtil.SetValue(integrationObject, "CONSIGNMENT", false);

                ReflectionUtil.SetProperty(integrationObject, "action", OperationType.AddChange.ToString());
            });
        }
Exemplo n.º 5
0
 protected static void PopulateServiceIncident(ServiceIncident webServiceObject, CrudOperationData jsonObject)
 {
     webServiceObject.RequesterID               = "";
     webServiceObject.WorkflowStatus            = "QUEUED";
     webServiceObject.ProviderID                = "";
     webServiceObject.ProviderPrioritySpecified = true;
     webServiceObject.CurrentState              = "";
     webServiceObject.ProviderPriority          = 4; //Need to find out what field maps to provider priority. Hard coded a priority for now.
 }
Exemplo n.º 6
0
        protected virtual Problem PopulateProblem(CrudOperationData jsonObject, ServiceIncident webServiceObject, string entityName, Boolean update, string schemaId)
        {
            if (webServiceObject.Problem == null)
            {
                webServiceObject.Problem = new Problem();
            }

            var problem = webServiceObject.Problem;

            problem.ProblemType = GetProblemType();
            problem.CustomerID  = ISMConstants.DefaultCustomerName;

            webServiceObject.Problem.Abstract = HandleTitle(webServiceObject, jsonObject, schemaId);
            HandleLongDescription(webServiceObject, jsonObject, jsonObject.ApplicationMetadata, update);

            problem.System = ISMConstants.System;

            problem.FlexFields = new[]
            {
                new FlexFieldsFlexField {
                    mappedTo = "CHANGEBY", id = "0", Value = SecurityFacade.CurrentUser().MaximoPersonId
                },
                new FlexFieldsFlexField {
                    mappedTo = "CHANGEDATE", id = "0", Value = DateTime.UtcNow.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss")
                },
                new FlexFieldsFlexField {
                    mappedTo = "CINUM", id = "0", Value = jsonObject.GetAttribute("cinum") as string
                },
                new FlexFieldsFlexField {
                    mappedTo = "TemplateID", id = "0", Value = GetTemplateId(jsonObject)
                }
            };

            //PROVIDER ASSIGNED GROUP ELEMENT
            if (problem.ProviderAssignedGroup == null)
            {
                problem.ProviderAssignedGroup = new RequesterAssignedGroup {
                    Group = new Group1()
                };
            }
            var group = problem.ProviderAssignedGroup.Group;

            group.Address = new Address();
            var address = group.Address;

            address.OrganizationID = ISMConstants.OrganizationId;
            address.LocationID     = ISMConstants.LocationId;

            var submittingAction = "true".Equals(jsonObject.GetUnMappedAttribute("#submittingaction"));

            if (update && !submittingAction)
            {
                if (problem.Abstract != null && !problem.Abstract.StartsWith("@@"))
                {
                    if (problem.Abstract.Length > 98)
                    {
                        //https://controltechnologysolutions.atlassian.net/browse/HAP-642
                        problem.Abstract = "@@" + problem.Abstract.Substring(0, 98);
                    }
                    else
                    {
                        problem.Abstract = "@@" + problem.Abstract;
                    }
                }
            }

            var overridenOwnerGroup = GetOverridenOwnerGroup(!update, jsonObject);

            if (overridenOwnerGroup != null)
            {
                problem.ProviderAssignedGroup.Group.GroupID = overridenOwnerGroup;
            }

            return(problem);
        }
Exemplo n.º 7
0
 public static bool IsIBMTicket(CrudOperationData datamap)
 {
     return(datamap.ContainsAttribute("ownergroup") &&
            datamap.GetAttribute("ownergroup") != null &&
            !datamap.GetAttribute("ownergroup").ToString().StartsWith("C-"));
 }
Exemplo n.º 8
0
 protected abstract string GetAffectedPerson(CrudOperationData entity);
Exemplo n.º 9
0
        protected override void HandleLongDescription(ServiceIncident webServiceObject, CrudOperationData entity, ApplicationMetadata metadata, bool update)
        {
            var problem = webServiceObject.Problem;
            var ld      = (CrudOperationData)entity.GetRelationship("longdescription");

            if (ld != null)
            {
                var originalLd = (string)ld.GetAttribute("ldtext");
                if (!update)
                {
                    problem.Description = HapagSRLongDescriptionHandler.ParseSchemaBasedLongDescription(originalLd,
                                                                                                        entity, metadata.Schema.SchemaId);
                }
                else
                {
                    problem.Description = originalLd;
                }
            }
        }
Exemplo n.º 10
0
 public static T SetValuesFromJSON <T>(T integrationObject, EntityMetadata metadata, CrudOperationData operationData)
 {
     return(HandleAttributesValues(integrationObject, metadata, operationData));
 }
Exemplo n.º 11
0
 // https://controltechnologysolutions.atlassian.net/browse/HAP-839
 protected override string GetOverridenOwnerGroup(bool isCreation, CrudOperationData jsonObject)
 {
     return(HlagTicketUtil.HandleSRAndIncidentOwnerGroups(isCreation, jsonObject, ISMConstants.DefaultAssignedGroupSr));
 }
Exemplo n.º 12
0
 protected override string GetTemplateId(CrudOperationData jsonObject)
 {
     return(null);
 }
Exemplo n.º 13
0
 protected override string GetAffectedPerson(CrudOperationData entity)
 {
     return((string)entity.GetAttribute("affectedperson"));
 }
Exemplo n.º 14
0
 protected virtual string HandleTitle(ServiceIncident webServiceObject, CrudOperationData jsonObject, string schemaId)
 {
     return((String)jsonObject.GetAttribute("description"));
 }
        protected virtual void HandleMaterials(MaximoOperationExecutionContext maximoTemplateData, CrudOperationData entity, object wo)
        {
            var materials    = (IEnumerable <CrudOperationData>)entity.GetRelationship("matusetrans");
            var newMaterials = materials.Where(r => r.GetAttribute("matusetransid") == null);
            var recordKey    = entity.Id;
            var user         = SecurityFacade.CurrentUser();

            WsUtil.CloneArray(newMaterials, wo, "MATUSETRANS", delegate(object integrationObject, CrudOperationData crudData) {
                var qtyRequested = ReflectionUtil.GetProperty(integrationObject, "QTYREQUESTED");
                if (qtyRequested == null)
                {
                    WsUtil.SetValue(integrationObject, "QTYREQUESTED", 0);
                }
                var realValue = (double)WsUtil.GetRealValue(integrationObject, "QTYREQUESTED");
                WsUtil.SetValue(integrationObject, "QUANTITY", -1 * realValue);
                WsUtil.SetValue(integrationObject, "MATUSETRANSID", -1);
                WsUtil.SetValue(integrationObject, "ENTERBY", user.Login);
                WsUtil.SetValue(integrationObject, "ORGID", user.OrgId);
                WsUtil.SetValue(integrationObject, "SITEID", user.SiteId);
                WsUtil.SetValue(integrationObject, "REFWO", recordKey);
                WsUtil.SetValue(integrationObject, "ACTUALDATE", DateTime.Now.FromServerToRightKind(), true);
                WsUtil.SetValue(integrationObject, "TRANSDATE", DateTime.Now.FromServerToRightKind(), true);

                ReflectionUtil.SetProperty(integrationObject, "action", OperationType.Add.ToString());
            });
        }
Exemplo n.º 16
0
        protected virtual void HandleLongDescription(ServiceIncident webServiceObject, CrudOperationData entity, ApplicationMetadata metadata, bool update)
        {
            var problem = webServiceObject.Problem;
            var ld      = (CrudOperationData)entity.GetRelationship("longdescription");

            if (ld != null)
            {
                problem.Description = (string)ld.GetAttribute("ldtext");
            }
        }
 private Boolean IsWindowsTemplate(CrudOperationData data)
 {
     return("serverwindows".Equals(data.ApplicationMetadata.Schema.SchemaId));
 }
Exemplo n.º 18
0
 protected abstract string GetOverridenOwnerGroup(Boolean isCreation, CrudOperationData jsonObject);
        protected override void HandleLongDescription(ServiceIncident webServiceObject, CrudOperationData entity, ApplicationMetadata metadata, bool update)
        {
            var problem = webServiceObject.Problem;

            problem.Description = HapagOfferingLongDescriptionHandler.ParseSchemaBasedLongDescription(entity);
        }
Exemplo n.º 20
0
 protected virtual string GetTemplateId(CrudOperationData jsonObject)
 {
     return(jsonObject.GetAttribute("templateid") as string);
 }
 protected override string GetAffectedPerson(CrudOperationData entity)
 {
     return(null);
 }
Exemplo n.º 22
0
 public static string ParseSchemaBasedLongDescription(CrudOperationData entity)
 {
     return(ImacDescriptionHandler.BuildDescription(entity, entity.ApplicationMetadata));
 }
 protected override string GetTemplateId(CrudOperationData jsonObject)
 {
     return(IsWindowsTemplate(jsonObject) ? "HLCDEOWIN" : "HLCDEOLNX");
 }
Exemplo n.º 24
0
        public IEnumerable <Activity> LoadFromServicePlan(string schemaid, CrudOperationData jsonObject)
        {
            if ("installstd".Equals(schemaid))
            {
                return(HandleIbmTechMatrix(jsonObject, "HLAINPCS", "HLAINPCH", "HLAINPCW", "HLAINPCH_HLU", "HLAINPCS_HLU"));
            }
            if ("installlan".Equals(schemaid))
            {
                if ("lan".Equals(jsonObject.GetAttribute("lantype")))
                {
                    return(HandleIbmTechMatrix(jsonObject, "HLAINPRS", "HLAINPRH", "HLAINPRW", "HLAINPRH_HLU", "HLAINPRS_HLU"));
                }
                return(HandleIbmTechMatrix(jsonObject, "HLAINPRSEP", "HLAINPRHHP", "HLAINPRWWP", "HLAINPRHHP_HLU", "HLAINPRSEP_HLU"));
            }

            if ("installother".Equals(schemaid))
            {
                var classification = jsonObject.GetAttribute("classification") ?? "";
                if (!classification.Equals("43290200"))
                {
                    return(DoLoadFromFile("HLAINOTHER"));
                }
                return(HandleIbmTechMatrix(jsonObject, "HLAINVPCS", "HLAINVPCS", "HLAINVPCS", "HLAINVPCS_HLU",
                                           "HLAINVPCS_HLU"));
            }
            var lanType      = jsonObject.GetAttribute("lantype") as string ?? "";
            var isLan        = lanType.Equals("lan", StringComparison.CurrentCultureIgnoreCase);
            var isLanHostPap = lanType.Equals("lan/host/pap", StringComparison.CurrentCultureIgnoreCase);
            var assetRel     = (CrudOperationData)jsonObject.GetRelationship("asset");

            if (assetRel == null)
            {
                throw ExceptionUtil.InvalidOperation("asset should be selected");
            }
            var assetStatus  = assetRel.GetAttribute("status") as string ?? "";
            var isIdleStatus = "150 Idle".Equals(assetStatus, StringComparison.CurrentCultureIgnoreCase);

            if ("move".Equals(schemaid))
            {
                var currentITC     = GetCurrentITC(jsonObject);
                var fromLocation   = jsonObject.GetAttribute("fromlocation");
                var toLocation     = jsonObject.GetAttribute("tolocation");
                var classification = jsonObject.GetUnMappedAttribute("asset_.classstructureid") ?? "";

                var toITC = ISMConstants.AddEmailIfNeeded(jsonObject.GetAttribute("toitc") as string);
                if (toITC != null)
                {
                    toITC = toITC.ToUpper();
                }
                if (fromLocation.Equals(toLocation))
                {
                    if (currentITC.Equals(toITC))
                    {
                        return(HandleIbmTechMatrix(jsonObject, "HLAMVINS", "HLAMVINH", "HLAMVINW", "HLAMVINH_HLU", "HLAMVINS_HLU"));
                    }

                    if (isIdleStatus)
                    {
                        return(HandleIbmTechMatrix(jsonObject, "HLAMVINCOS", "HLAMVINCOH", null, "HLAMVINCOH_HLU", "HLAMVINCOS_HLU"));
                    }



                    if (classification.StartsWith("432121"))
                    {
                        if (isLan)
                        {
                            return(HandleIbmTechMatrix(jsonObject, "HLARMPRSIO", "HLARMPRHIO", "HLARMPRWIO", "HLARMPRHIO_HLU", "HLARMPRSIO_HLU"));
                        }
                        if ("lan/host".Equals(lanType) || isLanHostPap)
                        {
                            return(HandleIbmTechMatrix(jsonObject, "HLARMPPSIO", "HLARMPPHIO", "HLARMPPWIO", "HLARMPPHIO_HLU", "HLARMPPSIO_HLU"));
                        }
                    }
                    return(HandleIbmTechMatrix(jsonObject, "HLARMPCSIO", "HLARMPCHIO", "HLARMPCWIO", "HLARMPCHIO_HLU", "HLARMPCSIO_HLU"));
                }

                if (currentITC.Equals(toITC))
                {
                    if (isIdleStatus)
                    {
                        return(DoLoadFromFile("HLAMVOTS"));
                    }
                    if (classification.StartsWith("432121"))
                    {
                        if (isLan)
                        {
                            return(HandleIbmTechMatrix2Cases(jsonObject, "HLARMPRSOS", "HLARMPRSOS_HLU"));
                        }
                        if (isLanHostPap)
                        {
                            return(HandleIbmTechMatrix2Cases(jsonObject, "HLARMPPSOS", "HLARMPPSOS_HLU"));
                        }
                    }
                    return(HandleIbmTechMatrix2Cases(jsonObject, "HLARMPCSOS", "HLARMPCSOS_HLU"));
                }
                if (classification.StartsWith("432121"))
                {
                    if (isLan)
                    {
                        return(HandleIbmTechMatrix2Cases(jsonObject, "HLARMPRSOO", "HLARMPRSOO_HLU"));
                    }
                    if (isLanHostPap)
                    {
                        return(HandleIbmTechMatrix2Cases(jsonObject, "HLARMPPSOO", "HLARMPPSOO_HLU"));
                    }
                }
                if (!isIdleStatus)
                {
                    return(HandleIbmTechMatrix2Cases(jsonObject, "HLARMPCSOO", "HLARMPCSOO_HLU"));
                }
                return(DoLoadFromFile("HLAMVOTCOS"));
            }

            if ("update".Equals(schemaid))
            {
                return(DoLoadFromFile("HLAUPDASSD"));
            }

            if ("add".Equals(schemaid))
            {
                return(HandleIbmTechMatrix(jsonObject, "HLAADDCOMS", "HLAADDCOMH", "HLAADDCOMW", "HLAADDCOMH_HLU", "HLAADDCOMS"));
            }

            if ("removestd".Equals(schemaid))
            {
                return(HandleIbmTechMatrix(jsonObject, "HLARVPCS", "HLARVPCH", "HLARVPCW", "HLARVPCH_HLU", "HLARVPCS_HLU"));
            }

            if ("removelan".Equals(schemaid))
            {
                if (isLan)
                {
                    return(HandleIbmTechMatrix(jsonObject, "HLARVPRS", "HLARVPRH", "HLARVPRW", "HLARVPRH_HLU", "HLARVPRS_HLU"));
                }
                return(HandleIbmTechMatrix(jsonObject, "HLARVPRSEP", "HLARVPRHHP", "HLARVPRWWP", "HLARVPRHHP_HLU", "HLARVPRSEP_HLU"));
            }

            if ("removeother".Equals(schemaid))
            {
                return(DoLoadFromFile("HLARVOTHER"));
            }

            if ("replacestd".Equals(schemaid))
            {
                return(HandleIbmTechMatrix(jsonObject, "HLARPPCS", "HLARPPCH", "HLARPPCW", "HLARPPCH_HLU", "HLARPPCS_HLU"));
            }

            if ("replacelan".Equals(schemaid))
            {
                if (isLan)
                {
                    return(HandleIbmTechMatrix(jsonObject, "HLARPPRS", "HLARPPRH", "HLARPPRW", "HLARPPRH_HLU", "HLARPPRS_HLU"));
                }
                return(HandleIbmTechMatrix(jsonObject, "HLARPPRSEP", "HLARPPRHHP", "HLARPPRWWP", "HLARPPRHHP_HLU", "HLARPPRSEP_HLU"));
            }

            if ("replaceother".Equals(schemaid))
            {
                return(DoLoadFromFile("HLARPOTHER"));
            }

            if ("decommission".Equals(schemaid))
            {
                return(DoLoadFromFile("HLADECOMM"));
            }

            return(null);
        }
 // https://controltechnologysolutions.atlassian.net/browse/HAP-839
 protected override string GetOverridenOwnerGroup(bool isCreation, CrudOperationData jsonObject)
 {
     return("I-EUS-DE-CSC-SDK-HLCFRONTDESKI");
 }
Exemplo n.º 26
0
        private static void HandleTools(MaximoOperationExecutionContext maximoTemplateData, CrudOperationData entity, object wo)
        {
            var tooltrans          = (IEnumerable <CrudOperationData>)entity.GetRelationship("tooltrans");
            var newTools           = tooltrans.Where(r => r.GetAttribute("tooltransid") == null);
            var recordKey          = entity.Id;
            var user               = SecurityFacade.CurrentUser();
            var crudOperationDatas = newTools as CrudOperationData[] ?? newTools.ToArray();

            WsUtil.CloneArray(crudOperationDatas, wo, "TOOLTRANS", delegate(object integrationObject, CrudOperationData crudData) {
                var itemsetid    = (string)crudOperationDatas[0].GetAttribute("toolitem_.itemsetid");
                var qtyRequested = (Int64)WsUtil.GetRealValue(integrationObject, "TOOLQTY");
                var hrsRequested = (double)WsUtil.GetRealValue(integrationObject, "TOOLHRS");
                var rate         = qtyRequested / hrsRequested;

                WsUtil.SetValue(integrationObject, "TOOLTRANSID", -1);

                WsUtil.SetValue(integrationObject, "TOOLQTY", qtyRequested);
                WsUtil.SetValue(integrationObject, "TOOLHRS", hrsRequested);
                WsUtil.SetValue(integrationObject, "TOOLRATE", rate);
                WsUtil.SetValue(integrationObject, "LINECOST", 0);
                WsUtil.SetValue(integrationObject, "OUTSIDE", false);
                WsUtil.SetValue(integrationObject, "ROLLUP", false);
                WsUtil.SetValue(integrationObject, "ENTEREDASTASK", false);
                WsUtil.SetValue(integrationObject, "ITEMSETID", itemsetid);
                WsUtil.SetValue(integrationObject, "ENTERBY", user.Login.ToUpper());
                WsUtil.SetValue(integrationObject, "ORGID", user.OrgId.ToUpper());
                WsUtil.SetValue(integrationObject, "SITEID", user.SiteId.ToUpper());
                WsUtil.SetValue(integrationObject, "REFWO", recordKey);
                WsUtil.SetValue(integrationObject, "ACTUALDATE", DateTime.Now.FromServerToRightKind(), true);
                WsUtil.SetValue(integrationObject, "TRANSDATE", DateTime.Now.FromServerToRightKind(), true);
                WsUtil.SetValue(integrationObject, "TRANSDATE", DateTime.Now.FromServerToRightKind(), true);
                WsUtil.SetValue(integrationObject, "ENTERDATE", DateTime.Now.FromServerToRightKind(), true);


                ReflectionUtil.SetProperty(integrationObject, "action", OperationType.Change.ToString());
            });
        }
Exemplo n.º 27
0
        private static void ChangeApprovalsHandler(ChangeRequest changeRequest, string selectedaction, string groupName, CrudOperationData jsonObject)
        {
            string log;
            string actionid;
            var    approved = selectedaction == "Approved";

            if (approved)
            {
                log      = "Approved by group " + groupName;
                actionid = "APPROVAL OBTAINED";
            }
            else
            {
                log      = "Rejected by group " + groupName;
                actionid = "REASON REJECTING";
            }
            var worklogList = new List <ChangeLog>();
            var user        = SecurityFacade.CurrentUser();
            var changeLog   = new ChangeLog {
                Log                  = log,
                ActionID             = actionid,
                UserID               = ISMConstants.AddEmailIfNeeded(user.MaximoPersonId),
                LogDateTimeSpecified = true,
                LogDateTime          = DateTime.Now
            };

            worklogList.Add(changeLog);

            if (!approved)
            {
                var reason = jsonObject.GetAttribute("#reasonreject") as string;

                //                R0033
                //                correct implemented, but: didnt realised that the Approval and Reject worklogs are not displayed at ServiceIT
                //                    Please create a seperate Worklog entry with Summary:
                //                Reject Reason for group YYY
                //                Type: REASON REJECTING
                var changeLog2 = new ChangeLog {
                    Log                  = "Reject Reason for group " + groupName,
                    ActionID             = "UPDATE",
                    UserID               = ISMConstants.AddEmailIfNeeded(user.MaximoPersonId),
                    LogDateTimeSpecified = true,
                    LogDateTime          = DateTime.Now,
                    FlexFields           = new[]
                    {
                        new FlexFieldsFlexField {
                            mappedTo = "WLLongDesc", id = "0", Value = reason
                        }
                    },
                };


                worklogList.Add(changeLog2);
            }


            changeRequest.ChangeLog = ArrayUtil.PushRange(changeRequest.ChangeLog, worklogList);
        }