Exemplo n.º 1
0
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            var user = SecurityFacade.CurrentUser();
            var sr   = maximoTemplateData.IntegrationObject;

            WorkLogHandler.HandleWorkLogs((CrudOperationData)maximoTemplateData.OperationData, sr);
            w.SetValueIfNull(sr, "ACTLABHRS", 0.0);
            w.SetValueIfNull(sr, "ACTLABCOST", 0.0);
            w.SetValueIfNull(sr, "CHANGEDATE", DateTime.Now.FromServerToRightKind(), true);
            w.SetValueIfNull(sr, "CHANGEBY", user.Login);
            w.SetValueIfNull(sr, "REPORTDATE", DateTime.Now.FromServerToRightKind());

            var crudData = ((CrudOperationData)maximoTemplateData.OperationData);

            LongDescriptionHandler.HandleLongDescription(sr, crudData);
            var attachments = crudData.GetRelationship("attachment");

            foreach (var attachment in (IEnumerable <CrudOperationData>)attachments)
            {
                var attachmentString = attachment.GetUnMappedAttribute("newattachment");
                var attachmentPath   = attachment.GetUnMappedAttribute("newattachment_path");
                if (attachmentString != null && attachmentPath != null)
                {
                    AttachmentHandler.HandleAttachments(sr, attachmentString, attachmentPath,
                                                        maximoTemplateData.ApplicationMetadata);
                }
            }
            //HandleSolutions(maximoTemplateData, crudData, sr);
            base.BeforeUpdate(maximoTemplateData);
        }
Exemplo n.º 2
0
        //
        public override void DoCreate(MaximoOperationExecutionContext maximoTemplateData)
        {
            var resultData = maximoTemplateData.InvokeProxy();
            var id         = string.Empty;

            maximoTemplateData.ResultObject = new MaximoResult(id, resultData);
        }
Exemplo n.º 3
0
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var entity        = (CrudOperationData)maximoTemplateData.OperationData;
            var maximoTicket  = (ChangeRequest)maximoTemplateData.IntegrationObject;
            var operationData = (CrudOperationData)maximoTemplateData.OperationData;

            HapagChangeHandler.FillDefaultValuesUpadteChange(maximoTicket);
            maximoTicket.RequesterID = (string)entity.GetAttribute("wonum");
            maximoTicket.ProviderID  = string.Empty;

            var description = (String)operationData.GetAttribute("description");

            Log.Debug("Current description of change request is: " + description);

            maximoTicket.Change.Description = description;

            maximoTicket.Change.CustomerID = entity.GetAttribute("pluspcustomer") as string;


            HandleWorkLog(entity, maximoTicket);
            HandleDescription(operationData, description, maximoTicket);
            Log.Debug("Now the description will be: " + maximoTicket.Change.Description);

            var integrationObject = maximoTemplateData.IntegrationObject;

            ISMAttachmentHandler.HandleAttachmentsForUpdate((CrudOperationData)maximoTemplateData.OperationData, (ChangeRequest)integrationObject);
        }
        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.º 5
0
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var integrationObject = maximoTemplateData.IntegrationObject;

            ISMAttachmentHandler.HandleAttachmentsForUpdate((CrudOperationData)maximoTemplateData.OperationData, (ServiceIncident)integrationObject);
        }
Exemplo n.º 6
0
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var entity   = (CrudOperationData)maximoTemplateData.OperationData;
            var maximoWo = maximoTemplateData.IntegrationObject;

            HandleTools(maximoTemplateData, entity, maximoWo);
        }
Exemplo n.º 7
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.º 8
0
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var jsonObject       = (CrudOperationData)maximoTemplateData.OperationData;
            var webServiceObject = (ServiceIncident)maximoTemplateData.IntegrationObject;

            HandleStatus(jsonObject, webServiceObject);
            ISMAttachmentHandler.HandleAttachmentsForUpdate((CrudOperationData)maximoTemplateData.OperationData, webServiceObject);
        }
Exemplo n.º 9
0
        public override void BeforeCreation(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeCreation(maximoTemplateData);
            var jsonObject       = (CrudOperationData)maximoTemplateData.OperationData;
            var webServiceObject = (ServiceIncident)maximoTemplateData.IntegrationObject;

            PopulateAssets(jsonObject, webServiceObject);
            ISMAttachmentHandler.HandleAttachmentsForCreation(jsonObject, webServiceObject);
        }
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var jsonObject       = (CrudOperationData)maximoTemplateData.OperationData;
            var webServiceObject = (ServiceIncident)maximoTemplateData.IntegrationObject;
            var classificationId = jsonObject.GetAttribute("classificationid") as string;

            ISMAttachmentHandler.HandleAttachmentsForUpdate(jsonObject, webServiceObject);
            webServiceObject.Problem.System = classificationId;
        }
Exemplo n.º 11
0
        public override void BeforeCreation(MaximoOperationExecutionContext maximoTemplateData)
        {
            var sr       = maximoTemplateData.IntegrationObject;
            var crudData = (CrudOperationData)maximoTemplateData.OperationData;

            HandleLongDescription(sr, crudData, maximoTemplateData.ApplicationMetadata);
//            JoinDates(sr, crudData, "affecteddateonly", "affectedtime", "affecteddate");

            base.BeforeCreation(maximoTemplateData);
        }
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var jsonObject    = (CrudOperationData)maximoTemplateData.OperationData;
            var changeRequest = (ChangeRequest)maximoTemplateData.IntegrationObject;

            changeRequest.WorkOrder = new WorkOrder {
                Status = jsonObject.GetAttribute("#selectedAction") as string,
                WONum  = jsonObject.GetAttribute("WoActivityId") as string
            };
        }
Exemplo n.º 13
0
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var webServiceObject = (ServiceIncident)maximoTemplateData.IntegrationObject;
            var jsonObject       = (CrudOperationData)maximoTemplateData.OperationData;

            PopulateServiceProviders(jsonObject, webServiceObject);
            PopulateProblem(jsonObject, webServiceObject, maximoTemplateData.OperationData.EntityMetadata.Name, true, maximoTemplateData.ApplicationMetadata.Schema.SchemaId);
            webServiceObject.RequesterID = (string)jsonObject.GetAttribute("ticketid");
            HandleWorkLog(jsonObject, webServiceObject);
        }
Exemplo n.º 14
0
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            var jsonObject     = (CrudOperationData)maximoTemplateData.OperationData;
            var changeRequest  = (ChangeRequest)maximoTemplateData.IntegrationObject;
            var selectedaction = jsonObject.GetAttribute("#selectedAction") as string;
            var groupaction    = jsonObject.GetAttribute("#groupAction") as string;

            ChangeApprovalsHandler(changeRequest, selectedaction, groupaction, jsonObject);
            // add worklog beforewards,so that @@ gets appended in the beggining
            base.BeforeUpdate(maximoTemplateData);
        }
        public override void BeforeCreation(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeCreation(maximoTemplateData);
            var jsonObject       = (CrudOperationData)maximoTemplateData.OperationData;
            var webServiceObject = (ServiceIncident)maximoTemplateData.IntegrationObject;

            PopulateAssets(jsonObject, webServiceObject, maximoTemplateData.ApplicationMetadata.Schema.SchemaId);
            SetClassification(jsonObject, webServiceObject, maximoTemplateData.ApplicationMetadata.Schema.SchemaId);
            HandleBusinessMatrix(webServiceObject, jsonObject, maximoTemplateData.ApplicationMetadata.Schema.SchemaId);
            ISMAttachmentHandler.HandleAttachmentsForCreation(jsonObject, webServiceObject);
            var schemaId = maximoTemplateData.OperationData.ApplicationMetadata.Schema.SchemaId;
        }
        private void CommonsBefore(MaximoOperationExecutionContext maximoTemplateData)
        {
            var entity = (CrudOperationData)maximoTemplateData.OperationData;

            LongDescriptionHandler.HandleLongDescription(maximoTemplateData.IntegrationObject, entity);
            var maximoWo = maximoTemplateData.IntegrationObject;
            var metadata = maximoTemplateData.ApplicationMetadata;

            SetDefaultValues(maximoWo);
            WorkLogHandler.HandleWorkLogs(entity, maximoWo);
            HandleMaterials(maximoTemplateData, entity, maximoWo);
            HandleLabors(entity, maximoWo);
            HandleAttachments(entity, maximoWo, metadata);
        }
Exemplo n.º 17
0
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var trail       = DAO.Save(ISMAuditTrail.GetInstance(ISMAuditTrail.TrailType.Update, maximoTemplateData.ApplicationMetadata));
            var ob          = maximoTemplateData.IntegrationObject;
            var transaction = ReflectionUtil.GetProperty(ob, "Transaction") as Transaction;

            if (transaction == null)
            {
                transaction = new Transaction();
                ReflectionUtil.SetProperty(ob, "Transaction", transaction);
            }
            PopulateTransaction(transaction, trail);
        }
        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.º 19
0
        public override void DoUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            var resultData = maximoTemplateData.InvokeProxy();
            var data       = resultData.ToString();

            Log.DebugFormat("Receiving response from ISM update {0}", data);
            var resultDataValues   = ParseResultData(data);
            var idProperty         = resultDataValues["requesterid"];
            var transactionComment = resultDataValues["comment"];

            if (transactionComment != "Success - No Errors Encountered")
            {
                throw new Exception("ISM Web Service Did Not Return a Successful Response: " + transactionComment);
            }
            maximoTemplateData.ResultObject = new MaximoResult(idProperty, null);
        }
Exemplo n.º 20
0
        public override void BeforeCreation(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeCreation(maximoTemplateData);
            var jsonObject = (CrudOperationData)maximoTemplateData.OperationData;

            if (Log.IsDebugEnabled)
            {
                Log.Debug(jsonObject);
            }
            var webServiceObject = (ServiceIncident)maximoTemplateData.IntegrationObject;

            PopulateServiceIncident(webServiceObject, jsonObject);
            PopulateServiceProviders(jsonObject, webServiceObject);
            PopulateMetrics(webServiceObject, jsonObject);
            PopulateProblem(jsonObject, webServiceObject, maximoTemplateData.OperationData.EntityMetadata.Name, false, maximoTemplateData.ApplicationMetadata.Schema.SchemaId);
        }
Exemplo n.º 21
0
        public void UpdateStatus(UpdateStatusOperationData opData)
        {
            MaximoOperationExecutionContext maximoExecutionContext = GetContext(opData);
            var    user = SecurityFacade.CurrentUser();
            object wo   = maximoExecutionContext.IntegrationObject;

            //just to validate that the json can be converted to a num
            WsUtil.SetValue(wo, "wonum", opData.wonum);
            var    woStatus    = WsUtil.SetValue(wo, "STATUS", opData.status);
            var    statusDate  = WsUtil.SetValue(wo, "STATUSDATE", opData.statusdate ?? DateTime.Now.FromServerToRightKind());
            object statusIFace = WsUtil.SetValue(wo, "STATUSIFACE", true);
            var    nemo        = ReflectionUtil.InstantiateProperty(wo, "NP_STATUSMEMO", new { Value = WsUtil.GetRealValue(wo, "MEMO") });

            WsUtil.SetChanged(nemo, statusIFace, statusDate, woStatus);
            maximoExecutionContext.InvokeProxy();
        }
Exemplo n.º 22
0
        public override void BeforeCreation(MaximoOperationExecutionContext maximoTemplateData)
        {
            var user = SecurityFacade.CurrentUser();
            var sr   = maximoTemplateData.IntegrationObject;

            w.SetValue(sr, "ACTLABHRS", 0);
            w.SetValue(sr, "ACTLABCOST", 0);
            w.SetValueIfNull(sr, "REPORTDATE", DateTime.Now.FromServerToRightKind());

            var crudData = (CrudOperationData)maximoTemplateData.OperationData;

            LongDescriptionHandler.HandleLongDescription(sr, crudData);

            //HandleAttachmentAndScreenshot(crudData, sr, maximoTemplateData.ApplicationMetadata);

            base.BeforeCreation(maximoTemplateData);
        }
Exemplo n.º 23
0
        private void HandleSolutions(MaximoOperationExecutionContext maximoTemplateData, CrudOperationData crudDataEntity, object sr)
        {
            var solutions = (IEnumerable <CrudOperationData>)crudDataEntity.GetRelationship("solution");
            var recordKey = crudDataEntity.Id;
            var user      = SecurityFacade.CurrentUser();

            w.CloneArray((IEnumerable <CrudOperationData>) crudDataEntity.GetRelationship("solution"), sr, "SOLUTION",
                         delegate(object integrationObject, CrudOperationData crudData)
            {
                if (ReflectionUtil.IsNull(integrationObject, "SOLUTION"))
                {
                    w.SetValue(integrationObject, "SOLUTION", -1);
                }
                var enterdate = sr;

                w.SetValueIfNull(integrationObject, "SOLUTIONID", 0);
                w.SetValueIfNull(integrationObject, "ORGID", user.OrgId);


                ReflectionUtil.SetProperty(integrationObject, "action", OperationType.Add.ToString());
            });
        }
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            var user = SecurityFacade.CurrentUser();
            var sr   = maximoTemplateData.IntegrationObject;

            w.SetValueIfNull(sr, "ACTLABHRS", 0.0);
            w.SetValueIfNull(sr, "ACTLABCOST", 0.0);
            w.SetValueIfNull(sr, "CHANGEDATE", DateTime.Now.FromServerToRightKind(), true);
            w.SetValueIfNull(sr, "CHANGEBY", user.Login);
            w.SetValueIfNull(sr, "REPORTDATE", DateTime.Now.FromServerToRightKind());
            WorkLogHandler.HandleWorkLogs((CrudOperationData)maximoTemplateData.OperationData, sr);

            var crudData = ((CrudOperationData)maximoTemplateData.OperationData);

            LongDescriptionHandler.HandleLongDescription(sr, crudData);
            var attachments = crudData.GetRelationship("attachment");

            foreach (var attachment in (IEnumerable <CrudOperationData>)attachments)
            {
                HandleAttachmentAndScreenshot(attachment, sr, maximoTemplateData.ApplicationMetadata);
            }
            base.BeforeUpdate(maximoTemplateData);
        }
Exemplo n.º 25
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());
            });
        }
        public override void BeforeUpdate(MaximoOperationExecutionContext maximoTemplateData)
        {
            base.BeforeUpdate(maximoTemplateData);
            var jsonObject      = (CrudOperationData)maximoTemplateData.OperationData;
            var serviceIncident = (ServiceIncident)maximoTemplateData.IntegrationObject;

            var taskId   = jsonObject.GetUnMappedAttribute("WoActivityId");
            var activity = new Activity {
                type             = "WOActivity",
                ActionID         = taskId,
                ActionLogSummary = jsonObject.GetUnMappedAttribute("#tasksummary")
            };
            var fail = jsonObject.ContainsAttribute("#selectedAction") && "FAIL".EqualsIc(jsonObject.GetAttribute("#selectedAction") as string);

            var ownergroup = jsonObject.GetUnMappedAttribute("activityownergroup");
            var sequence   = jsonObject.GetUnMappedAttribute("activitysequence");

            activity.FlexFields      = ArrayUtil.PushRange(activity.FlexFields, BuildFlexFields(ownergroup, sequence, !fail));
            serviceIncident.Activity = ArrayUtil.Push(serviceIncident.Activity, activity);

            if (fail)
            {
                serviceIncident.Activity = PushExtraActivitiesForFailure(serviceIncident.Activity, jsonObject);
                var user       = SecurityFacade.CurrentUser();
                var wlActivity = new Activity {
                    ActionLogSummary = "Task {0} Failed".Fmt(taskId),
                    ActionLog        = jsonObject.GetUnMappedAttribute("#reasonreject"),
                    type             = "WorkLog",
                    UserID           = ISMConstants.AddEmailIfNeeded(user.MaximoPersonId),
                    ActivityType     = "CLIENTNOTE"
                };

                serviceIncident.Activity = ArrayUtil.Push(serviceIncident.Activity, wlActivity);
            }

            CheckIMACResolved(serviceIncident, jsonObject);
        }
Exemplo n.º 27
0
 public override void AfterFindById(MaximoOperationExecutionContext maximoTemplateData)
 {
     RealCrudFindByIdConnector.AfterFindById(maximoTemplateData);
 }
Exemplo n.º 28
0
 public void DoDelete(MaximoOperationExecutionContext maximoTemplateData)
 {
     RealCrudConnector.DoDelete(maximoTemplateData);
 }
Exemplo n.º 29
0
 public void BeforeDeletion(MaximoOperationExecutionContext maximoTemplateData)
 {
     RealCrudConnector.BeforeDeletion(maximoTemplateData);
 }
Exemplo n.º 30
0
 public virtual void AfterUpdate(MaximoOperationExecutionContext maximoTemplateData)
 {
     RealCrudConnector.AfterUpdate(maximoTemplateData);
 }