Editor Presentation - get state group?
Hello,
I have contributed a Work Item Editor Presentation and I am able to get the state of the Work Item the presentation is placed on. However I haven't found a way of tracing it to the state group ... is there a way of getting the state group that state belongs to?
Thanks!
Regards,
Jorge.
I have contributed a Work Item Editor Presentation and I am able to get the state of the Work Item the presentation is placed on. However I haven't found a way of tracing it to the state group ... is there a way of getting the state group that state belongs to?
Thanks!
Regards,
Jorge.
2 answers
Hello Jorge,
I assume you simply want to know whether the work item's state belongs to a certain state group. For example, if you want to know whether a work item is somehow 'CLOSED' you do something like:
IWorkItem workItem= ...;
Identifier<IState> state= workItem.getState2();
IWorkflowInfo info= workItemCommon.findWorkflowInfo(workItem, monitor);
if (info.stateGroupContains(IWorkflowInfo.CLOSED_STATES, state))
// do something
}
HTH,
Jan.
I assume you simply want to know whether the work item's state belongs to a certain state group. For example, if you want to know whether a work item is somehow 'CLOSED' you do something like:
IWorkItem workItem= ...;
Identifier<IState> state= workItem.getState2();
IWorkflowInfo info= workItemCommon.findWorkflowInfo(workItem, monitor);
if (info.stateGroupContains(IWorkflowInfo.CLOSED_STATES, state))
// do something
}
HTH,
Jan.
Hello,
I have contributed a Work Item Editor Presentation and I am able to get the state of the Work Item the presentation is placed on. However I haven't found a way of tracing it to the state group ... is there a way of getting the state group that state belongs to?
Thanks!
Regards,
Jorge.
Hello Jan,
I am afraid I didn't stated my case clear enough. I want to do exactly what you say but from Web UI. My editor presentation is placed in the Web UI and I want to make it reactive depending on state group (right now is for certain states).
I haven't been able to find something similar to you suggestion to be triggered from javascript API.
Thanks in advance for your help!
Regards,
Jorge.
I am afraid I didn't stated my case clear enough. I want to do exactly what you say but from Web UI. My editor presentation is placed in the Web UI and I want to make it reactive depending on state group (right now is for certain states).
I haven't been able to find something similar to you suggestion to be triggered from javascript API.
Thanks in advance for your help!
Regards,
Jorge.