This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to fetch the BOM details from ARAS PLM using API's

Rajiv - Thursday, January 6, 2011 8:57 AM:

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 = "localhost/.../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.
 


JensRollenmueller - Monday, January 10, 2011 2:54 PM:

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)



davidchao - Friday, May 18, 2012 1:33 AM:

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:[email protected].

The following is my program:

<html>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
var innServerURL = "192.168.1.7/.../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>

 

  

 



louis.liu - Sunday, May 20, 2012 11:02 PM:

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]

www.aras.com/.../project-view.aspx

Best Regards.

-Louis-




louis.liu - Monday, May 21, 2012 5:28 AM:

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

 



Brian - Monday, May 21, 2012 9:32 AM:

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

aras.com/.../project-view.aspx

to get an idea of how to use the IOM from an external client.

Cheers,

Brian.



louis.liu - Wednesday, May 23, 2012 1:08 PM:

Hi, David

I am not sure where the error occurs,

if it occurs in creating activeXObject,You should copy iom.dll from innovatorclientcbin to the folder with your html page

then you should register the iom.dll using:

C:WindowsMicrosoft.NETFramework64v2.0.50727>regasm "C: estiom.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 = "localhost/.../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>" +

"</Item>" +

"</Relationships>" +

"</Item></AML>"

partItem.loadAML(strAML);

var resultItem = partItem.apply();

if (resultItem.isError()) 

{

//top.aras.AlertError (resultItem.getErrorDetail());

alert(resultItem.getErrorDetail());

}

}

httpServerConnection.logout();

</script>

</html>

 

Best Regards

-Louis-



davidchao - Friday, December 6, 2013 9:48 AM:

Dear Sir,
 
My name is David Chao   from Taiwan Winsonic , I have downloaded the newest  Innovator and Microsoft .NET Framework v 4.0  and IIS 7.0
and my OS is MS SQL 2008(64 bit), when I installed  everything is OK, no error msgs, but when I tried to start  the Innovator Server it
reponsed an error msg:
 
Aras Innovator client has failed to initialize.
Some required controls('Aras.Net.dll', 'Converter.dll', 'UpdateIntercommunicationLayer.dll', 'IOM.dll')
were not loaded. Reinstalling application may solve this problem.
 
Where was wrong can anybody tell me, I will be very appreciated, Thanks a lot.


louis.liu - Thursday, December 12, 2013 12:17 AM:

Hi David
It seems the security setting of client PC goes wrong.
Please check www.aras.com/.../DocumentView.aspx

And you can change another Client PC to try to connect.