Passing awk variable argument to a script which is being called inside awk

consider the script below

sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh  alert list --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true >/tmp/alerts.xml
 
awk -F'[=|"|<|>|,]' '{for(i=1;i<=NF;i++){
 if($i=="Alert id") {
  if(id!="")
        if(dt!=""){
cmd="sh someScript.sh "printf "%s",alDFid;"
cmd | getline prio
print "priority=" prio
close(cmd)
 printf "ID=%d\nNAME=%s\nFIXED=%s\nDATE=%s\nAlDefID=%d\n\n", id,nm,fx,dt,alDFid; }
  id=($i=="Alert id")?$(i+2):id; }
  nm=($i==" name")?$(i+2):nm;
  fx=($i==" fixed")?$(i+2):fx;
  dt=($i~/^ [0-9]+-/)?$i" "$(i+1):dt;
  alDFid=($i==" alertDefinitionId")?$(i+2):alDFid;
 }
}END{
 if(dt!=""){
 printf "ID=%d\nNAME=%s\nFIXED=%s\nDATE=%s\nAlDefID=%d\n\n", id,nm,fx,dt,alDFid;
}
}' /tmp/alerts.xml

here the script that i am calling is someScript.sh and to that i want to pass the contents of alDFid , i itred giving it in quotes , $ but none of it worked. even tried printf "%s",alDFid even this is not working.

Does anyone know how to pass argument to script from Awk with awk variable??

ALSO
why does

awk -F'priority=' '{print $2}' | cut -d'"' -f2 

inside cmd="" wont work.. it wont consider awk inside this command. it keeps throwing error as

| grep priority | awk -Fpriority= {print
awk: cmd. line:6:     ^ unterminated string
./alertCheck_vivek.sh_date: line 26: cmd: command not found
./alertCheck_vivek.sh_date: line 26: getline: command not found
./alertCheck_vivek.sh_date: line 27: print: command not found
./alertCheck_vivek.sh_date: line 28: syntax error near unexpected token `cmd'
./alertCheck_vivek.sh_date: line 28: `close(cmd)'

Your idea is correct, but as your code is absolutely unreadable, I only can guess that the variable alDFid is undefined when used to build the external command.
And, of course, you have an unterminated string, i.e. one unmatched double quote (I guess in the printf statement)

the error which was coming was due to below line

awk: cmd. line:6: cmd="sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh  alertdefinition list --id=$myAlertDefID --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true | grep priority | awk -Fpriority= {print
awk: cmd. line:6:     ^ unterminated string
./alertCheck_vivek.sh_date: line 26: cmd: command not found
./alertCheck_vivek.sh_date: line 26: getline: command not found
./alertCheck_vivek.sh_date: line 27: print: command not found
./alertCheck_vivek.sh_date: line 28: syntax error near unexpected token `cmd'
./alertCheck_vivek.sh_date: line 28: `close(cmd)'

lets forget about that... the alDFid is defined below is the output

13214
priority=
ID=10101
NAME=APP-MS-lib_license_common-150040-licenseSchemaTampered-S_R
FIXED=true
DATE= 2013-01-22 07:54:51.3
AlDefID=13214

where the line above priority is alDFid
the snippet which i used was

awk -F'[=|"|<|>|,]' '{for(i=1;i<=NF;i++){
 if($i=="Alert id") {
  if(id!="")
        if(dt!=""){
printf "%s\n",alDFid;
cmd="sh someScript.sh alDFid"
cmd | getline prio
print "priority=" prio
close(cmd)
 printf "ID=%d\nNAME=%s\nFIXED=%s\nDATE=%s\nAlDefID=%d\n\n", id,nm,fx,dt,alDFid; }
  id=($i=="Alert id")?$(i+2):id; }
  nm=($i==" name")?$(i+2):nm;
  fx=($i==" fixed")?$(i+2):fx;
  dt=($i~/^ [0-9]+-/)?$i" "$(i+1):dt;
  alDFid=($i==" alertDefinitionId")?$(i+2):alDFid;
 }
}END{
 if(dt!=""){
 printf "ID=%d\nNAME=%s\nFIXED=%s\nDATE=%s\nAlDefID=%d\n\n", id,nm,fx,dt,alDFid;
}
}' /tmp/alerts.xml

in the above i want to pass the content of alDFid to someScript.sh script. But current implementation is passing string "alDFid " to the script.