[CmdletBinding()]
param
(
    [Parameter(Mandatory=$false)]
    [string]$LogDir
)

Import-Module WebAdministration
Import-Module "$PSScriptRoot\ExecuteSqltoAXDB.psm1" -Force -DisableNameChecking
Import-Module "$PSScriptRoot\CommonRollBackUtilities.psm1" -Force -DisableNameChecking
Import-Module "$PSScriptRoot\AosEnvironmentUtilities.psm1" -Force -DisableNameChecking

$sqlPwd = Get-DataAccessSqlPwd
$sqlUser = Get-DataAccessSqlUsr
$sqlServer = Get-DataAccessDbServer
$sqlDB = Get-DataAccessDatabase

$sqlParams = @{
   'Database' = $sqlDB
   'UserName' = $sqlUser
   'Password' = $sqlPwd
   'ServerInstance' = $sqlServer
   'Query' = "select batch.status from batch 
inner join sysserversessions on batch.serverid = sysserversessions.AOSID
where sysserversessions.AOSID like 'Batch:$env:computername' and batch.status = 2"
}

if(!$LogDir)
{
    $LogDir = $PSScriptRoot
}

$logfile = Join-Path $LogDir "SaveBatch.log"
$errorfile = Join-Path $LogDir "SaveBatch.error.log"

#save batch configuration
$deploymentSetupParameter = " --setupmode runstaticxppmethod --classname UpgradeServiceHelper --methodname SaveBatchConfiguration" 
Write-Output "save batch configuration"

$deploySetupPs1 = "$PSScriptRoot\TriggerDeploymentSetupEngine.ps1"

invoke-Expression "$deploySetupPs1 -deploymentSetupParameter: `"$deploymentSetupParameter`" -logfile:`"$logfile`" -errorfile:`"$errorfile`""

$batchError = Get-Content $errorfile
if ($batchError -ne $null) {
    throw "Drain batch feature is not available in your system, aborting the drain batch process"
}

$timeout = new-timespan -Minutes 90
    
$sw = [diagnostics.stopwatch]::StartNew()
$activeBatchJobsCount = 1
while ($sw.elapsed -lt $timeout -and $activeBatchJobsCount -gt 0)
{
    start-sleep -seconds 60
    $activeBatchJobs =  Invoke-SqlCmd @sqlParams
    $activeBatchJobsCount = @($activeBatchJobs).Count
}
if($activeBatchJobsCount -gt 0)
{
    throw "fail to drain batch job after 90 min of waiting"
}

#stop Batch and AOSService
invoke-Expression "$PSScriptRoot\Aut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