Exemplo n.º 1
0
        public void DownloadAttachedFile()
        {
            try {
                ModelObject[] objs = itemRev.IMAN_reference;
                if (objs.Length > 0 && objs[0] is Text)
                {
                    Teamcenter.Soa.Client.Model.Property refListProperty = objs[0].GetProperty("ref_list");
                    ModelObject[] refObjs = refListProperty.ModelObjectArrayValue;

                    if (refObjs.Length > 0 && refObjs[0] is ImanFile)
                    {
                        GetFileResponse fileResp = fmsFileManagement.GetFiles(refObjs);
                        FileInfo[]      files    = fileResp.GetFiles();
                        foreach (FileInfo fileInfo in files)
                        {
                            String name = Environment.GetEnvironmentVariable("HOMEDRIVE") + Environment.GetEnvironmentVariable("HOMEPATH") + "\\Desktop\\" + fileInfo.Name;

                            fileInfo.MoveTo(name);
                        }
                    }
                }
            } catch (NotLoadedException e) {
                Console.WriteLine(e.StackTrace);
            }
        }
Exemplo n.º 2
0
        private void getWFProcessandSignOff()
        {
            String QueryName = "Item Revision...";

            System.Console.Out.WriteLine("Quering all the Project which are not in Setup status...... using the Saved Query -\"{0}\" ", QueryName);

            String[] SQEntries = new String[] { "Item ID", "Type" };                //Entries for the Saved Query
            String[] SQValues  = new String[] { "ECN-000472", "Auto CN Revision" }; //Values for each of the Entries of the Saved Query

            ModelObject[] ItemRevisionIds = QueryObjects(QueryName, SQEntries, SQValues);

            dmService.GetProperties(ItemRevisionIds, new String[] { "fnd0AllWorkflows", "process_stage_list" });
            //dmService.GetProperties(ItemRevisionIds, new String[] { "fnd0AllWorkflows" });

            Teamcenter.Soa.Client.Model.Property allWFProps      = ItemRevisionIds[0].GetProperty("fnd0AllWorkflows");
            Teamcenter.Soa.Client.Model.Property processStgProps = ItemRevisionIds[0].GetProperty("process_stage_list");

            ModelObject[] ProcessList = allWFProps.ModelObjectArrayValue;

            if (ProcessList[0].SoaType.ClassName == "EPMTask")
            {
                WorkflowService wfService = WorkflowService.getService(connection);

                EPMTask ePMTask = new EPMTask(ProcessList[0].SoaType, ProcessList[0].Uid);

                //workflowService.PerformAction()

                PerformActionInputInfo[] performActionInputInfo = new PerformActionInputInfo[1];

                performActionInputInfo[0] = new PerformActionInputInfo();

                performActionInputInfo[0].Action           = "SOA_EPM_complete_action";
                performActionInputInfo[0].ClientId         = "001";
                performActionInputInfo[0].ActionableObject = ItemRevisionIds[0];
                performActionInputInfo[0].PropertyNameValues.Add("comments", new String[] { "OK" });

                ServiceData serviceData = wfService.PerformAction3(performActionInputInfo);

                if (serviceData.sizeOfPartialErrors() > 0)
                {
                }
                //workflow.PerformAction(ProcessList[0], "SOA_EPM_complete_action","New Comments","",)
            }

            //throw new NotImplementedException();		Process_stage_list	{Teamcenter.Soa.Client.Model.ModelObject[0]}	Teamcenter.Soa.Client.Model.ModelObject[]
        }