Having issue in a Participant on a "new"
![](http://jazz.net/_images/myphoto/66e177e2048ef539f521aa8ee20ae030.jpg)
I'm seeing an interesting thing in my Server-side participant.
I have one where I want to see if it is a "new" create.
I get the data and the OldState.
if (data instanceof ISaveParameter) {
saveParameter = (ISaveParameter) data;
IAuditable testAuditable = saveParameter.getOldState();
Then I assumed that since I am creating the work item (initializing), then the OldState should be null. However, I get basically the same data (not the same object, but the same data values) for getOldState() and getNewState().
Is there something I'm doing wrong? How can I tell quickly/easily if this is a brand new work item that is being created? Again, I had thought the OldState would show me that.
Susan
I have one where I want to see if it is a "new" create.
I get the data and the OldState.
if (data instanceof ISaveParameter) {
saveParameter = (ISaveParameter) data;
IAuditable testAuditable = saveParameter.getOldState();
Then I assumed that since I am creating the work item (initializing), then the OldState should be null. However, I get basically the same data (not the same object, but the same data values) for getOldState() and getNewState().
Is there something I'm doing wrong? How can I tell quickly/easily if this is a brand new work item that is being created? Again, I had thought the OldState would show me that.
Susan
Comments
sam detweiler
Jun 10 '14, 12:59 p.m.one of my plugins uses ((IWorkItem)newState).isNewItem() for detecting New.