How find available actions to change states in RTC with OSLC
Accepted answer
https://jazz.net/forum/questions/32674/change-workitem-state-via-rest#81610
If so, you can get them in the Process Configuration Source using the RTC Eclipse client. They are under the hierarchy ...<workflowDefinition><workflow><action>. You should check ...<workflowDefinition><workflow><state><action> to make sure you are only calling the valid action(s) based on the current state.
I don't know how you can get the workflow dynamically using OSLC though. I guess it's not implemented yet.
Comments
Hi Donald,
Thank you very much! I don't understand now why I forgot to look for the actions list in the process definition in RTC Eclipse Client!
But it seems, I found the same list in the Web UI after some additional research. My own "Higgs boson" :) was open in this way (sample for localhost server):
1. Open the typical services document in Web Browser
2. Find parameter "oslc_cm:url". In my case:
<oslc_cm:url>https://localhost:9443/ccm/oslc/contexts/_JiV7QMO-EeOrgeMTNV2gJg/workitems/defect</oslc_cm:url>
3. Find a record of the needed type (parameter "dc:type"). In my case I was looking for defect actions:
<dc:type rdf:resource="https://localhost:9443/ccm/oslc/types/_JiV7QMO-EeOrgeMTNV2gJg/defect"/>
4. For the same record, find parameter "rtc_cm:state". In my case:
<rtc_cm:state rdf:resource="https://localhost:9443/ccm/oslc/workflows/_JiV7QMO-EeOrgeMTNV2gJg/states/com.ibm.team.workitem.defectWorkflow/3"/>
- Change "states" to "actions", remove suffix and open modified URL in Web Browser. In my case:
https://localhost:9443/ccm/oslc/workflows/_JiV7QMO-EeOrgeMTNV2gJg/actions/com.ibm.team.workitem.defectWorkflow
- See for the resulting page, where all workflow actions are displayed.
One other answer
Comments
I believe the REST really exists. For example, I found the description "The status of the work item (modifiable via action)" for "rtc_cm:stat" here:
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
You can see this description in the "Attributes" section. Here, JAZZ developer writes that it's possible:
https://jazz.net/forum/questions/98624/unable-to-change-state-and-status-via-oslc