Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
I use the SOAP api with Windchill 10.0 to create a custom interface and do some automated stuff.
I can do queries now and a navigation through the folders. But now I want to do changes to the lifecycle state of an object. My understanding is that I need to use ApplyService for that. But if I try that, it only gives me an Internal Server Error which is a NullPointer exception in the shell on the Windchill server.
If someone could give me a working example of ApplyService or, even better, something to set a new lifecycle state, that would be really helpfull for me.
Thanks in advance,
martin
something like this...
After a few tries and modifications I get now only an error message:
java.lang.NoSuchMethodException: wt.lifecycle.State.(java.lang.String)
How can I get a state value in there?
Can you send me the modifed webject. Looks like some type cast issue. I would look at api and try to match the argument appropriately.
Look at Windchill/wt/clients/library/api/index.html - wt.lifecycle
State, LifeCycleHelper
WTList setLIfeCycleState (WTList, State, boolean /*terminateAssocProcesses*/)
Code Example: You want to reassign a group of objects to a particular template to a particular state. In this example, you have a query result of the life cycle managed objects you want to reassign.
WTList list = new WTArrayList(results.size()/.75+1);
while (results.hasMoreElements()) {
list.add((LifeCycleManaged)results.nextElement())
}
LifeCycleTemplateReference lctr=LifeCycleHelper.service. getLifeCycleTemplateReference( name, container );
State released=State.toState(“RELEASED”);
LifeCycleHelper.service.reassign(list, lctr, container, released);
it looks like this now:
I found another method to do this. I am using a Info*Engine JSP Page now (Info*Engine User's Guide) (attached to this post). There is no error handling or computer readable output yet, but it works
The ApplyService thing doesn't work yet, so I leave this as unanswered.
I wouldn't use the webject library for this. It's overkill for your needs. The APIs you have work fine. BTW you don't need to instantiate the LifeCycleHelper. Just call LifeCycleHelper.service.setLifeCycleState(......)
Hi,
I want to integrate thingworx with windchill for that I want to write a info*engine task to create meeting in windchill. canu you help me out..?
regards,
madhu