1 Reply Latest reply: Aug 6, 2012 4:01 AM by Gurumoorthy RSS

    Can Service Script catch/process Business Service error?

    user10456369
      We have a Service Script invoked by XAI Inbound Service that is invoking a Business Service. If an error occurs in the BS, we would like to be able to capture/process it within the SS, rather than the process "failing"...

      As an example, the CC&B Demo database includes SS CI_MRInput and BS CI_RegisterReadHighLowLimits (see CI_MRInput script below).

      In the Demo environment, the CI_MRInput is invoked by a BPA Script CI_MRRouteA, in which case "with warn" may be specified to effect processing of the error.

      However, when invoked via the XAI Inbound Service, an error from the BS (ex: 8:11024) causes the CC&B process to "fail" and a SOAP Fault and/or CC&B error details to be sent to the external process. This is not desired.

      Ideally, we'd like the SS to catch the error and send an agreed upon error code to the external process.

      Any assistance in this matter will be greatly appreciated.

      CI_MRInput Service Script:
      10: move "parm/meterReadDetails/meterConfigurationId" to "MeterConfiguration/meterConfigurationId";
      20: invokeBO 'CI_MeterConfiguration' using "MeterConfiguration" for read;
      30: edit data
      // Reset register reads
      move null to "parm/meterReadDetails/register";

      // Reset Register remarks
      if ("parm/meterReadDetails/remark/readerRemark != $BLANK")
      move null to "parm/meterReadDetails/remark";
      end-if;

      // Using the meter configuration retrieved, setup the meter read elements
      move "MeterConfiguration/*" to "parm/meterReadDetails/*";

      // Default Read Type (60=Regular) and Use on Bill to 'Y'
      move '60' to "parm/meterReadSchedule/readType";
      move 'true' to "parm/meterReadDetails/useOnBill";
      move "concat(parm/meterReadSchedule/scheduledReadDate,'-12.00.00')" to "parm/meterReadDetails/readDateTime";

      // Get the High/Low Limit for each register
      move '0' to $registerIndex;
      move "parm/meterReadDetails/readDateTime" to "HighLowLimits/readDateTime";
      move "parm/meterReadSchedule/readType" to "HighLowLimits/readType";
      for ($REG in "parm/meterReadDetails/register")

      move "$REG/registerId" to "HighLowLimits/registerId";
      move "parm/meterReadSchedule/spId" to "HighLowLimits/spId";
      invokeBS 'CI_RegisterReadHighLowLimits' using "HighLowLimits";
      move "HighLowLimits/highLimit" to "parm/meterReadDetails/register[$registerIndex]/highLimit";
      move "HighLowLimits/lowLimit" to "parm/meterReadDetails/register[$registerIndex]/lowLimit";
      move "1 + $registerIndex" to $registerIndex;

      end-for;
      end-edit;