I have built a webservice (C#) that connects with the WS R11 and gets information from CHGs and HDs. My problem is to get the Activity Logs (Change Order Activity Log List) of those Change Orders or Incidents.
I am not sure if the Act_Log (alg) table and the Change_Act_Log (chgalg) are the tables where we can obtain the textual logs for HDs and CHGs respectively.
I use the doSelect method to obtain the other information. I know there is a certain nomenclature for the data fields such as:
group.combo_name; (textual description, not the ForeignKey) status.sym (also textual description, not the Fkey)
For instance, I use only the object table chg with doSelect for the Change Orders and obtain the textual data of the field Status which is in another table. (The field Status in the chg table is a foreign key - but using Status.sym I can go directly to get it as text)
Can someone helpme about the table, acronyms or nomenclature for those activity log tables?
Thank you in advance.
activity logs table are multi-relationship table therefore you will not be able to use dottet syntax to retrieve your info.
However you can use the method below
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
<contextObject>cr:412290</contextObject> use the persid of the parent object
<lrelName>alg</lrelName> use the lrel factory as defined in the scehma
<!--1 or more repetitions:-->
<string>description</string> the attributes you want to retrieve
you will of course need to have additional call in you code to retreive it
Hope this help
In addition to jmayer's response you could just do another doSelect directly against the alg/chgalg objects and use the call_req_id/change_id in the where clause. You'll need to be careful if you're joining the algs for multiple tickets at a time but as long as you have a specific ticket for which you want to fetch the logs this will work just fine.
Hello jmayer. Thanks for your insight!
In my whole code I am not using xml parameters calls directly, so Jussi's reply is more or less "enjoyable" albeit the extra resource consuming. Alas, I don't know how to apply your method within my code either, even I absolutely underatand what you had replied. Thank you anyway, very insightful.
Hello Jussi. I opted for your answer. I can bring the data for the CHGs.
Howver it seems I am unable to pull in the ones from the HD table.
Here's the fields and the querie I have built:
(The CA manual says that the field Type it is not used and states it as a foreign key... which field corresponds for the Type then?)
In a crude way:
....doSelect(SID, "alg", call_req_id = ID (of the HD), -1, array with the fields above);
This query string works fine when applying to CHGs, so my mistake must have to do with a field or the wehere clause.
Thansk in advance.
Agree your method will work too but just a little safe to use the designed method for it and a little more resource consuming to use doSelect.
Just my 2 cents
Thanks for your answer, I was in that direction, although my real problem was to identify the required tables and the usefulness of the dottet syntax. Regards.
The type field is very much used, no idea which documentation says it isn't. I see no mistakes with the fields you list so I bet you're either querying the wrong object or using the wrong SREL field in the where clause. The fields you used are correct so double check that you use alg + call_req_id for cr and chgalg + change_id for chg. If that doesn't work then paste your real queries here and we'll take a look.
Hello Valkonen: Here's the results:
For a CHG I retrieve this info (formatted in XML):
<?xml version="1.0" encoding="UTF-8" ?>
s.....doSelect(SID, chgalg[TABLE], (change_id[FIELD] + " = " + (ID[FIELD] of chgTABLE)), -1, array of fields);
For a HD there is no data
.....doSelect(SID, alg[TABLE], (call_req_id[FIELD] + " = \'" + (ID[FIELD] of crTABLE+ "\'")), -1, array of fields);
Notes: The testing HD in CA has log entries.
I use "\'" because call_req_id is a nvchar - I tried without and with anyway. If without, it gives me bad where clause.
Ah, there's the issue. chgalg uses chg.id as the SREL field pointing to chg table whereas alg uses cr.persistent_id to point to cr table.
change_id SREL -> chg.id REQUIRED DISPLAY_NAME "change id" WRITE_NEWcall_req_id SREL -> cr.persistent_id REQUIRED DISPLAY_NAME "call request id" WRITE_NEW
If you switch from cr.id to cr.persistent_id on the doSelect for alg you should start getting values, like this:doSelect(SID, "alg", "call_req_id = 'cr:123456'", -1, [...]);
doSelect(SID, "alg", "call_req_id = 'cr:123456'", -1, [...]);
Well, I used the name persid[FIELD] - my papers must be outdated! There is no persistent_id field in my cr table...Thank you very much Valkonen!!! I have tried the persistent_id and worked like a charm!!!