Skip to content

Get Exception Types

Retrieve Exception Types from IFS Planning & Scheduling Optimization (PSO).

It's possible to retrieve the output back in two ways, either in CLOB (character large object) format or in PL/SQL record array format.

The method with CLOB output accepts the following parameters:

  • response_, out parameter of type CLOB, to which the response will be written.
  • language_id_, optional parameter to specify the language code for the Expense Type Descriptions. If not specified 'en' (English) will be used.
  • active_only_, optional parameter to control if all records or only records marked as active will be retrieved. If not specified only records marked as active will be retrieved. If FALSE is specified all records will be retrieved.
  • scheduling_config_id_, optional parameter to specify the Configuration ID from Scheduling Optimization Configuration to use. If not specified the 'DEFAULT' configuration will be used.
  • response_format_, optional parameter to specify the response format. Possible values are 'XML', 'JSON' and 'IFS_MESSAGE'. If not specified 'IFS_MESSAGE' will be used as the default format.
DECLARE
   response_ CLOB;
BEGIN  
   Scheduling_Utility_API.Get_Exception_Types(
      response_             => response_, -- Clob parameter to accept response data.
      language_id_          => 'en',      -- Language code to use.
      active_only_          => FALSE,     -- Retrieve all records (FALSE) or only records marked as active (TRUE).
      scheduling_config_id_ => 'DEFAULT', -- Configuration ID to use.
      response_format_      => 'XML');    -- Response format ('XML' / 'JSON' / 'IFS_MESSAGE').
END;

For the above call, the response may look as following. The response may vary depending on the IFS Planning & Scheduling Optimization (PSO) version being used. For more details about retrieving Exception Types information please see the PSO Interface Guide.

<ArrayOfExceptionType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ThreeSixty.Gateway.Library.ResponseObjects">
  <ExceptionType>
    <ActivationSetting>600</ActivationSetting>
    <Active>true</Active>
    <AttentionValue>1</AttentionValue>
    <Description>Failed To Logon</Description>
    <Id>10</Id>
  </ExceptionType>
  <ExceptionType>
    <ActivationSetting>10</ActivationSetting>
    <Active>true</Active>
    <AttentionValue>10</AttentionValue>
    <Description>Activity Duration Exceeded</Description>
    <Id>20</Id>
  </ExceptionType>
  <ExceptionType>
    <ActivationSetting>10</ActivationSetting>
    <Active>true</Active>
    <AttentionValue>10</AttentionValue>
    <Description>Travel Delayed</Description>
    <Id>30</Id>
  </ExceptionType>
  <ExceptionType>
    <ActivationSetting i:nil="true" />
    <Active>true</Active>
    <AttentionValue>50</AttentionValue>
    <Description>Unable to Complete Activity</Description>
    <Id>40</Id>
  </ExceptionType>
  <ExceptionType>
    <ActivationSetting>0</ActivationSetting>
    <Active>true</Active>
    <AttentionValue>50</AttentionValue>
    <Description>Planned Activity in Jeopardy</Description>
    <Id>50</Id>
  </ExceptionType>
...
  <ExceptionType>
    <ActivationSetting>600</ActivationSetting>
    <Active>true</Active>
    <AttentionValue>10</AttentionValue>
    <Description>Shift Cut Off is Approaching.</Description>
    <Id>400</Id>
  </ExceptionType>
</ArrayOfExceptionType>

Tip: The IFS Message response format ('IFS_MESSAGE') allows using existing methods in Message_SYS package to handle the response which may be simpler to use in the PL/SQL code than 'XML' or 'JSON'.

The method with PL/SQL record array output accepts the following parameters:

  • exception_type_arr_, out parameter of type record array, to which the response will be written.
  • language_id_, optional parameter to specify the language code for the Expense Type Description. If not specified 'en' (English) will be used.
  • active_only_, optional parameter to control if all records or only records marked as active will be retrieved. If not specified only records marked as active will be retrieved. If FALSE is specified all records will be retrieved.
  • scheduling_config_id_, optional parameter to specify the Configuration ID from Scheduling Optimization Configuration to use. If not specified the 'DEFAULT' configuration will be used.
DECLARE
  response_arr_ Scheduling_Utility_API.Exception_Type_Arr;
BEGIN
  Scheduling_Utility_API.Get_Exception_Types(
     exception_type_arr_   => response_arr_, -- Record array parameter to accept response data.
     language_id_          => 'en',          -- Language code to use.
     active_only_          => FALSE,         -- Retrieve all records (FALSE) or only records marked as active (TRUE).
     scheduling_config_id_ => 'DEFAULT');    -- Configuration ID to use.

   -- Example of handling response
   IF (response_arr_.count > 0) THEN
      FOR i_ IN response_arr_.first..response_arr_.last LOOP
         Dbms_Output.Put_Line('description = ' || response_arr_(i_).description);
      END LOOP;
   END IF;
END;

The record array type has the following format:

TYPE Exception_Type_Arr IS TABLE OF Exception_Type_Rec;

The record type has the following format:

TYPE Exception_Type_Rec IS RECORD (
   id                      NUMBER,
   description             VARCHAR2(500),
   activation_setting      NUMBER,
   attention_value         NUMBER,
   active                  BOOLEAN);