It's all about the answers!

Ask a question

State of work items


juwandy susilo (2122) | asked Mar 19 '12, 12:27 a.m.
how can i validate each state of the work item ?
i have a case like this :
- if 1 work item's state change from 'new' to 'in progress' then it will be checked first whether the predecessor already 'closed' or not.

i see that every work item type (task, rfc ticket, purchase, gate) have a different state id for each state. then it would be inefficient to validate all of the state id.
and i can't find the idea how to use the stategroups.

anyone can help ?

thanks :)

4 answers



permanent link
sam detweiler (12.5k6184201) | answered Mar 19 '12, 11:42 a.m.
what are u trying to do?

permanent link
Ralph Schoon (59.7k23643) | answered Mar 19 '12, 11:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There are only three state groups, New, in progress, closed. But if they are enough for you you can use code like below


IWorkflowInfo workflowInfo= workItemCommon.findWorkflowInfo(dependency, monitor);
if (workflowInfo != null && !workflowInfo.stateGroupContains(IWorkflowInfo.CLOSED_STATES, dependency.getState2()))
unresolvedDependencies.add(dependency);


another option would be to make the operational behavior configurable and have a lookup table that creates a metric on the states that makes sense.

I have seen other behavior e.g. preventing to close a work item if children are not all closed using state groups.

permanent link
juwandy susilo (2122) | answered Mar 20 '12, 2:38 a.m.
what are u trying to do?



i am going to validate if workitem's state changed to 'closed' then i will trigger some method.

permanent link
juwandy susilo (2122) | answered Mar 20 '12, 2:41 a.m.
thanks a lot rschoon. i'll try your code.

There are only three state groups, New, in progress, closed. But if they are enough for you you can use code like below


IWorkflowInfo workflowInfo= workItemCommon.findWorkflowInfo(dependency, monitor);
if (workflowInfo != null && !workflowInfo.stateGroupContains(IWorkflowInfo.CLOSED_STATES, dependency.getState2()))
unresolvedDependencies.add(dependency);


another option would be to make the operational behavior configurable and have a lookup table that creates a metric on the states that makes sense.

I have seen other behavior e.g. preventing to close a work item if children are not all closed using state groups.

Your answer


Register or to post your answer.