State of work items
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 :)
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
There are only three state groups, New, in progress, closed. But if they are enough for you you can use code like below
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.
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.
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.