Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Get Current Item

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.

0 votes



One answer

Permanent link
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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,953

Question asked: Mar 16 '09, 2:17 p.m.

Question was seen: 6,831 times

Last updated: Mar 16 '09, 2:17 p.m.

Confirmation Cancel Confirm