RTC Java API What workflow actions are safe to apply to a particular state?
![]()
Hi
I have some code which programmatically changes work item states. I had hoped that this: IWorkflowInfo workflowInfo = workItemClient.findWorkflowInfo(workItem, null); Identifier<IWorkflowAction> actionIds[] = workflowInfo.getAllActionIds(); Would get all the allowed actions for a workitem in a given state. In fact it seems to return a fairly generic set, in my case: Resolve:Set Resolved:Verify:Reopen:Initialize:Start Working:Close:Untriage:Triage:Stop Working I have a test which starts with a WorkItem in state 'New', I apply the action corresponding to 'Start Working' and the workitem state correctly changes to 'In Progress'. However, if I apply the same action again, the workitem state reverts to 'New'. I expected this to either fail (throw an exception) or do nothing. Is there a way that I can reliably determine what workflow actions can correctly be applied to a work item in a given state? I guess there must be..... Zoe |
One answer
![]()
Answered my own question. I had failed to find:
Identifier<IWorkflowAction> actionIds[] = workflowInfo.getActionIds(workItem.getState2()); |