JACL script to get Application Name and Validate the App – WebSphere

IBM WebSphere Application Server
#-----------------------------------------------------------------
#-- Getting AppInfo
#-----------------------------------------------------------------
proc chk_appinfo {} {
	
	puts "checklist: -- fetching $appName Applications CompleteObjectName ..."
	$AdminControl completeObjectName type=Application,name=$appName,*
	puts "checklist: -- fetching $appName Applications ConfigID ..."
	set appInfo [$AdminConfig getid /Deployment:$appName/]
	puts "checklist: --  $appInfo "
	if { [llength $appInfo] == 0 } {
		puts "checklist: -- No Application Info(AppId) found."
	return 0
	} else {
		puts "checklist: -- App Info found- $appInfo ."
		return $appInfo
		}}

#--------------------------------------------------------------------------------
#validate application
#--------------------------------------------------------------------------------
proc chk_validateApplication {} {
       

	puts "checklist: -- validateApplication $appName ..."
	puts "checklist: -- getting the application Config ID"
	set AppID [$AdminConfig getid /Deployment:$appName/]
	if { [llength $AppID] == 0 } {
		puts "checklist: -- No AppID found."
		puts "checklist: -- App validation will not continue."
		return 0
	} else {
	puts "checklist: -- $appName Config ID Found : $AppID "
	puts "checklist: -- validating Application $appName ..."
	set AppVal [$AdminConfig validate $AppID]
	puts "checklist: -- Validate Info: $AppVal ."
	return 1
	}}

#---------------------------------------------------------------------------
#---- check if app exists
#---------------------------------------------------------------------------
proc checkIfAppExists {} {
       

#	set appExists 0
        set application [$AdminConfig getid /Deployment:$appName/]
        puts "checklist: -- checkIfAppExists appName=$appName installedAppID=$application"
        if { [llength $application] == 0 } {
                puts "checklist: -- checkIfAppExists -- FALSE for appName=$appName"
		return 0
        } else {
                puts "checklist: -- checkIfAppExists -- TRUE for appName=$appName"
		return 1
        }
}

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.