I saw CA PPM has ActionItemApprovals api.But I have not been able to figure out how I can use ReadActionItemApproval and WriteActionItemApproval.Someone has one documentation about it or examples ?
I do not think CA provided any other information apart from WSDL.
Action Items Approval API behaves as below. Based on my observation, the results in OUTPUT XML depend on the user session used for XOG. In case of read, only those open action items are fetched which are assigned to the user who is XOGing. Similarly, for write, only the action items assigned to XOGing user can be updated.
<NikuDataBus> <Header action="read" externalSource="NIKU" objectType="actionItemApproval" version="12.0"/></NikuDataBus>
Write: Once you read using above XML, you will be able to frame write XMl as below.
<NikuDataBus> <Header action="write" externalSource="NIKU" objectType="actionItemApproval" version="12.0"/> <actionItemApprovals> <actionItemApproval actionItemDbId="<!-- pass values -->" assigneeDbId="<!-- pass values -->"
processDbId="<!-- pass values -->" status="<!-- pass values -->" /> </actionItemApprovals></NikuDataBus>
Thank you! Works fine!
Very nice post, however I was not able to achieve results I expected. If you would check what's missing there, I'd be very happy.
So, firstly I select Action Item which need to be updated. based on my own query (second AI should be Auto-Approved by that XOG). Note: That first AI which was Approved in GUI before to initiate the "Update AI action" step which we're checking.
Then in PM Approval process, custom GEL process step, I build XOG write based on results from query:
Note: When performed XOG read, I got no results...so that param processDbId, in XOG write I got as process instance ID from DB - hope it's right ID.
XOG write was successfull (I've tried it also through xog.client Clarity GUI, , it's the same - nothing changed), however Action Item remained opened. Do you know why?
This AI with ID 6187057 should be Approved after that XOG....
Note: Or maybe it would help to idetify which of following params
<actionItemApproval actionItemDbId="<!-- pass values -->" assigneeDbId="<!-- pass values -->"
processDbId="<!-- pass values -->" status="<!-- pass values -->" />
represents their IDs in which DB tables...
Thanks a lot!
I hope the XOG session you are using is that of the user to which the action item is assigned and not any other user's(not even admin). Can you confirm that?
User who Submitted Timesheet, so in fact initiated that TS Approval process is a common user to whom TS belongs to.Action Items are assigned to 6 different users as you can see from last screenshot.
I'm logged in as admin of course but it shouldn't influence the process XOG, isn't it?
How this all staff should be setup to work this XOG then?
As I have mentioned in my original post, the XOG that you use for action item approval api only works when the session being used is of the user to whom the action item is assigned.
Below is how the values for XOG can be derived. You can find the same in the XOG read response as well.
actionItemDbId - cal_action_items.idassigneeDbId - cmn_sec_users.idprocessDbId - cal_action_items.process_handler_idstatus - any of the values from below query
select cmn.lookup_code as code from cal_action_items items join bpm_run_step_action_results ai_results on ai_results.ai_id = items.id join bpm_def_step_ai_actions st_actions on st_actions.step_action_id = ai_results.step_action_id join cmn_lookups_v cmn on cmn.lookup_type = st_actions.status_type_code where cmn.language_code='en' and items.id=<pass actionItemDbId> and cmn.lookup_code = st_actions.status_code order by cmn.sort_order
Hmm, then it will not work for me at all as I have a lot of PMs in many AI and need of course "global" AI approval, not just for one user...
Nevertheless thanks for params setting. Maybe you also know also DB updates which needs to be done to set AI status to Approved? I've jus tried update "cal_action_item_assignees" table, column "status_code", but with no luck in GUI. Thanks a lot.
Retrieving data ...