AnsweredAssumed Answered

Scope of Process variables in Exception handler Section

Question asked by CodeGeek on Jun 1, 2017
Latest reply on Jun 19, 2017 by CodeGeek

Hi Community,

 

I am trying to separate the faulty tickets from array of tickets, I am doing this in exception handler section of the workflow, because these faulty tickets are failed to close due to some 'Tenant violations' or for various reasons.

 

Process.TktRef  // Array contains all the ticket numbers
Process.k // This variable contains the current index of the array 'Process.TktRef'
Process.lengthTkt // This variable contains the total size of the array 'Process.TktRef''

 

 

above all are process variables.

 

what I am trying to achieve here is.

 

1.   I'm designing a process to close the tickets.

2.   I'm selecting '100' tickets at a time and assigning the ticket numbers to a array.

3.  Next operation is to close the tickets, I'm looping the operator to close all the tickets in the array,if any of the ticket is failed to close for some reason, I want the operator to leave the particular ticket and try to close the next ticket in the array although I want capture those failed tickets to another array.

4. In the next step I'm querying the tickets to see if I need to loop above operation to close the tickets.

 

In the exception handler section, I am trying to get the tickets which are failed to close, however every time I can see the array is empty.

 

Can some one tell me that  are the process variable will available in exception handler section to use in java script code?

and suggest me any improvements in the below code.

 

if (Process.errorMessage.toLowerCase().indexOf("fault returned") != -1) {
if (Process.source === 'Close_Request_2' && Process.lengthTkt > Process.k) {
Process.inWcRef.push(Process.TktRef[Process.k]);
Process.tryAgain = true;
Process.k++;
} else if (Process.source === 'Close_Request_2' && Process.lengthTkt <= Process.k) {
Process.bSuccessful = true;
} else {
Process.bdelay = true;
}
} else if (Process.errorMessage.toLowerCase().indexOf("checked out") != -1) {
if (Process.source === 'Close_Request_2' && Process.lengthTkt > Process.k) {
Process.inWcRef.push(Process.TktRef[Process.k]);
Process.tryAgain = true;
Process.k++;
} else if (Process.source === 'Close_Request_2' && Process.lengthTkt <= Process.k) {
Process.bSuccessful = true;
} else {
Process.bdelay = true;
}
} else if (Process.errorMessage.toLowerCase().indexOf("record is locked") != -1) {
if (Process.source === 'Close_Request_2' && Process.lengthTkt > Process.k) {
Process.inWcRef.push(Process.TktRef[Process.k]);
Process.tryAgain = true;
Process.k++;
} else if (Process.source === 'Close_Request_2' && Process.lengthTkt <= Process.k) {
Process.bSuccessful = true;
} else {
Process.bdelay = true;
}
} else if (Process.errorMessage.toLowerCase().indexOf("ahd03057") != -1) {
if (Process.source === 'Close_Request_2' && Process.lengthTkt > Process.k) {
Process.inWcRef.push(Process.TktRef[Process.k]);
Process.tryAgain = true;
Process.k++;
} else if (Process.source === 'Close_Request_2' && Process.lengthTkt <= Process.k) {
Process.bSuccessful = true;
} else {
Process.bdelay = true;
}
} else if (Process.errorMessage.toLowerCase().indexOf("message send failed") != -1) {
if (Process.source === 'Close_Request_2' && Process.lengthTkt > Process.k) {
Process.inWcRef.push(Process.TktRef[Process.k]);
Process.tryAgain = true;
Process.k++;
} else if (Process.source === 'Close_Request_2' && Process.lengthTkt <= Process.k) {
Process.bSuccessful = true;
} else {
Process.bdelay = true;
}
} else {
if (Process.ActivityRetryMaxMet__ < Process.ActivityRetryCount__) {
Process.ActivityRetryCount__ = Process.ActivityRetryCount__ + 1;
Process.tryAgain = true;
} else {
Process.tryAgain = false;
}
}

 

Venkat

Outcomes