cancel
Showing results for 
Search instead for 
Did you mean: 

How to transform a XML to PLMXML so it can be imported into Teamcenter

Experimenter
Experimenter

Hi,

 

I would like to have some suggestion on how to transform a normal XML to PLMXML.

Since PLMXML uses references (cross reference xml) to its xml nodes its a bit tricky. I have following tools to use, preferable in the below order: 

1. XSLT

2. C#

 

Is there a SDK or other APIs to use?

Any suggestion is appreciated.

 

Regards,

Roger

 

 

9 REPLIES

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

Can you provide some more details on your use case?

xtof

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Experimenter
Experimenter

 

Hi,

 

I would like to have some suggestion on how to transform a normal SAP XML to PLMXML "scheduling". Since PLMXML uses references (cross reference xml) instead of grouping nodes together it's a bit tricky to get the attribute references correct.


On this URL you could see a sample of a PLMXML (not a scheduling, but it doesn't matter the principle is the same) 

http://stackoverflow.com/questions/27819432/how-to-transform-plm-xml-into-excel-using-xslt

The example is the other way around, it creates a new formatX from PLMXML, which is easier. But how to create PLMXML from formatX (in my case an SAP XML which is a normal well formed xml)? The hard part is to get all attribute references corrct like, id, rootRefs, parentRef etc when creating the PLMXML.

 

Any suggestion is appreciated, like if there are any other APIs, SDKs (Siemens has one C++ SDK) to use. Out of the box I could use XSLT or C# for the transformation.

 

The end user will at first use Teamcenter import tool until we scheduling it. 

 

Let me know if you need more info

 

 

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
Have you already considered adding the Teamcenter Integration Framework (TcIF)? It's designed to do the very thing you're talking about (coded in Groovy). Uses an Enterprise Service Bus for messaging so its not real time. For real time you have to use a product like T4S (Teamcenter Gateway for SAP). However, T4S is coded using TCL.

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
Evaluating:AW 3.2

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Experimenter
Experimenter

I know litte bit about those tools / platforms. We have already an integration platform which we want to use to transform the data. To have other platforms to maintain, educate in etc is not our first choice and will probably cost quite much only for a transformation. The integration runs quite few times and is not critical so we want to use the integration platform as the first choice if possible.

 

So, is there a way to transform to PLMXML with normal standard interface, APIs, SDK or something else which makes it easier? If not, any suggestion where to look further? I guess we could write our own code to make it to work, but it is like re-invent something which should already be out there?

 

 

 

 

 

 

 

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

... should already be there ... funny. I'm not aware of any ITK/API's that perform this work for you. You have to remember that Teamcenter is proprietary and you are at the mercy of the vendor. The downloadable help documentation does include a tcrefs.jar and folders for: ITKFunction, services_reference, and TcServerInterfaces. The help docs also contain a DataModelReport.zip and Javadoc.zip. I do not see an XSD that explains the format for PLMXML.

 

However, if you export PLMXML and look at the header then you will see references like http://www.plmxml.org/Schemas/PLMXMLSchema

Navigating to that site could answer your questions ... or not, looks like a bunch of ads to me.


Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
Evaluating:AW 3.2

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

There is a PLMXML SDK available from SPLM  but it needs a license, is not for C#, and does not help too much for your transformation. 

You need a basic understanding of plmxml then you can read your xml with C# into DOM, do the transformation and write out a plmxml. I did something similiar with Java and read the xml with DOM into hashmaps of hashmaps to model the relation between e.g. ProductRevision, AssociatedDataset, Dataset, ExternalFile. If the xml contains a lot of information you may create separate classes for the major objects of your xml to store the information.

xtof

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Experimenter
Experimenter

Thanks a lot!

 

Do you know if the order of the nodes in the PMLXML matters? Of course the PLMXML node and the header will be first. In my example plmxml i have a order like belov.

<PLMXML/>

<Header/>

<nod1/>

<node2/>

<node3>

<node1>

 

Is the below order possible since they are refering to each other anyway. What i want is to have i.e all ProductRevision after each other instead of spreading them around in the final PLMXML output.  

<PLMXML/>

<Header/>

<nod1/>

<node1/>

<node2/>

<node3>

 

If i could have the order above instead, it's eaiser to create an XSD. From that xsd i could generate classes which is serializable instead of using DOM. If that won´t work i could stick with DOM of course.

 

Is it possible for you to share little of the source code you made in Java, so i can get the idéa of using hashmap / Dictionary (similar C#). It will save some time of course. We could take it on email if you want.

 

Once again, thanks!

Roger

 

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

As the code was developed for a customer I am not allowed to publish it here but I try to give the idea.

First I read the xml into DOM then I developed a logic to put the nodes into a data structure according to their relation. To write the PLMXML I mapped the node types in Java. I am not that familiar with xslt but maybe the transformation can be done with xslt more effectively.

For some elements the order in PLMXML is important for others not, therefore, I cannot give a good answer to your question. If you already have a structure in Teamcenter export it and have a look at the PLMXML file. With a xml editor you can change the order import it back and get a better understanding of the PLMXML file.

HTH,

xtof

Re: How to transform a XML to PLMXML so it can be imported into Teamcenter

Experimenter
Experimenter

Thanks xtof!