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

How to capture revision event

SOLVED
Highlighted
Visitor

How to capture revision event

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

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to capture revision event

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.

}

View solution in original post

4 REPLIES 4

Re: How to capture revision event

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.

Re: How to capture revision event

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

Re: How to capture revision event

Re: How to capture revision event

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.

}

View solution in original post