+ All Categories
Home > Documents > Alert SummaryV1

Alert SummaryV1

Date post: 10-Apr-2018
Category:
Upload: frankkiller1289
View: 218 times
Download: 0 times
Share this document with a friend

of 20

Transcript
  • 8/8/2019 Alert SummaryV1

    1/20

    Alert Summary

    How to Define a Simple Alert .....................................................................................................2

    Summary Level Alert ..................................................................................................................8

    Detail Level Alert ......................................................................................................................12

    Distribution List ........................................................................................................................15

    Other Issues ...............................................................................................................................16

    Adjust Layout for Notification Mail .........................................................................................20

    1

  • 8/8/2019 Alert SummaryV1

    2/20

    How to Define a Simple Alert

    1. define an alert

    Responsibility: Alert Manager

    Navigation: Alert Define

    Select Application, and name a new alert.

    Put appropriate select statement in field. Variable starts with character &, and does not

    need to be declared. (&ORGNUM)

    Press verify to check syntax. Then save the change.

    2

  • 8/8/2019 Alert SummaryV1

    3/20

    2. Define actions

    Press actions button, give action name and select action level.

    Press Action Details. The Subject is required even though it is an optional field.

    Refer to Other Issus section.

    3

  • 8/8/2019 Alert SummaryV1

    4/20

    Or:

    3. Add action to action sets

    Press Action Sets button.

    4

  • 8/8/2019 Alert SummaryV1

    5/20

    Press Action Set Details and go to Members tab, select the action you just defined.

    4. Run alert

    Request Check

    5

  • 8/8/2019 Alert SummaryV1

    6/20

    Press Submit Request, and request id will be created.

    Request View to monitor request process.

    Delivered email:

    There are 174 orgs in application.

    Note:

    6

  • 8/8/2019 Alert SummaryV1

    7/20

    During an alert check, a detail action performs once for each individual exception

    found, a summary action performs once for all exceptions found, and a no exception

    action performs when no exception are found.

    Return

    7

  • 8/8/2019 Alert SummaryV1

    8/20

    Summary Level Alert

    It is an action that Oracle Alert performs once for all exceptions found by the alert

    select statement.

    1. Define an alert

    2. Define Actions

    8

  • 8/8/2019 Alert SummaryV1

    9/20

    Action Details

    3. Action Sets

    Action Set Details

    9

  • 8/8/2019 Alert SummaryV1

    10/20

    4. Run Alert

    Delivered email:

    Organization List(Top 3 for test):

    ORG Code ColumnOrganization code GLO is in application.

    10

  • 8/8/2019 Alert SummaryV1

    11/20

    Organization code BGI is in application.

    Organization code BHM is in application.

    Return

    11

  • 8/8/2019 Alert SummaryV1

    12/20

    Detail Level Alert

    It is an action that Oracle Alert performs once for each exception found by the alert

    select statement.

    1. Define an alert

    2. Actions

    Action Details

    12

  • 8/8/2019 Alert SummaryV1

    13/20

    3. Action Sets

    Action Set Details

    13

  • 8/8/2019 Alert SummaryV1

    14/20

    4. Run alert

    Get 3 delivered email individually:

    First email: Organization code GLO is in application.

    Second email:Organization code BGI is in application.

    Third email: Organization code BHM is in application.Return

    14

  • 8/8/2019 Alert SummaryV1

    15/20

    Distribution List

    Create a distribution list, named as TEST DIST LIST.

    When define action details for an alert, you can choose predefined distribution list for

    List field, so that the default recipients can be shown in To field automatically.However, this To field can not be updated any more.

    Return

    15

  • 8/8/2019 Alert SummaryV1

    16/20

    Other Issues

    1. Handle dummy lines

    When defining an alert, in action details, Subject field is necessary. Otherwise, some

    dummy lines will be automatically generated in content.

    Mime-Version: 1.0

    Content-Type: multipart/mixed;

    boundary="----=_Part_77_6009341.1235054529799"

    Content-Language: en

    X-oracle-workflow-nid:

    ------=_Part_77_6009341.1235054529799

    Content-Type: text/plain; charset=ISO-8859-1

    Content-Transfer-Encoding: 7bit

    Content-Language: en

    There are 174 orgs in application.

    ------=_Part_77_6009341.1235054529799--

    Solution: add subject in action details.

    2. Handle Multiple Select Statements

    Sometimes, user may require variable values extracted from independent tables,

    which means multiple select statements need to be run. But alert select statement field

    can only contain ONE select statement. The solution is use of functions to call these

    select statements and then one SQL that calls them all.

    Here is the original requirement:

    I am trying to write one alert that will run the following SQL Statements:

    select count(a.transaction_temp_id) Pending_Material_TXN_Countfrom

    mtl_material_transactions_temp a, org_organization_definitions b

    where b.operating_unit = 948

    anda.organization_id = b.organization_id;

    select count(a.transaction_interface_id) Material_TXN_Interface_Countfrommtl_transactions_interface a, org_organization_definitions b

    16

  • 8/8/2019 Alert SummaryV1

    17/20

    where b.operating_unit = 948

    anda.organization_id = b.organization_id;

    select count(a.transaction_id) WIP_Move_Interface_Countfrom wip_move_txn_interface a,

    org_organization_definitions b

    where b.operating_unit = 948

    anda.organization_id = b.organization_id;

    The Output I am looking for in the email would need to look something like this:

    Brazil Stuck Transactions Needing Cleared Prior to Close

    -------------------------------------------------------------------------------------------------------------------------------------

    There are 'Pending_Material_TXN_Count' transactions stuck in Pending Material Transactions.

    There are 'Material_TXN_Interface_Count' transactions stuck in the Material Transaction Open

    Interface.

    There are 'WIP_Move_Interface_Count' transactions stuck in the Pending WIP Move

    Transactions.

    --------------------------------------------------------------------------------------------------------------------------------------

    Steps:1) Create a function to return a combination character string. This string

    includes all the required info separated by delimiters.

    CREATEORREPLACEFUNCTION Test_Fun

    RETURNVARCHAR2AS

    x_Pending_Material_TXN_Count NUMBER;

    x_Material_TXN_Interface_Count NUMBER;

    x_WIP_Move_Interface_Count NUMBER;

    BEGIN

    selectcount(a.transaction_temp_id) Pending_Material_TXN_Count

    into x_Pending_Material_TXN_Count

    from mtl_material_transactions_temp a,

    org_organization_definitions b

    where b.operating_unit = 948

    and a.organization_id = b.organization_id;

    selectcount(a.transaction_interface_id) Material_TXN_Interface_Count

    into x_Material_TXN_Interface_Count

    from mtl_transactions_interface a,

    17

  • 8/8/2019 Alert SummaryV1

    18/20

    org_organization_definitions b

    where b.operating_unit = 948

    and a.organization_id = b.organization_id;

    selectcount(a.transaction_id) WIP_Move_Interface_Count

    into x_WIP_Move_Interface_Count

    from wip_move_txn_interface a,

    org_organization_definitions b

    where b.operating_unit = 948

    and a.organization_id = b.organization_id;

    RETURN x_Pending_Material_TXN_Count||'|'||x_Material_TXN_Interface_Count|| '|'||

    x_WIP_Move_Interface_Count;

    END;

    2) Call this newly created function in Select Statement field when defining an

    alert.

    Code in Select Statement field (use character functions to get appropriate value.):

    select substr(test_fun,1,instr(test_fun,'|',1,1)-1) a,

    substr(test_fun,instr(test_fun,'|',1,1)+1,

    (instr(test_fun,'|',1,2)-instr(test_fun,'|',1,1)-1)) b,

    substr(test_fun,instr(test_fun,'|',1,2)+1,(length(test_fun)-instr(test_fun,'|',1,2))) c

    18

  • 8/8/2019 Alert SummaryV1

    19/20

    into&Pending_Material_TXN_Count,

    &Material_TXN_Interface_Count,

    &WIP_Move_Interface_Count

    from dual

    3) Action Details, write mail content in Text field.

    4) Add this action to action sets, then run alert.

    Delivered email:

    Brazil Stuck Transactions Needing Cleared Prior to Close

    -----------------------------------------------------------

    There are 4 transactions stuck in Pending Material Transactions.

    There are 0 transactions stuck in the Material Transaction Open Interface.

    There are 0 transactions stuck in the Pending WIP Move Transactions.

    -----------------------------------------------------------

    Return

    19

  • 8/8/2019 Alert SummaryV1

    20/20

    Adjust Layout for Notification Mail

    If its hard to control the layout in notification mail directly,

    try concatenate all columns in one, and use LPAD, RPAD, etc to add/remove space

    WordPad Docume

    Return


Recommended