Generating an XML list to imprt into EPDM

Hi guys,

I was wondering of anyone could help  through the process of creating and importing an XML file to which EPDM will import please? I cant seem to find any documentation which tells you how to create an xml file for EPDM to then import. Also how does EPDM then add  future imports to the list or does it just replace the list?

Also does it have to be an XML can it be a csv file? As I have managed to create a list as a csv.

Thanks

SolidworksSolidworks Pdm enterprise Pdm
Answers 11
TW
TW 2017-08-17 Best Answer

Hey Scott,

For importing XML into PDM to update PDM datacards, take a look at this thread. There are a few gotchas but it works well. Yes, it has to be an XML file, not CSV. This process is used for updating datacard fields only, not creating new documents.

Here's the general idea: The XML import updates files in PDM after they have been used to create a part/item master in your ERP system first. The ERP is basically sending updated BOM data back to part master files in PDM so they stay synced.

PDM reads the XML file and searches PDM for a document with a datacard variable named the value of the "idattribute" tag and has a value of the "id" tag, then updates the all variables indicated under the

Use alias sets to map PDM variable names to your ERP variable names so you can simply do a raw XML export from your ERP without worrying about converting variable names.

PDM variable "Cost" = ERP variable "material_cost"

PDM variable "Material" = ERP variable "material_name"

PDM variable "Finish" = ERP variable "material_finish"

Also, here's the basic layout you need for each incoming XML file. This XML will do the following:

  • Search for a file in PDM with a datacard field called "PDMDocID" with a value of "2808015"
  • Update the cost variable with value 4.27
  • Update the materialvariable with value ABS-PC
  • Update the finish variable with value Bead Blast

Caution: PDM will only update those datacard variables under the

 

   

      date="1384361754"

      type="wf_import_document_attributes"

      vaultname="your vault name">

     

        aliasset=""

        pdmweid="0"

        idattribute="PDMDocID"

        id="2808015"

        idcfgname="">

       

         

         

         

       

     

   

 

To ensure I don't end up updating the wrong file by searching for a datacard value that "might" get duplicated, I wrote an add-in that grabs the PDM DocumentID and updates the datacard field "PDMDocID" with the PDM DocumentID from the database so the file is truly unique according to the ERP and can be easily tracked and searched with in PDM. I use it for my own needs and give it away free to our clients who sign up for our monthly PDM consulting subscription.

Good luck.

Tim CEPA

Believe in The Q!​

SS
SS 2017-08-18

Hey Tim,

Thanks for your in depth description of the xml import I think I understand the process. What I am confused about is that I thought you could use the XML import to generate a list (for cards) rather than the xml looking for file matches to update?

Thanks again

TW
TW 2017-08-18

You can accomplish what you are wanting with a custom add-in that implements the EdmCmdType.EdmCmd_CardListSrc method. You can serialize (parse) the incoming XML and feed the add-in the data from the XML and it will populate card lists with it.

PM me if you'd like an estimate to get this done.

Tim CEPA

Believe in The Q!

WM
WM 2017-08-21

Hi Scott,

By using an XML import rule, it is possible to import list values and the “links” for “controlled by variable” lists from an XML formatted file. There isn't really anything in the Help / Administration guide but there is a (not public) KnowledgeBase article with an example file in there.  As I think you are only looking to import a simple list I've stripped out the extra sections that define the parent / child relationships between linked lists - We use this with a PDM plugin that generates the XML file from an SQL query, for a Customer who requires a PDM Template to allow for 'dynamic' Project / Sub Project selection. The XML file is recreated when a new project / sub project is created.

The example file has a full header containing all the supported attributes in the XML schema, but I've removed most of it to just have a simple file below...

This creates a list called 'MY-Materials' in a vault called 'EnterprisePDM' - you should change to suit...

 

   

   

     

       

              

       

       

     

       

       

         

       

         

         

         

]>

 

    

 

Good luck...

Wayne

TW
TW 2017-08-21

Wayne, please share the solution ID this can be found by in the knowledge base.

Tim CEPA

Believe in The Q!

TW
TW 2017-08-21

Nevermind, I believe I found it.

A workaround is to configure the links using the XML import functionality. An XML import rule can be used to fill central lists with values as well as define the linked lists. There is an example on the install DVD under \support\ERP\List Import - Linked.xml

comment imagecomment image
WM
WM 2017-09-22

Hi Tim,

Apologies, I don't seem to get any notification for updates to a post I have contributed to. The Solution I was referring to specifically in my post, is not Customer facing so only available to VAR's I believe (I'm not sure about Solution Partners?)

Cheers

Wayne.

LU
LU 2020-09-01

That's all well and good, but how do I create the xml file? I cannot type in or copy, paste and adjust all these lines for every single entry in my csv or Excel file! 

The question is, if there is a macro for Excel or any other kind of program to create this xml file? I have no plans in writing macros for Excel. It's possible to adjust some code to my needs, but I cannot write it from scratch.

In my case, I have an Excel sheet with a number of lines and I want to update version free data card varaibles in PDM.

TW
TW 2020-09-09

Hi Lars,

It's not quite clear is it? Yeah, this part of PDM is a fringe topic that really doesn't get used very often. The concept involves your ERP generating the XML file.

See this part of my post from 2017

Tim Webb wrote:

PDM reads the XML file and searches PDM for a document with a datacard variable named the value of the "idattribute" tag and has a value of the "id" tag, then updates the all variables indicated under the

So, the ERP needs to have knowledge of variables ahead of time, which is the confusing part. Like chicken and egg confusing. Which came first!? I think it would be far easier to use a middleware like CADTalk and skip this.

Hope this helps,

Tim

Believe in The Q!

LU
LU 2020-09-15

Hi Timm,

I think CADTalk is not a solution for my single case. But I looked a bit around and found something that could help me: CSV To XML Converter  

When I have a little bit of time, I will try it out and report my experiences here.

TW
TW 2020-09-15

Well, that is amazing! Let me know if PDM consumes them correctly.

Tim

Believe in The Q!