Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
I have created a windchill service which will capture some actions.And I have done with capturing the delete,checkin and state change events.I don't have an Idea about how to capture the revision event of on object.Can someone help me out of it.
Some example code snippets would be more helpful for me.
Thank you
Solved! Go to Solution.
There are no other events (at least in Windchill 9.1) that will allow you to capture only the revise event. Here is what I had to do in my listener:
if (myevent.getEventType().equals(VersionControlServiceEvent.NEW_VERSION) && target instanceof WTDocument)
if (wt.vc.wip.WorkInProgressHelper.isCheckedOut((wt.vc.wip.Workable)target)) {
// Event was thrown by Checkout, leave the listener
return;
}
// Now perform what you wanted to do on Revise.
}
Listen for wt.vc.VersionControlServiceEvent.NEW_VERSION.
NOTE: This event is thrown by BOTH Revise and Check Out. If you just want to do something on Revise, in your listener service check to see if the object is checked out. If it is, this event was thrown by Check Out. If not, it was thrown by Revise.
Thanks.Now I have created a service by using that VersionControlServiceEvent.NEW_VERSION.But like you said it is capturing both checkout event and revison event.I need to capture only the revise event.Because in my revision event method I have called another method which will revise decribed by documents(that is associated with my part which i'm revising) whenever it'll capture the revise event.Now that is working fine.
But If I checkout that part that time also it is revising the described by documents.This should happen to it.
How to change the listener service for only to capture the revise event?
Or Is any other API is there to capture only revise event? I need your help
Thank you
I just saw similar question addressed @ http://ezcollab.com/questions/166/wtvcversioncontrolserviceeventnew_version
There are no other events (at least in Windchill 9.1) that will allow you to capture only the revise event. Here is what I had to do in my listener:
if (myevent.getEventType().equals(VersionControlServiceEvent.NEW_VERSION) && target instanceof WTDocument)
if (wt.vc.wip.WorkInProgressHelper.isCheckedOut((wt.vc.wip.Workable)target)) {
// Event was thrown by Checkout, leave the listener
return;
}
// Now perform what you wanted to do on Revise.
}
I'm capturing Part creation using VersionControlServiceEvent. Can you help me how to capture Set State event using VersionControlServiceEvent.