Travis,
Ha! Well I have been battling away with the XML unbeknownst to the 12.1 option.
###########################################################################
# Build the HTML for the file
#########################################################################
def createHTML():
global applicationCount, today, htmlFile
htmlStr = None
list = os.listdir(source_path)
list.sort()
for file in list:
htmlStr = None
htmlStr = '' current = os.path.join(source_path, file)
if os.path.isfile(current):
applicationCount = applicationCount + 1
print str(applicationCount) + ": Processing: " + file data = open(current, "rb")
file_name = source_path + file
full_file = os.path.abspath(os.path.join(file_path, file_name))
tree = ET.parse(full_file)
root = tree.getroot()
htmlStr = htmlStr + "<TABLE align=\"center\" border=\"5\">\n"
htmlStr = htmlStr + "<thead><tr><th colspan=\"20\">" + str(applicationCount) + ": Application:" + file + "</th></tr></thead>"
htmlStr = htmlStr + "<TD><strong>FIELD</strong></TD><TD>VALUE</TD><TD><strong>ATTRIBUTE NAME</strong></TD><TD>ATTRIBUTE VALUE</TD></TH>"
for elt in root.getiterator():
elt.tag = elt.tag.rsplit('}', 1)[-1]
htmlStr = htmlStr + "<TR>" htmlStr = htmlStr + "<TD><strong>" + str(elt.tag) + "</strong></TD>"
#htmlStr = htmlStr + "<TD>" + str(elt.text) + "</TD>"
if "args" in str(elt.tag) or "script_definition" in str(elt.tag):
htmlStr = htmlStr + "<TD>" + "SCRUBBED FOR SECURITY" + "</TD>"
else: htmlStr = htmlStr + "<TD>" + str(elt.text) + "</TD>"
# Get any Attributes
myAttribKeys = elt.attrib
if myAttribKeys:
htmlStr = htmlStr + "<TD></TD><TD></TD>"
for key in myAttribKeys:
htmlStr = htmlStr + "<TR><TD></TD><TD></TD><TD><strong>" + key.upper() + "</strong></TD><TD>" + elt.get(key) + "</TD><TR>" else:
htmlStr = htmlStr + "<TD><strong>" + "" + "</strong></TD>"
htmlStr = htmlStr + "<TD>" + "" + "</TD>"
htmlStr = htmlStr + "</TR>" + "\n"
htmlStr = htmlStr + "</TABLE>\n"
htmlStr = htmlStr + "</BR>"
htmlFile.write(htmlStr)
#print("Closing file")
data.close()
print("We processed: " + str(applicationCount) + " Applications")
This seemed to work for me.
But the 12.1 CLI command looks promising.
Cheers
Original Message:
Sent: 03-25-2020 12:13 PM
From: Andy Reimer
Subject: Automate Your Own CA DE Application Documentation.
Like Travis, we are using PowerShell to extract useful information from the XML exports. We use imexutil.bat to export all our applications daily then run a series of subsequent PowerShell jobs to create reports. Note that the files created by imexutil.bat are not named with a .xml suffix but they are just normal XML files. One example report lists all the external jobs in every application. This is useful when you are about to complete a job or application and you want to make sure this won't release some other series of jobs elsewhere. The output is a simple text file that I can search, an example of which is below. Here I can see that there are 4 external jobs in my application called ACT010
ACT010 name qualifier applid scheduled
------ ---- --------- ------ ---------
DSNPBUDE TODAY
ESS9809D RUN2
DSNPBUWA
ACR010EN ACR010 TODAY
------------------------------
Andy Reimer
Original Message:
Sent: 03-24-2020 10:01 PM
From: TRAVIS ANDERSON
Subject: Automate Your Own CA DE Application Documentation.
This is something that I have always wanted but from my knowledge and experience, there is no way to easily get the information. By all means someone please correct me if I am wrong here but the data is stored in table ESP_AMS_DF (select * from esp_ams_df where artifacttype = 'APPLICATION') and is stored in one column. Within that one column is all of the XML associated with the application. I've been working on trying to extract the XML with a SQL statement but have not yet figured it out.
For now what I do is export the XML definition then run a PowerShell script to extract values such as the app name and job names within the app. I also have a PowerShell script to extract schedule statements for events.
My opinion is this is one of the biggest things the product is lacking. There is no built-in easy way for all customers using the product to be able to use to get data such as what you are asking. We have had more than numerous requests to have this sort of data in any way such as a CSV format. Right now it requires an admin at our shop to provide the data but then requires someone proficient with PowerShell (which I am not there yet) and on top of that, you have to get a current backup of the XML to run your PS against. If you could get it from the database then that would be the best route.
Original Message:
Sent: 03-24-2020 12:41 PM
From: David Lock
Subject: Automate Your Own CA DE Application Documentation.
Hi Guys,
RE: Automate Your Own CA DE Application Documentation.
Firstly, I hope you guys are safe and keeping healthy during this pandemic. I wish you and your families well at this time.
This is a very low level question.
I want to automate Documentation for my CA DE Applications.
I'd like to pull some data from the DB ESP_APPLICATION and a job definition table like ESP_GENERIC_JOB but that doesn't appear to have a record until the job has run, so not sure where the job definitions are stored on creation of APPL.
Perhaps it can be done through the Reporting Capabilities of CA Workload Automation.
e.g.
- Application Name
- Description as provided
- Each Job Name (ordered by job sequence ideally)
- Description as provided
- Script Names
- Java script
Ideally the output could be in HTML or soemthing that could be linked to?
Etc.