Ejemplo n.º 1
0
        protected override Metrics PopulateMetrics(ServiceIncident webServiceObject, CrudOperationData jsonObject)
        {
            var metrics = base.PopulateMetrics(webServiceObject, jsonObject);

            metrics.ProblemOccurredDateTime = (DateTime)jsonObject.GetAttribute("affecteddate");
            return(metrics);
        }
        private static void CheckIMACResolved(ServiceIncident serviceIncident, CrudOperationData jsonObject)
        {
            var action = jsonObject.GetUnMappedAttribute("#selectedAction");

            if ("COMP".Equals(action))
            {
                var curSequence = Int32.Parse(jsonObject.GetUnMappedAttribute("activitysequence"));
                var maxSequence = 0;
                var activities  = jsonObject.AssociationAttributes["woactivity_"] as IList <CrudOperationData>;
                foreach (var activity in activities)
                {
                    var sequence = (int)activity.GetAttribute("wosequence");
                    if (sequence > maxSequence)
                    {
                        maxSequence = sequence;
                    }
                }

                // this means that the user is completing the last activity (max sequence) in the Job Plan list..
                if (curSequence == maxSequence)
                {
                    // .. so, resolve the IMAC as well
                    serviceIncident.WorkflowStatus = "RESOLVED";
                }
            }
        }
        protected override string HandleTitle(ServiceIncident webServiceObject, CrudOperationData jsonObject, string schemaId)
        {
            var kfdc = "kfdc" + jsonObject.GetAttribute("hostname");

            if (IsWindowsTemplate(jsonObject))
            {
                return("Offering new virtual Windows Server " + kfdc);
            }
            return("Offering new virtual Linux Server " + kfdc);
        }
Ejemplo n.º 4
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;
                }
            }
        }
Ejemplo n.º 5
0
        private static void PopulateAssets(CrudOperationData entity, ServiceIncident maximoTicket)
        {
            var assetId = entity.GetAttribute("assetnum") as string;

            if (assetId == null)
            {
                //for general and outlook templates, there might be only an itc asset selected
                //lets fallback to this
                assetId = entity.GetAttribute("itcassetnum") as string;
            }
            if (assetId == null)
            {
                return;
            }
            var assetList = CollectionUtil.SingleElement(new Asset {
                AssetID = assetId
            });

            maximoTicket.Asset = assetList.ToArray();
        }
Ejemplo n.º 6
0
 protected virtual string HandleTitle(ServiceIncident webServiceObject, CrudOperationData jsonObject, string schemaId)
 {
     return((String)jsonObject.GetAttribute("description"));
 }
        protected override ISMServiceEntities.Problem PopulateProblem(CrudOperationData jsonObject, ServiceIncident webServiceObject,
                                                                      string entityName, Boolean update, string schemaId)
        {
            var problem = base.PopulateProblem(jsonObject, webServiceObject, entityName, update, schemaId);

            problem.CustomerID = "HLC-00";
            problem.System     = "21390000";
            return(problem);
        }
Ejemplo n.º 8
0
        protected override ISMServiceEntities.Problem PopulateProblem(CrudOperationData jsonObject, ServiceIncident webServiceObject,
                                                                      string entityName, Boolean update, string schemaId)
        {
            var problem = base.PopulateProblem(jsonObject, webServiceObject, entityName, update, schemaId);

            var customer = jsonObject.GetAttribute("asset_.pluspcustomer") as string;

            if (customer == null)
            {
                //for general and outlook templates, there might be only an itc asset selected
                //lets fallback to this
                customer = jsonObject.GetAttribute("2asset_.pluspcustomer") as string;
            }
            if (customer == null)
            {
                //if no asset was selected, get the customer attribute from the Affected Person
                customer = jsonObject.GetAttribute("person_.pluspcustomer") as string;
            }
            problem.CustomerID = customer;

            return(problem);
        }