It's all about the answers!

Ask a question

RTC Java API What workflow actions are safe to apply to a particular state?


Zoe Slattery (4011720) | asked Jan 28 '14, 1:19 p.m.
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



permanent link
Zoe Slattery (4011720) | answered Jan 28 '14, 3:05 p.m.
Answered my own question. I had failed to find:
Identifier<IWorkflowAction> actionIds[] = workflowInfo.getActionIds(workItem.getState2());

Your answer


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