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


One answer

permanent link
Zoe Slattery (4011520) | 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.