Hi,
We are creating a integration layer as a webservice to fetch the data from Aras PLM which can be consumed by other external systems.
We were able to fetch the part details for a particular part number using the below code.
String url = "http://localhost/InnovatorServer/Server/InnovatorServer.aspx";
String db = "InnovatorSolutions";
String user = "admin";
String password = "innovator";
HttpServerConnection conn =
IomFactory.CreateHttpServerConnection( url, db, user, password );
Item login_result = conn.Login();
if( login_result.isError() )
throw new Exception( "Login failed" );
Innovator inn = IomFactory.CreateInnovator( conn );
Item abc = inn.getItemByKeyedName("Part", "755.1334.024");
This returns the details of the given part number.
Simillarly we need to retrieve the BOM details which is attached to a particular Assembly part number(Top level manufacturing item). Kindly let us know how to retrive the BOM details. what would be the object type which will returns the BOM details.
Also it would be great if you could help me out in retrieving the Work instructions(Document type object) and all the other available type of objects from PLM using API's.
Hello,
for retrieving the BOM you must get the relationship "Part BOM". Here is a small prototype example, but you could also try to view some of the community solutions "e.g. Multilevel BOM" to get an betteer overview.
Item partBOM_ItemColl = m_Innovator.newItem();
//get the Part BOM
Item partBOM_ItemColl= m_Innovator.newItem("Part BOM", "get");
partBOM_ItemColl.setAttribute("select", "related_id(id)");
partBOM_ItemColl.setAttribute("where", "source_id='" + parentPartItem.getID() + "'");
Item partBOM_RelationResu = partBOM_ItemColl.apply();
for (int iNbRecords=0; iNbRecords<(partBOM_RelationResu.getItemCount()); iNbRecords++)
{
Item partBOM_Item = partBOM_RelationResu.getItemByIndex(iNbRecords);
Item childPartItem = partBOM_Item.getRelatedItem();
}
=========================================
I hope it works - haven't tried it within aras - just wrote it into the community.
Also you are able to get more informations about Part => Document relations ...
Regards, Jens Rollenmüller
(T-Systems; Partner of Aras since 2010)
Dear sir ,
My name is david chao, I am from Taiwan. I am trying the aras innovator 9.3 and I try to use IOM to insert data into Part item, but it does not work, I do not know what is wrong? Any one who can help me, I will be very appreciate, thanks. my e-mail is:david.chao@ewinsonic.com.
The following is my program:
<html><script LANGUAGE="JavaScript" TYPE="text/javascript">var innServerURL = "http://192.168.1.7/InnovatorServer/Server/InnovatorServer.aspx";var dbID = 'InnovatorSolutions';var login = 'admin';var password = 'innovator';var iomFactory = new ActiveXObject("Aras.IOM.IomFactory.9.3");var httpServerConnection = iomFactory.CreateHttpServerConnection(innServerURL, dbID, login, password);var loginResult = httpServerConnection.login();if (loginResult.IsError()){document.write(loginResult.GetErrorDetail());}else{var innovator = new Innovator();var partItem = innovator.newItem();partItem.loadAML("<Item type='Part' action='add' >" +"<item_number>123-456</item_number>" +"<description>Blah blah</description>" +"<Relationships>" +"<Item type='Part BOM' action='add'>" +"<quantity>10</quantity>" +"<related_id>" +"<Item type='Part' action='get'>" +"<item_number>555-555</item_number>" +"</Item>" +"</related_id>" +"</Item>" +"</Relationships>" +"</Item>");var resultItem = partItem.apply();if (resultItem.isError()) {top.aras.AlertError (resultItem.getErrorDetail());return;}}
httpServerConnection.logout();
</script>
</html>
David,
It seems that you are trying to create an independent Ajax Page to access Innovator
Maybe you can reference [AJAX toolkit for Browser Independent clients]
http://www.aras.com/projects/project-view.aspx?id=0EE74C70EC52497D89B5D87D5F3B5881
Best Regards.
-Louis-
David
It seems you want to create an ajax client to access innovator
Please reference AJAX toolkit for Browser Independent clients
(http://www.aras.com/projects/project-view.aspx?id=0EE74C70EC52497D89B5D87D5F3B5881)
hope it helps
Best Regards
Hi David,
I'm pretty sure that you can't use the IOM.dll like that. It isn't an ActiveX object (someone correct me if I am wrong).
You could build an .aspx page that uses the IOM on the code behind page to connect and then you can retrieve information using the IOM.
Or you can see this project
http://aras.com/projects/project-view.aspx?id=7BCA7AE616B54952B13075B4CCE86935
to get an idea of how to use the IOM from an external client.
Cheers,
Brian.
Hi, David
I am not sure where the error occurs,
if it occurs in creating activeXObject,You should copy iom.dll from innovator\client\cbin to the folder with your html page
then you should register the iom.dll using:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727>regasm "C:\test\iom.dll" /tlb /codebase /verbose
if you can login innovator successfully,
you can try the following modified code:
<html>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
var innServerURL = "http://localhost/InnovatorServer930/Server/InnovatorServer.aspx";
var dbID = 'InnovatorSolutions930';
var login = 'admin';
var password = 'innovator';
var iomFactory = new ActiveXObject("Aras.IOM.IomFactory.9.3");
var httpServerConnection = iomFactory.CreateHttpServerConnection(innServerURL, dbID, login, password);
var loginResult = httpServerConnection.login();
if (loginResult.IsError())
alert(loginResult.GetErrorDetail());
else
//var innovator = new Innovator();
var innovator = iomFactory.CreateInnovator(httpServerConnection);
var partItem = innovator.newItem();
var strAML="<AML><Item type='Part' action='add' >" +
"<item_number>888-456</item_number>" +
"<description>Blah blah</description>" +
"<Relationships>" +
"<Item type='Part BOM' action='add'>" +
"<quantity>10</quantity>" +
"<related_id>" +
"<Item type='Part' action='get'>" +
"<item_number>555-555</item_number>" +
"</Item>" +
"</related_id>" +
"</Relationships>" +
"</Item></AML>"
partItem.loadAML(strAML);
var resultItem = partItem.apply();
if (resultItem.isError())
//top.aras.AlertError (resultItem.getErrorDetail());
alert(resultItem.getErrorDetail());