cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Does anyone have a simple example of calling a IE task from a Java Program?

avillanueva
22-Sapphire II

Does anyone have a simple example of calling a IE task from a Java Program?

I have looked at the docs, knowledgebase and in the codebase
(progexamples) and I am wondering if they are out of date. I have a
simple program but get errors when I run it. PDMLink is running and
there have been no issues with the configuration.



RefreshCISPartDatabase prj=new RefreshCISPartDatabase();


NamingService.setVMName("com.goodrich.eos.pdmlink91dev.namingService");

NamingService namingService = NamingService.newInstance
("com.goodrich.eos.pdmlink91dev.namingService",
"C:/ptc/Windchill_9.1/Windchill/codebase/WEB-INF/ie.properties");

System.out.println("Got instance of naming service");

Task task = new Task
("/com/ptc/windchill/foundation/dca-Query.xml");

System.out.println("Created task");

task.addParam("type", "com.goodrich.eos.CISPart");

task.addParam("class", "wt.part.WTPart");

task.addParam ("group_out", "cis_parts");

task.addProcessor ("com.goodrich.eos.pdmlink91dev.Windchill");

task.setUsername("avillanueva");

task.invoke();

Group group = task.getGroup("cis_parts");

System.out.println(group.getElementCount());

System.exit(0);



ERROR : wt.adapter.exception - WTAdapterImpl

(com.infoengine.util.IEResource/48)
com.infoengine.au.NoSuchServiceException: No such service: "windchill"



Where is it getting the "windchill" string from? This might be a case
issue but where?

2 REPLIES 2
avillanueva
22-Sapphire II
(To:avillanueva)

Got it, typo's in my code. Nevermind.

Just add line:

task.addParam ("supporting-adapter", "com.goodrich.eos.pdmlink91dev.Windchill");


You have error in webject /com/ptc/windchill/foundation/dca-Query.xml, not in programm.

Announcements


Top Tags