It's all about the answers!

Ask a question

Get Current Item


Pratik Bengali (2651) | asked Mar 16 '09, 2:17 p.m.
I have created a custom precondition and it shows up in the lisf of saveWorkItem precondition.

I am trying to get the handle of my current workitem for which the precondition was executed.

How can I get the reference to currentworkitem object and then look into the current state and other fields of the workitem?

this implementation goes inside below method.

public void run(AdvisableOperation operation,
IProcessConfigurationElement advisorConfiguration,
IAdvisorInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException
{
// my implementation goes here...
}

Thanks.

One answer



permanent link
Patrick Streule (4.9k21) | answered Mar 24 '09, 3:02 p.m.
JAZZ DEVELOPER
How can I get the reference to currentworkitem object and then look
into the current state and other fields of the workitem?

this implementation goes inside below method.

public void run(AdvisableOperation operation,
IProcessConfigurationElement advisorConfiguration,
IAdvisorInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException
{
// my implementation goes here...
}

The typical pattern is:

public void run(AdvisableOperation operation,
IProcessConfigurationElement participantConfig,
IParticipantInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {

Object data= operation.getOperationData();
if (!(data instanceof ISaveParameter))
return;

ISaveParameter saveParameter= (ISaveParameter) data;
fWorkItemNewState= (IWorkItem) saveParameter.getNewState();

--
Regards,
Patrick
Jazz Work Item Team

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.