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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Event listener

ptc-107625
1-Visitor

Event listener

Hi,


I am creating event listener that needs to send a message containing new object id (copy) and old object id (source) to a servlet when some WTPart is checked out. At the first it seems straight forward until I found out that there is no CHECKOUT event but a sequence of events (PRE_CHECKOUT, UPDATE, PRE_STORE, INSERT, NEW_ITERATION, NEW_VERSION, POST_STORE, POST_CHECKOUT) that constitutes CHECKOUT. To make this more complex when creating new WTPart similar sequence is used (PRE_STORE, INSERT, NEW_ITERATION, NEW_VERSION, POST_STORE ). When dealing with more clients doing checkout it’s hard to distinguish source and related copy object id from all incoming events. Nothing about this is in any WcT manual. Listener that I created can catch events and print a message about it.


Can anybody point me to right direction (or source) where I can found some information?

2 REPLIES 2

hi,

I cannot see your problem 😉
just ignore everything you are not interested in - listen on
POST_CHECKOUT. then from the WorkInProgressServiceEvent you get use
getOriginalCopy() and getWorkingCopy() to get to the objects in
question. note that you better not pass on a VR of the working copy -
after checkin it will be invalid. use OR only.

hth, martin

Hi Martin,


you get me thinking, where I did wrong, and the result is that I did not pay enough attention to the type of the event. For example PersistenceManagerEvent handles UPDATE, INSERT, POST_STORE, PRE_STORE, and PersistenceManagerEvent handles PRE and POST CHECKOUT and CHECKIN also, and VersionControlServiceEvent handles NEW_ITERATION, NEW_VERSION.


Thanks again.


Nenad

Announcements


Top Tags