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

rated by 0 users
This post has 8 Replies | 5 Followers

Top 150 Contributor
Posts 13
Points 275
Rajiv Posted: Thu, Jan 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 = "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.

 

  • | Post Points: 35
Top 75 Contributor
Posts 25
Points 285

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)

  • | Post Points: 5
Not Ranked
Posts 2
Points 85
davidchao replied on Fri, 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: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>

 

  

 

  • | Post Points: 65
Top 500 Contributor
Posts 4
Points 35
louis.liu replied on Sun, 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]

http://www.aras.com/projects/project-view.aspx?id=0EE74C70EC52497D89B5D87D5F3B5881

Best Regards.

-Louis-


  • | Post Points: 5
Top 500 Contributor
Posts 4
Points 35
louis.liu replied on Mon, 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

 

  • | Post Points: 5
Top 10 Contributor
Posts 549
Points 8,215
Brian Pye replied on Mon, 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

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.

  • | Post Points: 5
Top 500 Contributor
Posts 4
Points 35
louis.liu replied on Wed, 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 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>" +

"</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-

  • | Post Points: 20
Not Ranked
Posts 2
Points 85

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.

  • | Post Points: 20
Top 500 Contributor
Posts 4
Points 35
louis.liu replied on Thu, Dec 12 2013 12:17 AM

Hi David
It seems the security setting of client PC goes wrong.
Please check http://www.aras.com/support/documentation/DocumentView.aspx?file=./9.4.0/Installation%20and%20Configuration/Aras%20Innovator%209.4%20-%20Internet%20Explorer%20Client%20Machine%20Configuration.pdf

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

 

  • | Post Points: 5
Page 1 of 1 (9 items) | RSS