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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to capture revision event

VINO
12-Amethyst

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

ACCEPTED SOLUTION

Accepted Solutions
tstacy
12-Amethyst
(To:VINO)

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

5 REPLIES 5
tstacy
12-Amethyst
(To:VINO)

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.

VINO
12-Amethyst
(To:tstacy)

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

rionm
1-Visitor
(To:VINO)

tstacy
12-Amethyst
(To:VINO)

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.

}

NU_9954775
3-Newcomer
(To:VINO)

I'm capturing Part creation using VersionControlServiceEvent. Can you help me how to  capture Set State event using VersionControlServiceEvent.

Announcements


Top Tags