It's all about the answers!

Ask a question

Having issue in a Participant on a "new"

Susan Hanson (1.6k2186193) | asked Jun 10 '14, 12:37 p.m.
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.


sam detweiler commented Jun 10 '14, 12:59 p.m.

one of my plugins uses ((IWorkItem)newState).isNewItem() for detecting New.

One answer

permanent link
Susan Hanson (1.6k2186193) | answered Jun 10 '14, 1:41 p.m.
oops ... nevermind .. it does work!  I forgot that I have another participant running which modifies things... I needed to make a minor change to it and move it down in the ordering.


Your answer

Register or to post your answer.