IT Process Automation

Expand all | Collapse all

Scope of Process variables in Exception handler Section

Jump to Best Answer
  • 1.  Scope of Process variables in Exception handler Section

    Posted 06-01-2017 05:55 PM

    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



  • 2.  Re: Scope of Process variables in Exception handler Section
    Best Answer

    Broadcom Employee
    Posted 06-02-2017 05:14 PM

    Process level variables should always be available to the Exception Handler.  At the point of failure, if you open the process instance, can you view the Process Dataset to see the variable values there?  If the variable is empty in that dataset, then the exception handler will see the same thing.



  • 3.  Re: Scope of Process variables in Exception handler Section

    Posted 06-19-2017 09:15 AM

    Thanks Andy_Thompson for  clarifying my query.

     

    Regards,

    Venkat