Home
VAASAN AMMATTIKORKEAKOULU
Contents
1. a Favorites Name Date modified Type Size E No items match your search 5 Downloads 25 Recent Places Libraries B Documents d Music E Pictures H Videos TE Computer amp Local Disk C Onla New Volume E GP Documents vbox vl File name NewEnvironment 71 Save as type 2 file zip X z eos EE 0 Open and extract the zip package Name Date modified Type Size iyi NewEnvironment zip 15 12 2014 16 52 ZIP File 302 KB Name Date modified Type R Libraries 15 12 2014 16 55 File folder Plugins 15 12 2014 16 55 File folder Preferences 15 12 2014 16 55 File folder R queries 15 12 2014 16 55 File folder Stylesheets 15 12 2014 16 46 File folder WorkFlows 15 12 2014 16 55 File folder Verify files inside Libraries folder with the report Name Date modified Type Size F libWb8_cm dll 2 1 2014 12 12 Application extension 21KB S libwb8_createdby dll 8 8 2012 12 20 Application extension 21KB 83 libwG8_int dll 8 9 2014 10 46 Application extension 143 KB libWG8_int dllold 16 7 2014 9 02 DLLOLD File 140 KB F wartsila_action_handlers_cmm dll 6 10 2014 15 43 Application extension 122 KB 2 wartsila_rule_handlers_cmm dll 3 7 2014 13 29 Application extension 118 KB WG_PISTACIO dil 26 8 2013 5 28 Application extension 46 155 WG_User_Properties dll 22 4 2013 6 06 Application extension 22K8 Fb wg8int dll 22 4 2013 6 06 Application extension 53KB V
2. Properties py group string a password string y r username string Methods Profile Figure 5 Profile class EnvironmentVariable class Unlike preferences environment variables for Teamcenter are normal system variables for example Teamcenter directory Teamcenter data directory etc These environment variables will be used to locate compulsory directories This class stores needed Teamcenter environment variables EnvironmentVariable A Class Properties op tc_bin string gt tc_data string tc root string tc user lib string Methods EnvironmentVariable n Figure 6 EnvironmentVariable class Reporter class Reporter class is an abstract class It includes protected attributes for its children A normal method readConfig is used to get user input values from UI and populate them to its attributes Abstract method report is for being overridden by inherited classes It will then return List lt string gt type that needed for the final HTML report gt gt Reporter Abstract Class Fields y config Configuration exdudedKeyvvords string Pd includedKeywords string x output string Methods readConfig void report List lt strina gt Reporter DL t O Rm d Figure 7 Reporter class These below classes play a role as processing logic behind UI All of them inherit abstract class Reporter and
3. described as the below quality function deployment 1 Must have a Create a report b Create a zip file c Have a user manual 2 Should have a Selectable specific options b A friendly GUL 3 Nice to have a Exception handling b Smart collecting The below figure 1 is use case diagram of user interface Start collecting customizations m lt lt include gt gt _ PAS LN Fill included exclude R x S ads 2 Collect JAR files lt lt include gt gt d S Fill required information ecu Collect DLL files lt lt extend gt gt lt extends gt Collect Workflows Select options lt lt extend gt gt Collect Queries I User lt extend gt gt 5S r Quit application lt lt extend gt gt Collect XML Rendering Y Collect Preferences Figure 1 List of functions provided by the application The application usage is straight forward therefor e the use case is also simple and short e Before clicking the Start button users have to fill in all required information first o Fill in required information for logging into Teamcenter e g Teamcenter version account credentials Input the keywords for comparing filter o Select what kind of customizations users want to extract e g DLL or JAR e Read Instruction There is an instruction to guide new
4. l 1 I 1 Figure 21 Collecting Query 1 The user selects the Query option clicks the Start button in the UT A new instance of a background worker is created and added the Query work 2 The BW starts running then reporting progress to the UI New instance of QueryProcess invokes overridden report method 4 The QueryProcess instance gets a list of all queries by calling getAllQueries 5 The QueryProcess instance exports filtered query to one XML file and returns a list of query information 6 The QueryProcess instance invokes separateQueryXML function 7 The QueryProcess separates queries one by one from an XML file then saves each to XML files 8 The BW adds Query list to the HTML report 9 The BW finishes and reports work progress to the UI 35 3 4 5 Collecting Workflow The figure below describes how collecting Workflow function works EN E BackgroundWorker WorkflowProcess ITK program HTML Report me i i i i j I Fill required information __ lt eCreate gt gt 1 getCustomizedWorkflowNameList xecute Write Workflow name to Text gt Export workflow to XML File o i i Figure 22 Collecting Workflow digram 1 The user selects the Workflow option clicks the Start button in the UI A new instance of a background worker is created and added the new work 2 Th
5. 1 4 Teamcenter Environment 11 2 TECHNOLOG ARAR 12 21 Teumcemners oo nsss unla ab taney 12 Z Lol TeameentereAPr A na 12 2 1 2 Teamcenter Customizable componehnts 12 2 2 NET Pramework suscita 13 A Aa 14 24 Visual Studio insti lite 14 HIME SECIS Sidi 15 A RE TE 15 3 TEAMCENTER ENVIRONMENT REPORTER 55552222252 16 l General descriptions a 16 3 2 Functional destapa Pi A A At ds 17 3 3 Application Class Vi Wii iia 20 3 3 1 Individual class Vi Witt n s l 21 20 Task Class A ZA L DUL al 28 3 4 Detailed functional description 31 341 Colleeting DEE tor 31 34 2 CA AR EG SCE is z 3 4 3 Collecting Preferentes o 33 3 4 4 Collecting QUE a tai 34 3 4 5 Collecting WOT ION o 35 3 4 6 Collecting XML Rendering Stylesheet 36 3 4 7 Collecting Data model template name 37 4 IMPLEMENTAN 38 4 1 Graphical User Interact 38 Man Tabi Beb 38 A a R s m s m r 40 Other tbb A 42 4 2 IAI APC A a h 43 O ao U areas uc 43 4 2 2 Teamcenter Utilities ninio Duada Lala 45 ADS TK 48 424 XMLPamero ozu a a ba ssla 50 ADS Back
6. MainForm E Class D Form tt Fields Methods 49 Dispos 29 helpLbl_LinkClicked mudos Y initTCVersionComboBox 29 keywordBrowseBtn_Clidk 239 libBW_DoWork 3 libKeywordBtn_Click 29 loadExdudedKeywords MainForm 9 MainForm Load 5 mainWork_ProgressChanged 29 mainWork_RunWorkerCompleted A pluginBw_DoWork 29 prefsw_DoWork Y queryBW_DoWork 29 startBtn_Clic 29 stylesheetBW_DoWork Y tcBrowseBtn_Click 29 teVersionCB_SelectedValueChanged 29 templateBW_DoWork 3 workflowBW_DoWork Figure 2 Application class diagram 0 currentDir 0 debug 3 dilFileste 3 jarFilestxt 3 preferencesGrou 3 preferencesSiteTxt 4 preferencesUserTxt I queriesTxt stylesheetTxt 9 tempFolder 5 templateTxt 33 workflowsTxt Methods 29 createTabletoHt ExecuteComman getCurrentDir getEnvironmentv getKeywords saveFile 1 ove writeToHtm PreferenceScope Enum SITE GROUP USER ROLE To avoid strong coupling classes must be separated and classified into two groups UI and logic This means that the UI class is at the front and is not relevant to process works On the other hand logic classes take care of the whole behind business logic The separation will make the application become more of a loose coupling when being developed 3 3 1 Individual class view e Preference class Preferences are used as environment variables for Teamcenter Two important components of preference are prefe
7. ACEXML Parser dil aciClient dll customize_am dll dbghelp dil icudt341 dil icuin341 dil libadschangemanagement dll libadschangemanagementdispatch dil libadsfoundation dll libadsfoundationdispatch dil libae dil libai dil libaie dil libaie_rx dll libaiwebservice dll libappr dil libarchive dil Figure 26 DLL tab There are two multiple lines textboxes one is included keyword the other for excluded DLL names The excluded keywords box is automatically loaded when users select TC version Because the preference TC_customization libraries holds most of the customized DLL so the user can get these DLL names by pressing Get Keyword button under the keyword textbox The application will ask this preference s values and copy these values to the textbox 4 1 3 Other tabs Similar to the DLL tab other tabs such as JAR XML Workflow Preference Query tab have 2 multiple lines textboxes for included and excluded keywords Excluded keywords are automatically loaded when selecting the TC version ul Environment Reporter IDEAL PLM Excluded Keyword applauncher jar ca odell glazedlists jar Cba1SoaCbabxRac_9000 1 0jar Cba1SoaCbaEx Types_9000 1 0jar com google gson jar com 4 2 1 v20100412 jar com icraft isch 0 1 41 200903070017 jar com tesmcenter rac accessmanager 9000 1 0 jar com teamcenter rac activex win32 win32x86_9000 1 0jar com teamcenter rac activex_9000 1 0 ja
8. Add description for preference instance else if read er Name Equals preference description amp amp reader NodeType XmlNodeType EndElement pref desc reader ReadElementContentAsString Add values for preference instance else if read er Name Equals value amp amp reader NodeType XmlNodeType EndElement valueList Add reader ReadElementContentAsString else reader Read Code snippet 13 Parse Preference XML And Preference XML data is parsed by the code lt preference name Duplo_ESaveAs Drawing Set Revision Master type String array true disabled false gt lt preference description gt lt preference description gt lt context name Teamcenter gt lt value gt object_desc lt value gt lt value gt wg003_81_remarks lt value gt lt value gt wg004_01_type lt value gt lt value gt wg004_ 63 execution_drawing lt value gt lt value gt wg006_01 _drawingstandard lt value gt lt value gt wg006_03 quality instruct lt value gt lt value gt wg006_05 design group lt value gt lt value gt wg006_07_cad type lt value gt lt value gt wg006_08_tight_torque lt value gt lt value gt wg004_ 61 designed for lt value gt lt context gt lt preference gt Code snippet 14 XML data of a preference The XMLDocument is being used for Teamcenter Queries This case is more complicated because all Queries which is exp
9. break queriesTxt mainWork DoWork new DoWorkEventHandler queryBW_DoWork break workflowsTxt mainWork DoWork new DoWorkEventHandler workflowBW_DoWork break stylesheetTxt mainWork DoWork new DoWorkEventHandler stylesheetBW_ DoWork break templateTxt mainWork DoWork new DoWorkEventHandler templateBW_ DoWork break Code snippet 17 Add BW event handler To start running BW method RunWorkerAsync need to be called In each work BW reports progress and update to UI There are a progress bar and a status label in the GUI that inform users about progress and status of current work The following is a code snippet about reporting work to UI when ReportProgress is invoked void mainWork ProgressChanged object sender ProgressChangedEventArgs e update status update progress bar string statusValue e UserState as String toolStripStatusLabel Text statusValue progressBar Value e ProgressPercentage Code snippet 18 BW ProgressChanged event handler When the BW completes event RunWorkerCompleted will be called whether the work is done cancelled or an error happening To handle all the cases a parameter Error is needed to be checked If the BW finishes successfully UI will be updated to notice users and do the rest of work void mainWork RunWorkerCompleted object sender RunWorkerCompletedEventArgs e Error h
10. 12 XML data of a XML Rendering Stylesheet dataset 52 Code snippet 13 Parse Preference 2 2 53 Code snippet 14 XML data of a 54 Code snippet 15 Parse Query 55 Code snippet 16 BackgroundWorker configuration 56 Code snippet 17 Add BW event handler s ss i 57 Code snippet 18 BW ProgressChanged event handler 58 Code snippet 19 BW RunWorkerCompleted event handler 58 Code snippet 20 Write HTML file 59 Code snippet 21 Write 60 Code snippet 22 7zip 61 Code snippet 23 Make zip 61 Code snippet 24 Unit Testeode AAR 63 LIST OF APPENDICES Appendix 1 Teamcenter Architecture Appendix 2 Customization Teamcenter Architecture Appendix 3 Running on a service ABBREVIATIONS API BW COTS CSS DLL GUI HTML ITK JAR OOTB PDM PLM SDK SOA TC UI WF XML Application programming Interface Background Worker Commercial off the shelf Cascading Style Sheet Dynamic Link Library Graphical User Interface Hyper Text
11. Markup Language Integration Toolkit Java archive Out of the box Product Data Management Product Lifecycle Management Software Development Kit Service Oriented Architecture Teamcenter User Interface Workflow Extensible Markup Language 1 INTRODUCTION The Teamcenter Environment Reporter is a desktop application for the company IDEAL PLM to support users when working with Teamcenter customizations 1 1 Client Organization IDEAL PLM IDEAL PLM is a Finnish company established in 1992 The company provides services related to PLM software and systems including implementation integration software licensing and training Currently the company has more than 80 employees located in five different offices around Finland Vantaa Tampere Turku Seinaj ki and Vaasa and Russia Saint Petersburg IDEAL PLM is the representative of Siemens PLM Software and Siemens COMOS products in Finland and Russia Numerous of projects have been either in progress or delivered to customers that varies from small company to large enterprises 1 1 2 Teamcenter Teamcenter is one of Siemens product lifecycle management PLM applications The software provides product data management PDM that helps users manage and control all information related to the products In addition Teamcenter also provides manufacturing data in the context of the product life cycle 2 1 3 Current situation When starting a new project for a
12. Teamcenter database vvith flexibility Similar to preference class this class accumulates queries from XML data gt QueryProcess Class b Reporter Fields 29 allQueriesFileName string Methods 27 getAllQueries void 9 report List lt string gt separateQueryXML void uu Figure 11 QueryProcess class StylesheetProcess class XML Rendering Stylesheet can be customized to create or change view of displaying Teamcenter data for example an item s properties XML Rendering stylesheet methods and properties form this class StylesheetProcess A Class b Reporter Fields a inputFilepath string 22 outputAllstyleFile string Methods exportStylesheet void getAllStylesheet void readXMLStylesheetFile List lt string gt report List lt string gt saveCustomizedStylesheetName List lt string gt m x 4 Figure 12 StylesheetProcess class TemplateProcess class Dependent Data model templates for Teamcenter are stored in XML files This class deals with parsing XML data and make it available in the report 27 TemplateProcess Class Reporter Methods Y readMasterXMLFile List lt string gt report List lt string gt Figure 13 Template class WorkflowProcess class Resembling other customizable modules workflow can be exported into an XML file with all informa
13. Workflows Workflow file name XML Rendering Stylesheet XML file name Templates Data model template name Export to zip package option This is an option if users want to have a zip file compressing all customized files which are found and reported by the application If not selected only a report is output 3 3 Application Class View Because different types of customizations can be made different classes are designed for each type of customization In addition other classes for the application s configuration such as Teamcenter path or user credentials are also needed and described in following sections 21 DLLProcess E Class 9 Reporter Configuration Glass Properties StylesheetProcess Y Fev Chass F export Reporter keywords S profile AT tePath F teversion TemplateProcess y Methods p Configuration 7 Reporter Y Preference A E E 0 Class Reporter y PreferenceProcess y Abstract Class k gt Reporter Properties 5 array 3 desc 3 disabled JarProcess 2 SF name Class type gt Reporter value mi Methods Preference WorkflowProcess y Class Reporter QueryProcess y Cass gt Reporter EnvironmentVari Class Properties tebin 3 tc data 3 tc root SF tc user lib Methods Y EnvironmentVaria Profile Class Properties Ff group password 2 username Methods Profile
14. added the new work 2 The BW starts running The BW reports progress to the UI 4 A new instance of StylesheetProcess invokes overridden method report 5 The StylesheetProcess instance will create a file with a list of all Stylesheet name by calling getA11Stylesheet 6 The StylesheetProcess instance executes an ITK program which exports stylesheets to XML files by name 7 The StylesheetProcess instance returns a list of stylesheet information 8 The BW adds XML Rendering Stylesheet list to the HTML report 9 BW finishes and reports work progress to the UI 37 3 4 7 Collecting Data model template name The figure below describes how collecting Data model template name function works R R EN BackgroundWorker TemplateProcess HTML Report Fill required j 1 A 1 information lt lt Create gt gt eportProgress Add template l ReportProgressi Figure 24 Collecting data model template name 1 The user selects Data model Template option clicks the Start button in the UL A new instance of a background worker is created and added the Data model Template work 2 The BW starts running The BW reports progress to UI 4 A new instance of TemplateProcess invokes overridden method report method 5 The TemplateProcess instance returns a list of template information 6 The BW adds the template list to HTML report 7 The BW finishes and reports the
15. changes in specifications In order to avoid conflicts between functionalities or the changes affect other areas regression tests are conducted whenever a change is made These are major changes have been done and verified by regression tests Table 3 Major changes Date Change 16 07 2014 Change event handlers of Background Worker 06 08 2014 Change XML Parser for reading preference 07 08 2014 Change table format in HTML report 14 08 2014 Add default excluded keywords 30 09 2014 Add data model template as an option 5 3 4 Performance Test This performance testing verifies the response times for reaching the requirement or not The application performance is tested in three conditions e Fresh case new installation of Teamcenter no customization is made e Normal case few customization on Teamcenter Worse case heavy customization on W rtsil environment image The result of the test is evaluated to be positive even in the worst case 65 6 CONCLUSION The project achieved its main objectives During the application development period many changes in filtering logic took place to adjust the application for collecting more accurate customizations An HTML report with collected customization information and a zip package containing these customizations are delivered to users in the end of entire process when the application completes The biggest limitation is that the result is
16. company project managers and engineers often get trouble locating previous customizations and estimating needed working time for the project They would have no idea about previous customizations because of missing or undetailed documentation The solution is to make a tool to help project managers and engineers have more detailed view of the new projects thus better monitoring and reducing time when determining work and time for the new projects 11 1 4 Teamcenter Environment Reporter Teamcenter Environment Reporter is a windows application that can collect all customizations of Teamcenter such as DLL files JAR files Preferences Queries Workflows XML Rendering Stylesheets and make a document report for the accumulated customizations In the end a zip package contains all collected data will be delivered to users and data can be imported to other environments The application supports current Teamcenter versions and provide clear and easy to use GUI for users The application is going to be used within the company starting from next year 2015 2 TECHNOLOGY The application is built based on NET Framework and programmed in C language The user interface UI is designed using Windows Forms which is included in NET Framework To gather some information some Teamcenter APIs and built in XML Parser are used When the application completes collecting information a report page will be displayed as a web page using HTML CSS with
17. dataset information under XML format So an XML parser and ITK program are needed to filter and export them into individual XML files plmxml export is used to export XML Rendering Stylesheet Utilities ExecuteCommand config tcPath plmxml export u profile username p profile password g profile group type XMLRenderingStylesheet xml_file outputFilePath Code snippet 5 Execute export XML Rendering Stylesheet command e Regarding preference Teamcenter Utilities provides very useful command preference managers located in TC_BIN directory In order to execute this command to export preferences in C these code snippets are used preference manager is used with parameters in C Utilities ExecuteCommand config tcPath preferences manager u profile username p profile password g profile group mode export scope scope file inputPrefFile out_file 1 outputPrefFile Code snippet 6 Execute export preference from a file command 4 2 3 ITK Program Collecting DLL and JAR files is quite simple because these files are located in specified directories within Teamcenter root directory But other components need other approach methods Workflows XML Rendering Stylesheets Queries and Preference can be exported by using Teamcenter utilities in the Teamcenter environment command line but it is not full
18. override report method DLLProcess class This class is responsible for getting all DLL files from TC_BIN environment variable and filter these using provided keywords It also copies filtered files to new location for packaging gt gt DLLProcess Class b Reporter Methods Y report List lt string gt Figure 8 DLLProcess class JarProcess class This class is responsible for getting all JAR files from plugin folder of Teamcenter and filter them using provided keywords It also copies filtered files to new location for packaging 25 5 JarProcess Class b Reporter Methods Y report List lt string gt Figure 9 JarProcess class PreferenceProcess class Teamcenter preferences vvill be exported into an XML file Processing parsing filtering XML data is the responsibility of this class Class y QueryProcess class PreferenceProcess 2 Reporter Fields f outputAllSITEPrefXMLFile string outputSITEPrefText string Methods v comparePrefValue bool Y getAllPreferences void v getCustomizedPreferenceList List lt Preference gt getPreferencesFromFile List lt Preference gt 29 readXMLPrefFile List lt Preference gt 9 report List lt string gt Y savePrefFile void Y toStringLine string Figure 10 PreferenceProcess class Query is a string used for searching specific data from the
19. the application filter process algorithm for DLL JAR Workflow and Query is simplified in below picture A customizable component Contain in Included keyword Contain in Excluded keyword Add to Filtered List YES Figure 28 Normal filter logic The logic for preference is described in the following figure A preference Name and values Contain in Included keyword Same as COTS Preference YES Contain in Excluded keyword Figure 29 Preference filter logic Add to Filtered List XMLParser This preference case is more complex than the others because Commercial off the shelf the ready made item but needs to be configured before use preference are usually modified So the XMLParser has to work here to read preference content and compare preference name values with the COTS ones before going through the normal sequence with included and excluded keywords 45 4 2 2 Teamcenter Utilities Teamcenter provides many stand alone programs that can command directly to Teamcenter without logging into client It requires administrator privilege and a configured environment command line to run To manually set up the Teamcenter environment use these commands in the command prompt line set TC ROOT Teamcenter root directory set TC DATA Teamcenter data directory call TC DATASNtc profilevar Code snippet 1 TC environment configurati
20. the zip file of customizations 2 1 Teamcenter The standard installation of Teamcenter is a powerful application that helps to manage product data Part of Teamcenter s power is its adaptability to each company s work processes and user interface preferences 3 2 1 1 Teamcenter API Teamcenter provides various ways to customize depending on business requirements among which is Teamcenter API an Integration Toolkit ITK provided by Siemens PLM Software ITK is based on C and used for server customization There are different ITK interfaces categorized by functionality for Teamcenter customization Unlike C all ITK functions return value ok if successful or an integer error code to inform if unsuccessful Beside normal C data types ITK also uses its own special data type tag_t object in ITK defined by tag of C type It is a run time unique identifier isolates the client code using the object from its representation in memory making it safe from direct pointer access 4 Although there are numerous ways of customizing in Teamcenter the tool only focuses on main and frequently used customizations In the following sections they are explained in detail 2 1 2 Teamcenter Customizable components Below are all components that allow to be customized in Teamcenter 13 Teamcenter DLL file is a library which contains ITK functions written in C and C that perform in Teamcenter server side Teamcenter plugin JAR fi
21. 1 Testing Environments Teamcenter Environment Reporter was tested in three below environments Teamcenter 8 3 Windows Server 2003 VMware e Teamcenter 9 1 Windows Server 2008 Virtual Box Teamcenter 10 1 Windows Server 2008 Virtual Box 5 2 Features to be tested e User Interface must be verified for ease of navigation and use e Collecting filtering DLL JAR Workflow Query XML Rendering Stylesheet Preference and Data model template names must work properly e ITK standalone programs for extracting individual Workflow names and exporting XML Rendering Stylesheet dataset must work properly e Creating HTML file as final report must be opened and readable e Packing all collected customizations into a zip package that is readable 5 3 Test strategy This describes all approach methods for testing the application The application was tested at unit and system level In addition the application was also tested through regression and performance tests 5 3 1 Unit Test For each individual function a unit test can verify the code s behavior and its result for specific correct or incorrect situations Visual Studio provides Test Explorer 63 with Unit testing framework that supports developers effectively when they test their code 14 Each functionality of Environment Reporter is tested and debugged by Unit test to ensure all code s behavior works as expectation Below is code snippet for unit testing of repo
22. ICES 1 Teamcenter Architecture Teamcenter 4 tier layers can be describes in the following figure Client tier Co gt Rich client Thin client Web tier Application server Enterprise tier ss Resource tier o q Volume Database Teamcenter 4 tier architecture is divided into 4 layers e Client layer includes a thin client and a rich client Web layer is a Java application that runs in Java 2 Enterprise Edition application server Enterprise server comprises a server manager This layer retrieves and stores data in the database Resource layer comprises database volumes and file server 69 2 Customization Teamcenter Architecture The below figure shows how the customizations are designed in Teamcenter Eclipse Plug ir R avaScript Ajax Uava JFC SWT o lt gt amp Customization Architect of Teamcenter be divided into 3 layers e Client layer Rich client UI and data handling can be customized by Eclipse plugin written in Java e Web layer runs in a Java 2 Enterprise Edition This layer is used to communicate between Server and Client e Server layer Business logic is defined in this layer Server customization can be done in this layer with ITK a Teamcenter API 71 3 Running the application on the environment Environment settings e Teamcenter 9 1 2 5 e Windows Server 2008 e NET Framework 4 0 Firefox 34 0 5 Start the appli
23. ain features e Cross Language Interoperability Allow and support two different programming languages on the same data structure e Multiple platforms development Now NET provides different types of application o Web application o Web service o Desktop application o Mobile application e Memory management CLR is responsible for managing memory allocating when needed and freeing up memory when done with help of NET Garbage Collector 9 2 3 CH C is a programming language developed by Microsoft and included in NET Framework SDK C syntax is similar to C and Java C is object oriented programming language that means OOP concepts are encapsulation inheritance and polymorphism are supported C runs on the NET Framework with the help of CLR to compile to native machine language 10 2 4 Visual Studio Visual Studio is an integrated development environment by Microsoft to develop applications in multi platforms It contains code editor with ItelliSense to help writing codes faster and more accurately Windows Forms that helps building GUI is included in NET Framework with the support of Visual Studio in order to help programmers in designing interface simply just by dragging and dropping 11 15 2 5 HTML amp CSS Hyper Text Markup Language is a markup language for making Web pages HTML describes the structure and layout of a web page by using defined elements and attributes 12 HTML is the latest versio
24. am Collecting XML Rendering Stylesheet diagram Collecting data model template name Main Form DLL tab JAR tab Normal filter logic Preference filter logic BackgroundWorker concept 18 21 22 22 23 23 24 24 25 25 26 26 27 27 28 29 30 31 32 33 34 35 36 37 39 41 42 43 44 56 Table 1 Required 19 Table 2 User Selec la DlesO pe Oy a aay soe 19 Table Najor chanvessci A ee ei 64 Code snippet 1 TC environment configuration batch 45 Code snippet 2 ExecuteCommand function 46 Code snippet 3 Execute export workflow 47 Code snippet 4 Execute export query command 47 Code snippet 5 Execute export XML Rendering Stylesheet command 47 Code snippet 6 Execute export preference from a file commanq 48 Code snippet 7 ITK code for extract and write workflow names to a text file 48 Code snippet 8 ITK code for exporting a stylesheet to XML file 49 Code snippet 9 Compile commands for two ITK program 50 Code snippet 10 User selection of Teamcenter Versions 50 Code snippet 11 Parse Stylesheet XML 51 Code snippet
25. andle if BW got error if e Error null MessageBox Shov e Error Message Error MessageBoxButtons OK MessageBoxlcon Error MessageBoxDefaultButton Buttonl toolStripStatusLabel Text e Error Message Work is cancelled lse if e Cancelled toolStripStatusLabel Text Cancelled exporting Work is done successfully else progressBar Value 1 Code snippet 19 BW RunWorkerCompleted event handler 59 4 2 6 HTML Report HTML is chosen for the report because its outlook is simple and convenient to navigate through Customizations are divided into tables and attached by anchors After the BW thread completes a HTML file is created by StreamWriter and opened automatically string htmlFile EnvironmentReporter html open a stream to write a file using StreamWriter sw new StreamWriter htmlFile sw WriteLine lt html gt lt head gt sw WriteLine lt title gt Environment Reporter lt title gt Code snippet 20 Write HTML file Each collected customization is attached to the report and illustrated by a table A table displays the information of the customization DLL and JAR table display name path and last modified date e Workflow XML Rendering Stylesheet Query display name and file name e Preference table display name description and value e Data model template table display only name private static voi
26. cation Environment Reporter IDEAL PLM Veson femones X JF Senere TCSICOTSue mene coger iba After the work is done HTML Report is automatically opened Environment Reporter Templates Library Files Plugin Files Preferences Queries Workflows Stylesheets 9 DLL Files DLL Path Modified Date libVb8_cm dll E Siemens TC91COTS BNL libWb8_cm dil 02 01 2014 libwb8_createdby dll E Siemens TC91COTS BNL libwb8_createdby dll 08 08 2012 libVVG8 int dil E Siemens TC91COTS BNL libWG8_int dll 108 09 2014 libVVG8 int dilOld E Siemens TC91COTSI BNL libWG8_int dllOld 16 07 2014 lwartsila_action_handlers_cmm_dll E Siemens TC91COTS BNL wartsila_action_handlers_cmm dllj06 10 2014 Wwartsila_rule_handlers_cmm dll E Siemens TC91COTS BNL wartsila_rule_handlers_cmm dil 03 07 2014 wg8int dil E Siemens TC91COTSI BNL wg8int dll 22 04 2013 WG_PISTACIO dll E Siemens TC91COTS BNL WG_PISTACIO dil 26 08 2013 WG_User_Properties dll IE Siemens TC91COTS BNL WG_User_Properties dll 22 04 2013 1 JAR Files Jar Path Modified Date com wartsila libWbCM_9 1 1 201309191256 jarje Siemens TC91 COTS portaliplugins com wartsila libWbCM_9 1 1 201309191256 23 09 2013 Saving zip package dialog appear to ask users for name of the package OO 11 Computer New Volume E Siemens TC TCOTS tc menu Bfe gt Organize v New folder E
27. d createTabletoHtml string filetype StreamWriter sw string header List lt string gt values int counter values Count opening tags of a HTML table sw WriteLine lt table border 1 gt sw WriteLine lt tr gt lt h2 gt counter filetype Replace gt fil lt ftr gt lt a gt lt ho gt create header of table sw WriteLine lt tr gt foreach string hValue in header sw WriteLine lt td gt lt p gt hValue lt p gt lt td gt sw WriteLine lt tr gt create content of each cell on each foreach string row in values sw WriteLine lt tr gt foreach string value in row sw WriteLine lt td gt value lt td gt sw WriteLine lt tr gt closing tags sw WriteLine lt table gt sw WriteLine lt br gt Code snippet 21 Write HTML table Last but not least in order to have a good looking report a CSS file is attached to HTML to define and style the entire elements of the report 4 2 7 Zip Package One of the most important things is packing a zip package of all extracted customizations After finishing collecting customization files are copied or exported to one folder 7zip is a free software that supports creating zip package from command line 61 Tza exe a tzip destination source Code snippet 22 7zip command If users not only need a report but a file package also a dia
28. d from the main thread to prevent from freezing UI when executing NET provides Background Worker BW as a convenient solution for creating a thread job is which helps implement thread easier and more effective The BW is a built in component that belongs to System ComponentModel namespace in System dll library Ul Thread BackgroundWorker Thread Ul tasks Heavy tasks Ul Thread Ended Figure 30 BackgroundWorker concept A new instance of BW is created and configured to enable a progress report when pressing Start button in GUI Configuring new instance of BW BackgroundWorker mainWork new BackgroundWorker mainWork WorkerReportsProgress true mainWork ProgressChanged new ProgressChangedEventHandler mainWork ProgressChanged mainWork RunWorkerCompleted new RunWorkerCompletedEventHandler mainWork RunWorkerCompleted Code snippet 16 BackgroundWorker configuration After that according to user option selections different operations are added to DoWork event handler of this BW instance 57 foreach object item in checkedListBox CheckedItems check which options are selected and add them to BW work switch item ToString case dllFilesTxt mainNork DoNork new DoWorkEventHandler 1ibBW_DoWork break JARFilesTxt mainWork DoWork new DoWorkEventHandler pluginBW_DoWork break preferencesSiteTxt mainWork DoWork new DoWorkEventHandler prefBW_ DoWork
29. dvantages Researches suggest using uses XMLReader which is suitable for reading XML data and XMLDocument which is better for modifying XML data All of them are included in System XML library Since having efficiency in reading speed XMLReader can read forward only whole XML document fast and save memory space In the application XMLReader is implemented to compare the preferences and to read Stylesheets data The code snippet below shows how Stylesheet XML data is parsed by using XMLReader Stylesheet names will be added to a List lt string gt before being filtered and exported from Teamcenter datasets Setting the XMLReader XmlReaderSettings settings new XmlReaderSettings settings IgnoreComments true settings IgnoreWhitespace true settings ConformanceLevel ConformanceLevel Document Read through all XML elements find and add XMLRendering dataset to a list try using XmlReader reader XmlReader Create fileStream settings while reader Read if reader IsStartElement amp amp reader NodeTyp XmlNodeType Element if reader Name DataSet string styleName reader GetAttribute name if styleList Contains styleName amp amp styleName Contains styleList Add styleName catch Exception ex throw ex Code snippet 11 Parse Stylesheet XML This is a part of XML Rendering Stylesheet XML data which upper code can r
30. e BW starts running The BW reports progress to the UI 4 A new instance of WorkflowProcess invokes overridden method report method function 5 The WorkflowProcess instance gets a list of customized Workflow names by calling getCustomizedWorkflowNameList 6 The WorkflowProcess instance executes an ITK program which writes all workflow names to a text file by name 7 The WorkflowProcess exports workflows to corresponding XML files 8 The WorkflowProcess instance returns a list of workflow information 9 The BW adds the Workflow list to the HTML report 10 The BW finishes and reports work progress to UI 3 4 6 Collecting XML Rendering Stylesheet The figure below describes how collecting XML Rendering Stylesheet function works il EH EZ BackgroundWorker StylesheetProcess HTML Report me 1 1 1 1 Fill required information lt Create gt gt to XML Stylesheet List gt 8 Add Stylesheet section l l l l I l I I I I l l I I I I l I l Figure 23 Collecting XML Rendering Stylesheet diagram 1 The user selects XML Rendering Stylesheet option clicks the Start button A new instance of a background worker is created and
31. e Password infodba ean Teamcenter Version Export Zip package Figure 25 Main Form Firstly users need to provide the application their using Teamcenter version There are 3 supported popular versions of Teamcenter 8 3 9 1 and 10 1 When users select a version the corresponding excluded keywords will be automatically filled Then users insert the account that has adequate administrator privilege In order to locate Teamcenter root and other profile variables the application needs Teamcenter configuration batch file a bat file contains all needed environment variables of Teamcenter Users can choose a text file containing keywords or type keywords to a textbox or both There are different checked boxes that allow users to select which type of customizations they want to have Users can also select Export checkbox and a zip package will be delivered after the report At the bottom of the window a progress bar with status label will indicate status of the running application An instruction for new users with clear instructions and notes will be opened if instruction button is clicked 4 1 2 DLL tab Below is a screenshot of a DLL tab 41 r all Environment Reporter IDEAL PLM ea DLL JAR XMLStylesheet Workfiow Preference Query DLL Keyword Excluded Keyword ACE dll ACEXML dil
32. ead lt DataSet id id95 name MaterialRevisionMasterForm accessRefs id3 version 2 memberRefs id96 type XMLRenderingStylesheet gt Code snippet 12 XML data of a XML Rendering Stylesheet dataset Because of different structures of XML data of Teamcenter components different XMLReader configurations must be set However the idea is the same e The XMLReader reads forward each XML tags by read method e XML tag names will be caught by XMLReader Name property GetAttribute method will return attribute value In the following code snippet preference XML data will be parsed with preference name description and values and will be added to a List lt Preference gt before being filtered 53 if reader Name preference set preference properties by XML value Preference pref new Preference prefList Add pref pref name reader GetAttribute name pref type reader GetAttribute type pref disabled reader GetAttribute disabled pref array reader GetAttribute array List lt string gt valueList new List lt string gt loop to find all value for preference while reader EOF if reader Name continue Break the loop if it is the closing tag of preference else if reader Name preference amp amp reader NodeType XmlNodeType EndElement if valueList Count gt 0 pref value valueList break
33. ecting DLL The figure below describes how collecting DLL function works R 1 information 1 1 DLL files dd DLL section 1 Figure 18 Collecting DLL function 1 The user selects a DLL option clicks the Start button in UI A new instance of a background worker is created and added the DLL work 2 The BW starts running 3 The BW reports progress to the UI 4 Anew instance of DLLProcess invokes overridden report method The return is a list and file paths of collected DLL files 5 The BW adds DLL list to the HTML report 6 The BW finishes and reports work progress to the UI 3 4 2 Collecting JAR The figure below describes how collecting JAR function works iz Fill required Ea 555 2755 information I I 1 I I I f I 1 1 i I 1 Figure 19 Collecting JAR diagram 1 The user selects the JAR option clicks the Start button in the UI A new instance of a background worker is created and added the JAR work 2 The BW starts running 3 The BW reports progress to the UI 4 A new instance of the JARProcess invokes overridden report method The return is a list and file paths of collected the JAR files 5 The BW adds the JAR list to the HTML report 6 The BW finishes and reports work progress to the UI 3 4 3 33 Collect
34. erify files inside Plugins folder vvith the report Name Date modified Type Size 22 com wartsila libWbCM_9 1 1 201309191256 23 9 20139 21 JAR File 80 KB Verify files inside Workflows folder with the report Name Date modified Type Size tel CMM Delete Status xml 15 12 2014 16 45 XML Document 7KB 8 CMM Errors xml 15 12 2014 16 45 XML Document 12KB tel CMM Gather Objects for Migration xml 15 12 2014 16 45 XML Document 12KB 8 CMM Migration Approved xml 15 12 2014 16 45 XML Document 49KB 8 CMM Migration Initial xml 15 12 2014 16 45 XML Document 6KB 8 CMM Migration xml 15 12 2014 16 45 XML Document 27 KB 8 CMM ReMigration xml 15 12 2014 16 45 XML Document 20 KB 8 CMM Simple Migration xml 15 12 2014 16 45 XML Document 21KB 48 CMMSortSub xml 15 12 2014 16 45 XML Document 32KB tel QuickCMM_Done xml 15 12 2014 16 46 XML Document 3KB
35. ifa o S s s s P i CHECK A F find the dataset based on file name in command parameter ERROR find dataset xmlFileNamelil amp dataset dataset ask real name of this dataset 1 NULI LTAG H ERROR C ECK AE ask dataset named refs dataset o srefDataset ugh all dataset j found amp amp lifail j orgFileName IMF filename size c 11 outputFilePath ERROR CH Name il append tFilePath trlen orgFileName 2 utFile utpu outp trcat o trcat o trcat o rintf export fail utp utp utp nE EO ERRO outputFilePa NULL ECK IMF_ask original file name refDataset j th and file name char MEM alloc strlen outputPath Path N tFilePath tFilePath tFilePath port file path XML file R CHECK IMF export file refDataset j th outputPath y orgFileName outputFilePath u u u EX 58 Code snippet 8 ITK code for exporting a stylesheet to XML file Because different Teamcenter versions have different libraries the ITK programs have to be compiled in different environments There are three popular Teamcenter versions 8 3 9 1 and 10 1 thus each ITK program has three executable files The application decides which executable file by user selections The following command will compile c file and link ITK with obj fi
36. ing Preference The figure below describes how collecting Preference function works BackgroundVVorker PreferenceProcess HTML Report Fill required 1 1 information r ReportProgress getPreferencesFromfilel Export XML file 1 I 1 I 1 1 I 1 I I I 1 I I I 1 I 1 i 1 1 I reference sectior 1 r ReportProgress Figure 20 Collecting Preference diagram The user selects Preference option clicks the Start button in the UI A new instance of a background worker is created and added the Preference work The BW starts running The BW reports progress to the UI A new instance of the PreferenceProcess invokes overridden report method The PreferenceProcess instance gets a list of customized preferences by calling getCustomizedPreferenceList The PreferenceProcess instance exports found preferences to XML file and returns a list of preference information The BW adds the Preference list to the HTML report The BW finishes and reports work progress to the UI 3 4 4 Collecting Query The figure below describes how collecting Query function works information Save separated XML q 1 1 1 I 1 l 1 1 I 1 I 1 I 1 1 1 I I I I I 1 I 1 I I
37. le Output is an executable standalone exe file call compile DIPLIB none wf2txt c call linkitk o wf2txt wf2txt obj call compile DIPLIB none ds2xml c call linkitk o wf2txt ds2xml ob Code snippet 9 Compile commands for tvvo TTK program In CH static method Utility ExecuteCommand will be called to execute the proper TTK program version for retrieving all workflow names try 4 5 run switch config tcVersion Utilities Execu select correct version tring vf2TxtExecFile case 8 wf2Txt break Case 0 wf2TxtExecFile break Case 10 wf2Txt break default wf2Tx break ExecFile ExecFile ExecFile wf2txt executable file teCommand config tcPath Utilities currentDir wf2TxtExecFile u profile username p profile password g profile group outputFile catch FileNotFoundException ex Console WriteLine WF process file not found Consol Writ Line ex ToString Code snippet 10 User selection of Teamcenter versions 4 2 4 XML Parser Because exporting or importing Teamcenter customizable components such as Preferences XML Rendering Stylesheets and Queries are formatted as XML files 51 XML Parser is needed to parse XML data NET Framework supports several built in XML Parsers each of which has both advantages and disa
38. le The Teamcenter rich client is built on Eclipse rich client platform RCP framework Thanks to the framework now by using Eclipse plugin files JAR the Teamcenter rich client can be customized 5 Teamcenter workflow is an automation of business procedures that manages products processes Using workflows will improve efficiency and performance of product life cycle management 6 Teamcenter query is used to find information in Teamcenter a search criteria will be inserted Query is saved criteria that accelerate searches 7 Teamcenter Preferences are special environment variables stored in the Teamcenter database Customize preferences can change Teamcenter application behaviors 8 Teamcenter data model template contains a data model definition about business objects and rules Teamcenter can install many Data model templates to meet business requirements Teamcenter XML Rendering Stylesheets are XML documents stored in XMLRenderingStylesheet dataset It defines how a dialog or panel is displayed in Teamcenter 2 2 NET Framework The NET Framework is a programming framework for Windows application developed by Microsoft Two main components of NET framework are e Common Language Runtime CLR A runtime environment that manages compiling executing debugging security NET Framework class library FCL A library includes pre made classes and interfaces for users The NET Framework has some m
39. log will be opened and ask for the saving location after the BW completes configure save dialog with only zip extension allowed SaveFileDialog sfd new SaveFileDialog sfd Filter Zip file 2 z1p open dialog and ask for a file name if sfd ShowDialog DialogResult OK LEY string fileName sfd FileName toolStripStatusLabel Text Making zip package delete the old file if exists if File Exists fileName File Delete fileName string zipMaker Utilities currentDir 7za exe run 7zip command to create zip package Utilities ExecuteCommand zipMaker a tzip 4 fileName customizedFolder catch Exception ex MessageBox Show ex Message Code snippet 23 Make zip package In order to use the command the 7zip command line version needs to be downloaded from http www 7 zip org download html and place to same folder as executable file of Environment Reporter Thanks to great help of 7zip the zip package will be delivered to the users after command completes 5 TESTING From the first developing steps to further Teamcenter Environment Reporter was tested in various system environments and situations During testing bugs and errors are identified and fixed On the other hand enhancements are also made to improve the performance A testing plan is prepared to ensure this software meets actual requirements 5
40. mand function With Teamcenter utilities Workflows Queries and XML Rendering Stylesheets can be exported by using command plmxml_ export But this command is limited to tailor made options Therefore stand alone ITK programs must be coded to fulfill the limitations When exporting Workflows plmxml_ export only works if the workflow names are already known An ITK program can find all Teamcenter Workflows and write them down to a text file The application reads text file and calls plmxml_export for each workflow 47 plmxml export is used to export Workflow Utilities ExecuteCommand config tcPath plmxml export u profile username p profile password g profile group xml file 1 outputFilePath 12 mplat nu 1 workflowName 2550 Code snippet 3 Execute export workflow command e When exporting Queries plmxml export only exports an XML file containing all queries of Teamcenter To separate into smaller query XML file XMLDocument will do the job plmxml export is used to export Query Utilities ExecuteCommand config tcPath plmxml export u profile username p profile password g profile group imantypedef ImanQuery xml_file outputFile Code snippet 4 Execute export query command e Concerning XML Rendering Stylesheet p1mxm1 export only export XML file containing all Stylesheet
41. n of the HTML standard with strong multimedia support for computers and mobile devices This 5 is now the recommendation of the World Wide Web Consortium VV3C CSS is the language for describing the presentation of Web pages including colors layout and fonts CSS is used to format HTML elements in order to build Web pages with special styles CSS can be written inside HTML as an internal component or external as a css file The latter way is more useful because it would be easier for reading and maintenance 12 2 6 XML The Extensible Markup Language XML is a markup language like HTML but using own designed elements instead of using pre defined ones XML is targeted to describe text data and widely used in web services 13 XML Parser To read or write XML document written XML parser is used to do such things to save time and reduce work NET Framework provides several classes for parsing XML data such as XMLReader XMLDocument LINQ to XML They have their own advantages and disadvantages that grant programmers flexibility in usage 3 TEAMCENTER ENVIRONMENT REPORTER This part covers the specification of Teamcenter environment reporter application that is resulted from collecting and analyzing requirements 3 1 General description The Teamcenter Environment Reporter will only be used by IDEAL PLM employees who do not have adequate documentation or have documentation but not completed one about
42. on VAASAN AMMATTIKORKEAKOULU VASA YRKESHOGSKOLA amp UNIVERSITY OF APPLIED SCIENCES Nam Hai Vu TEAMCENTER ENVIRONMENT REPORTER Information Technology 2014 VAASAN AMMATTIKORKEAKOULU UNIVERSITY OF APPLIED SCIENCES Information Technology ABSTRACT Author Nam Hai Vu Title Teamcenter Environment Reporter Year 2014 Language English Pages 66 6 Appendices Name of Supervisor Ghodrat Moghadampour The objective of this thesis was to develop an application which can seek customizations in a Teamcenter environment and create a report about them Teamcenter is a tool for product data management Its customizations are Teamcenter library plugin workflow query preference XML rendering stylesheet and data model template The idea of this project is originated from IDEAL PLM to have a tool for collecting Teamcenter customization data It gives project managers an overview of completed customizations when working with a new environment project Based on the report they can estimate working times needed for the whole project more accurately and efficiently The Teamcenter Environment Reporter consists of two parts a Windows application implemented in C NET and a helper module implemented in C language The helper module works as an intermediator which takes care of communication between the Windows application and Teamcenter The application uses Teamcenter libraries and utilities to process data At the end of the
43. on batch Since Teamcenter always has a batch file doing the same users only have to provide this batch file to the application instead of making their own The batch file is ready under TC_ROOT tcmenu A static method named ExecuteCommand in the Utilities class is defined to run any Teamcenter command The first parameter is the path of the batch file the second one is a command The following code snippet described ExecuteCommand method public static string ExecuteCommand string tcPath string command ProcessStartInfo processInfo new ProcessStartInfo cmd display command window if debug processInfo CreateNoWindow false else processInfo CreateNoWindow true Print all input output and error to screen processInfo UseShellExecute false processInfo RedirectStandardError true processInfo RedirectStandardiInput true processInfo RedirectStandardOutput true string output Process process Process Start processInfo if process null setting Teamcenter configuration process Standardinput NriteLine tcPath write the command that is executed process Standardinput NriteLine command process StandardInput Close line added to stop process from hanging on ReadToEnd output process StandardOutput ReadToEnd if debug string error process StandardError ReadToEnd process Close Code snippet 2 ExecuteCom
44. oround Worker yonin aa asa ai 55 4 2 6 AE IMIG RC DO 59 ADS vip Packard ai 60 r EROLUN L A 62 51 Testing Environment viii incidi 62 2 5 Features t be t sted o a a da 62 2 ARA D a 62 ou UME SS ose d e ca 62 63 ORESTES 64 5 3 4 Performance Testi 64 6 CONCLUSION marso ii 65 T REFERENCES nio Seve Sous iio igs 66 APPENDICES 2 m 68 LIST OF FIGURES TABLES AND CODE SNIPPETS Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 Figure 27 Figure 28 Figure 29 Figure 30 List of functions provided by the application Application class diagram Preference class Configuration class Profile class EnvironmentVariable class Reporter class DLLProcess class JarProcess class PreferenceProcess class QueryProcess class StylesheetProcess class Template class WorkflowProcess class Utilities class Configuration and its relation class diagram Process classes diagram Collecting DLL function Collecting JAR diagram Collecting Preference diagram Collecting Query Collecting Workflow digr
45. orted by plmxml export command is grouped in only one XML file By using XMLDocument each query can be detached from the big XML file and saved into a separated XML file 55 Iterate all queryNode in a List foreach XmlNode queryNode in queryNodeList XmlDocument doc2 new XmlDocument doc2 Load filePath Add namespace to Namespace Manager XmlNamespaceManager nsmgr2 new XmlNamespaceManager doc2 NameTable nsmgr2 AddNamespace plimxml bus http vuv plmxml org Schemas PLMXMLBusinessSchema XmlNodeList queryNodeList2 doc2 SelectNodes plmxml_ bus PLMXMLBusinessTypes plimxml bus Sav edQueryDef nsmgr2 cemove all nodes but keeping one node foreach XmlNode queryNode2 in queryNodeList2 if queryNode2 Attributes name Value queryNode Attributes name Value if queryNode2 ParentNode null queryNode2 ParentNode RemoveChild queryNode2 save xml document doc2 Save Path GetDirectoryName filePath 11 queryFileName o xmil Code snippet 15 Parse Query XML The output of the above code will be XML files corresponding to filtered queries These exported XML files can be validated and imported back to Teamcenter 4 2 5 Background Worker Collecting customizations is a heavy procedure of tasks such as executing Teamcenter commands filtering saving and creating report Therefore this procedure should be taken to a separated threa
46. previous customizations have been done in Teamcenter previously The resolution is developing an application can collect all of previous customizations and make a brief report The application should fulfil the following requirements After User friendly No need to be complicated because it will be hard for everyone to remember console command or name of Teamcenter objects A desktop application with simple GUI will fulfill this requirement Selection for customizable parts Users can select what type of customizations they want to extract the options are DLL JAR XML Rendering Stylesheet Workflow Query and Preference Report and files A report as well as a zip file containing all customization information is generated after each use for fulfilling this requirement Performance The application performance is required to work in good amount of time even in a complicated system Maintenance and upgrade The new Teamcenter version is coming so the application needs to be well designed with clear specification Moreover the message of errors is required for bug fixing analyzing all requirements the following technical specification can be considered 17 3 2 Functional description The most important functionality of the application is collecting customizations and making a report for it Another aspect is GUI s usefulness and simplicity There are requirements with different priority levels needed to be considered and
47. process required data will be delivered to the user as a report in HTML format and as a zip package containing all accumulated customizations All require functions for the application were successfully implemented and all objectives were achieved The application is presented to IDEAL PLM and waiting to be used in the near future Keywords Teamcenter customization Environment reporter PREFACE It has been three years since I started my degree in Information Technology at Vaasa University of Applied Sciences During the time I have not only learned invaluable IT knowledge such as software developing and testing but I also have improved my interpersonal skills every time working in team with other classmates in a project Combining everything together I successfully manage to deliver my final project as my thesis The project started from July 2014 and finished in October 2014 was inspired by my CTO Olli V t inen at IDEAL PLM In the company I have got invaluable first hand working experiences in software industry Therefore I would like to thank Olli for giving me this very interesting chance Also my thank goes to Dr Ghodrat Moghadampour for his supervising of this thesis TABLE OF CONTENTS 1 TINIRODUCTUOMNuzusLARR RIR Zn 10 1 1 Client Organization IDEAL 5522 10 1 2 eam Center reise pen daaa anada b IA 10 13 Current sita eed as aaa asi Da 10
48. r com teamcenter rac activity_9000 1 0jar com teamcenter rac adalicense 9000 1 0 jar com teamcenter rac aif registryeditor_9000 1 0 jar com teamcenter rac aifrcp 9000 1 0 jar com teamcenter rac appearanceconfiguration_9000 1 0 iar com teamcenter rac applications integration_9000 1 0 jar com teamcenter rac architecturemodeler 9000 1 0 jar com teamcenter rac asbuiltmanager_9000 1 0jar com teamcenter rac auditmanager_9000 1 0 iar com teamcenter rac authorization 9000 1 com teamcenter rac avvchostinterop 9000 1 0 iar com teamcenter rac barchart 9000 1 0 yar com teamcenter rac bom 9000 1 com teamcenter rac cae ase_9000 1 0jar com teamcenter rac caese 9000 1 0 iar com teamcenter rac caese_dm_9000 1 0jar com teamcenter rac charts_9000 1 0jar Figure 27 JAR tab 43 4 2 Main application Implementation in the main application is divided into parts which are described and discussed here 4 2 1 Filter In order to collect customization data accurately filters are needed to be applied to every Teamcenter customizable components using included and excluded keyvvords Both included and excluded keyvvords are normally identified by users In addition Teamcenter already has out of the box original functionality ready to be used components so excluded keywords must have these OOTB names Therefore included keywords and excluded keywords are displayed as multiple lines text boxes in the GUI In
49. rence name and preference value Preference value can be in different types such as string array string and number With the support of Teamcenter preferences can be exported and imported as XML files Hence a class for Teamcenter preference instance is created with similar properties to preference XML attributes Preference Class Properties op array string desc string Y T disabled string ya name string SS type string 2 value List lt string gt Methods Y Preference Figure 3 Preference class Configuration class In order to gather all users settings right after clicking Start button Configuration instance is created to store all current settings for logic to process The current settings are Configuration s properties EnvironmentVariable export List keywords profile Teamcenter path and Teamcenter version y Configuration Class Properties ev EnvironmentVariable gt export bool keyWords List lt string gt gt profile Profile i tcPath string gt tcVersion int E Methods Configuration Figure 4 Configuration class Profile class Teamcenter utilities require username password and group when executing commands in order to extract data from Teamcenter database 23 This class stores users credentials like username password and group when logging into Teamcenter y Profile Class
50. restricted by user keywords This problem becomes even more difficult to be solved in an efficient way due to differences in Teamcenter versions Therefore the filtering logic is still being improved for getting better results Another limitation is that the application has not been tested in a production environment which requires permissions when testing Instead it has been tested in a local copied images of environments which does not require any permission One improvement which can be made in the future could be one optional functionality that categorizes customizations into projects With this users can evaluate needed resources for the project work easier and faster when reviewing the final report Developing this application provided a chance to improve programming skills and get a better understanding of Teamcenter which is essential for pursuing career in IDEAL PLM in the future 7 REFERENCES 11 Company Info Accessed 12 10 2014 http www ideal fi en info company info 2 Overview of Teamcenter Accessed 18 12 2014 https support industrysoftware automation siemens com docs teamcenter 9 1 hel p index html uid index_plm00002 1d254816 c01a0001 3 Overview of customization Accessed 18 12 2014 https support industrysoftvvare automation siemens com docs teamcenter 9 1 hel p index html uid index_plm00003 1d239801 why_customize 4 ITK Function Reference Accessed 12 10 2014 https support industry
51. rt function of JarProcess as an example TestMethod public void reportTest Setting Teamcenter configuration Profile profile new Profile infodba infodba dba EnvironmentVariable ev new EnvironmentVariable E Siemens TC91x32 E Siemens TC91x32 TC91x32tcdata Q E Siemens TC91x32 bin E Siemens TC91x32 BNL List lt string gt keyword new List lt string gt keyvord Add Configuration config new Configuration 9 profile ev E Siemens TC91x32 tc_menu TcEng WTC91x32 bat keyword Erue String currentDir E Test Test JarProcess by exporting a List JarProcess target new JarProcess target readConfig config currentDir List lt string gt actual target report Test if the List is null or not Assert IsNotNull actual Code snippet 24 Unit Test code 5 32 System Test The entire application is tested in this level It verifies all application components are integrated and meets the requirements Teamcenter Environment Reporter is tested as a whole in different environments In this test a problem is found whenever ITK code is not compatible with different versions of Teamcenter Then the solution is re compiling ITK code under proper environments and give users a combo box to select in GUI 5 3 3 Regression Test From the beginning steps of development Teamcenter Environment Reporter received comments to have
52. software automation siemens com docs teamcenter 10 1 he Ip en_US custom ITKFunction index html 5 Client Customization Programmer s Guide Access 15 10 2014 https support industrysoftvvare automation siemens com docs teamcenter 9 1 PD F pdf client customization programmers guide pdf 6 Workflow Designer Guide Accessed 17 10 2014 https support industrysoftware automation siemens com docs teamcenter 9 1 PD F pdf workflow_designer pdf 7 Query Builder Guide Access 17 10 2014 https support industrysoftware automation siemens com docs teamcenter 9 1 PD F pdf query_builder pdf 8 Utilities Preference Accessed 17 10 2014 https support industrysoftvvare automation siemens com docs teamcenter 9 1 PD F pdf utilities_reference pdf 9 NET Framework Conceptual Overview Accessed 21 10 2014 http msdn microsoft com en us library vstudio zw4w595w 28v vs 100 29 aspx 67 10 CE Language and the NET Framework Accessed 21 10 2014 http msdn microsoft com en us library z1zx9t92 aspx 11 Windows Forms Overview Accessed 21 10 2014 http msdn microsoft com en us library 8bxx y49h 28v vs 110 29 aspx 12 HTML 82 CSS Accessed 26 10 2014 http www w3 org standards webdesign htmlcss 13 XML Essentials Accessed 27 10 2014 http www w3 org standards xml core 14 Unit Test Framework Accessed 10 11 2014 http msdn microsoft com en us library ms243 147 28v vs 80 29 APPEND
53. tion and is saved as XML data This class handles exporting workflow data and processing it for the report gt gt WorkflowProcess Class b Reporter Fields 9 allWFFileName string Methods Y exportWorkflow void getAllWorkflows void aY getCustomizedWorkflowNameList List lt string gt Y report List lt string gt Figure 14 VVorkflovvProcess class Utilities class Utilities class is a group of frequent utility functions and constant variables Methods in this class are defined public and static Some functions are overloaded each other to be flexible in used gt Class 5 Fields 0 currentDir string debug bool 15 dilFilesTxt string LA jarFilesTxt string 5 preferencesGroupTxt string 15 preferencesSiteTxt string 15 preferencesUserTxt string 5 queriesTxt string 15 stylesheetTxt string 15 templateTxt string E workflowsTxt string 5 Methods v createTabletoHtml void 2 overloads ExecuteCommand string 1 overload getCurrentDir string getEnvironmentVariables EnvironmentVariable getKeywords List lt string gt saveFile void 1 overload veriteToHtmi void Figure 15 Utilities class UlForm class The GUI class contains event handlers for UI controls such as button textbox checkbox 3 3 2 Task Class View There are 6 tasks for 6 corresponding available op
54. tions and a task for collecting all required information The application will create a new instance of class Configuration from user s inputs including TC account information environment variables and application configurations EnvironmentVari Class Properties F tc bin string tc data string tc root string Methods 29 Properties Y EnvironmentVaria Properties xy ev Environment export bool 358 keyWords List profile Profile SP teath string tcVersion int Methods Configuration MainForm SP MainForm Y Class gt Form 2 group string SP password string username string 37 tc user lib string Configuration Configuration a E Configuration Methods Class 5 Profile Figure 16 Configuration and its relation class diagram The application creates a new thread and this will be responsible for extracting all Teamcenter customization information and filter them using provided keywords The logic for this is placed in below classes called Process classes These inherits Reporter class that is defined as an abstract class 17 Process classes diagram igure F 31 3 4 Detailed functional description Sequence diagram is to describe interactions between the application s components with each other by passing messages among them 3 4 1 Coll
55. users how to use the application Quit application Stop running application and exit This is required information related to Teamcenter environment that users need to know and fill before using the application 19 Table 1 Required information Required Information Description Required for Preferences Target version of running Queries Teamcenter version Teamcenter Workflows XML Rendering Stylesheets Username password Preferences User credentials group for logging in to Queries Workflows XML Rendering Stylesheets DLL files JAR files Teamcenter configuration Path for Teamcenter Preferences path configuration batch file Queries Workflows XML Rendering Stylesheets Besides the application needs keywords that are put by users for filtering customizations There are two types of keywords included and excluded keyword Included keywords Search for all customizations contains included keywords Excluded keywords After collecting all customizations with included keywords exclude the customizations containing excluded keywords There are 7 available options which correspond to 7 customizations for users to select Table 2 User selectable option Options Description DLL files DLL file path last modified date JAR files JAR file path last modified date Preferences Preference name value description Queries Query name description
56. work progress to the UI 4 IMPLEMENTATION This chapter is divided into 2 main parts the GUI and the main application are discussed in the following sections 4 1 Graphical User Interface Thanks to Windows Forms now the GUI design for Windows application is much easier than ever before Windows Forms is a graphical API included in NET Framework With the help of Visual Studio the application s GUI is designed with Windows Forms controls such as textboxes buttons progress bars etc and automatically generated action events such as mouse clicks key presses to name a few attached to those controls The GUI also needs to support resizing windows by separating controls into panels and anchors Hence it is possible to resize the application window if users get trouble with their screen resolution In the application the GUI s target is to be user friendly but to concentrate on the report result So the design is as simple as described with below steps 1 Provide Teamcenter information username password version 2 Provide acknowledged keywords 3 Select supported options Due to different types of Teamcenter customizations different tab views are required 4 1 1 Main Tab 39 The main tab is the most important tab it consists of all controls that require input from users r all Environment Reporter IDEAL PLM Main DLL JAR XMLStylesheet Workflow Preference Query Usemam
57. y supported Therefore ITK program will be used to fulfill unsupported parts This ITK program is used to find all workflow names in Teamcenter and write them down to a text file It can be done by the code snippet below int workflow count 0 char nameList NULL initialize module and find all workflows ifail ERROR CHECK EPM init module ifail ERROR CHECK EPM ask all procedure names amp workflow count snameList for each found vorkflov vrite it dovn to a text file if uorkflov count gt 0 FILE pFile pFile fopen fileName w for i i workflow count i fprintf pFile s n nameList i fclose pFile Code snippet 7 ITK code for extract and write workflow names to a text file 49 A text file with all workflow names will be created after running this ITK program From that we can export each workflow into XML file using Teamcenter utiliti es About XML Rendering Stylesheets first Teamcenter utilities exports a XML file containing all Teamcenter stylesheets Then stylesheet names will be filtered and parsed by the XMLParser After that another ITK program is needed to read and export stylesheet names to XML file from the text file A code snippet below only shows ITK code the other works are in other parts ifail if lifail 66 ifail sfound Iterate thr for j 0 char char ifail orgFile if l
Download Pdf Manuals
Related Search
Related Contents
Toshiba 20AS23 Flat Panel Television User Manual Fujitsu ESPRIMO P720 E85+ A-95 Planification stratégique d`une organisation de - LPLCOOP Columbian 10404 Use and Care Manual YOGA FR RPS 450 User Manual 1870∼90年代北満洲における辺境貿易と漢民族の移住 Copyright © All rights reserved.