Skip to main content
avillanueva
23-Emerald I
May 11, 2010
Question

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

  • May 11, 2010
  • 2 replies
  • 803 views
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

avillanueva
23-Emerald I
May 11, 2010
Got it, typo's in my code. Nevermind.
1-Visitor
May 12, 2010

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.