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 <configuration name=... tag.
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 <configuration name=... tag if they are mapped to SW custom properties.
vaultname="your vault name">
<configuration name="enter the configuration to find">
<attribute id="1" name="Cost" value="4.27"/>
<attribute id="1" name="Material" value="ABS-PC"/>
<attribute id="1" name="Finish" value="Bead Blast"/>
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.
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?
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.
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...
<!DOCTYPE xml [
<!ELEMENT xml (transactions)>
<!ATTLIST xml ignored (-1|0) "0">
<!ELEMENT transactions (transaction)+>
<!ELEMENT transaction (document|notification|list|serial_number|bom)+>
<!ATTLIST transaction type (wf_import_document_attributes|import_notifications|import_lists|import_serial_numbers) #REQUIRED>
<!ATTLIST transaction date CDATA #REQUIRED> <!-- Seconds since 1 Jan 1970 00:00 -->
<!ATTLIST transaction ignored (-1|0) "0">
<!ATTLIST transaction vaultname CDATA #REQUIRED>
<!ELEMENT list (item+,link*)>
<!ATTLIST list name CDATA #REQUIRED>
<!ELEMENT item EMPTY>
<!ATTLIST item item_name CDATA #REQUIRED>
<!ELEMENT link EMPTY>
<!ATTLIST link source_variable CDATA #REQUIRED>
<!ATTLIST link list_variable CDATA #REQUIRED>
<!ATTLIST link link_value CDATA #REQUIRED>
<!--To use the dtd in an external file: <!DOCTYPE xml SYSTEM "filename.dtd">-->
<transaction type="import_lists" date ="123459" vaultname ="EnterprisePDM">
<!-- Just a list without links -->
<list name ="MY-Materials" >
<item item_name ="Ceramic"/>
<item item_name ="Ferrous Metal"/>
<item item_name ="Nonferrous Metal"/>
<item item_name ="Superalloy"/>
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?)