Cannot Delete Empty Business Area in AAI
search cancel

Cannot Delete Empty Business Area in AAI

book

Article ID: 211159

calendar_today

Updated On:

Products

Automic Automation Intelligence

Issue/Introduction

I am unable to delete a Business Area that appears empty when looking at the AAI client.

Environment

Release : 6.0.2

Component : AUTOMIC AUTOMATION INTELLIGENCE ENGINE

Resolution

1. Identify the jobstreams that were still linked to the business area that they were trying to delete with the query below using the name of the Business Area: 

select bd.BUSINESSDOMAINNAME, js.description, js.jobstreamid from 
businessdomain_jobstream bdjs, jobstream js, businessdomain bd
where bdjs.jobstreamid=js.jobstreamid
and bd.BUSINESSDOMAINNAME='BUSINESS AREA NAME'
and bd.businessdomainid=bdjs.businessdomainid

Make note of the jobstreamid values returned in the query.

 

2. Stop the AAI/JAWS application 

 

3. Take a full backup of the AAI/JAWS database 

 

4. Run each of the following Delete statements using the jobstreamId's returned in step 1 in a comma separated list like below

delete from Alert
where jobStreamRunId IN
  (select jobStreamRunId from JobStreamRun
   where jobStreamId IN
   ('JOBSTREAMID1','JOBSTREAMID2','JOBSTREAMID3','JOBSTREAMID4'));



delete from JobStreamRun_JobRun
where jobStreamRunId IN
  (select jobStreamRunId from JobStreamRun
   where jobStreamId IN
 ('JOBSTREAMID1','JOBSTREAMID2','JOBSTREAMID3','JOBSTREAMID4'));



delete from JobStreamRun
   where jobStreamId IN
 ('JOBSTREAMID1','JOBSTREAMID2','JOBSTREAMID3','JOBSTREAMID4'));

 

delete from JobStream_StartJob
   where jobStreamId IN
 ('JOBSTREAMID1','JOBSTREAMID2','JOBSTREAMID3','JOBSTREAMID4'));



delete from JobStream_Job
   where jobStreamId IN
 ('JOBSTREAMID1','JOBSTREAMID2','JOBSTREAMID3','JOBSTREAMID4'));

 

delete from JobStreamAverage
   where jobStreamId IN
 ('JOBSTREAMID1','JOBSTREAMID2','JOBSTREAMID3','JOBSTREAMID4'));

 

delete from BusinessDomain_JobStream
   where jobStreamId IN
 ('JOBSTREAMID1','JOBSTREAMID2','JOBSTREAMID3','JOBSTREAMID4'));



delete from JobStream
   where jobStreamId IN
 ('JOBSTREAMID1','JOBSTREAMID2','JOBSTREAMID3','JOBSTREAMID4'));

5. Once all of those have been run successfully 

- Start the AAI/JAWS application 

6. From the client 

- delete the Business Areas