smartplant materials - hyundai engineeringspmat.hec.co.kr/marian_webentry/pdfs/sto-mail.pdfincluding...

Click here to load reader

Post on 13-Jun-2018

237 views

Category:

Documents

5 download

Embed Size (px)

TRANSCRIPT

  • SmartPlant Materials Mailing Features/Early Warning Alerts

    Version 2011 (7.0.0) June 2010 DMAR1-PE-200040G

  • Copyright Copyright 2003-2010 Intergraph Corporation. All Rights Reserved.

    Including software, file formats, and audiovisual displays; may be used pursuant to applicable software license agreement; contains confidential and proprietary information of Intergraph and/or third parties which is protected by copyright law, trade secret law, and international treaty, and may not be provided or otherwise made available without proper authorization.

    Restricted Rights Legend Use, duplication, or disclosure by the government is subject to restrictions as set forth below. For civilian agencies: This was developed at private expense and is restricted computer software submitted with restricted rights in accordance with subparagraphs (a) through (d) of the Commercial Computer Software - Restricted Rights clause at 52.227-19 of the Federal Acquisition Regulations (FAR) and its successors, and is unpublished and all rights are reserved under the copyright laws of the United States. For units of the Department of Defense (DoD): This is commercial computer software as defined at DFARS 252.227-7014 and the rights of the Government are as specified at DFARS 227.7202-3. Unpublished rights reserved under the copyright laws of the United States. Intergraph Corporation Huntsville, Alabama 35894-0001

    Warranties and Liabilities All warranties given by Intergraph Corporation about equipment or software are set forth in your purchase contract, and nothing stated in, or implied by, this document or its contents shall be considered or deemed a modification or amendment of such warranties. Intergraph believes the information in this publication is accurate as of its publication date.

    The information and the software discussed in this document are subject to change without notice and are subject to applicable technical product descriptions. Intergraph Corporation is not responsible for any error that may appear in this document.

    The software discussed in this document is furnished under a license and may be used or copied only in accordance with the terms of this license.

    No responsibility is assumed by Intergraph for the use or reliability of software on equipment that is not supplied by Intergraph or its affiliated companies. THE USER OF THE SOFTWARE IS EXPECTED TO MAKE THE FINAL EVALUATION AS TO THE USEFULNESS OF THE SOFTWARE IN HIS OWN ENVIRONMENT.

    Trademarks Intergraph, the Intergraph logo, SmartSketch, FrameWorks, SmartPlant, INtools, MARIAN, PDS, and IntelliShip are registered trademarks of Intergraph Corporation. Microsoft and Windows are registered trademarks of Microsoft Corporation. Other brands and product names are trademarks of their respective owners.

  • Table of Contents

    SmartPlant Materials Mailing Features/Early Warning Alerts 3

    Table of Contents Introduction ........................................................................................................................17H4

    1HJava Setup for Generating E-Mails .................................................................................. 18H5

    2HDBA Settings (A.60.04) ......................................................................................................19H73HBasic Settings (E-Mail Generation) ..............................................................................20H74HAdditional Settings (Custom E-Mail for Requisitions) ................................................21H8

    5HCustom E-Mail for Requisitions ....................................................................................... 22H96HSetting Up Custom E-Mail for Requisitions ...............................................................23H107HGenerating and Sending E-Mail .................................................................................24H20

    8HEarly Warning Alerts ...................................................................................................... 25H229HCreating an Early Warning Query (EWQ) ................................................................. 26H2210HExample of an Early Warning Notification ................................................................27H2511HDefining a User-Specific Query .................................................................................28H2612HAssigning Alerts to a Role ..........................................................................................29H2713HEarly Warning Setup ...................................................................................................30H2814HEarly Warning Alerts ..................................................................................................31H2915HAutomatic Querying Logic ......................................................................................... 32H30

    16HIndex ..................................................................................................................................33H31

  • Introduction

    4 SmartPlant Materials Mailing Features/Early Warning Alerts

    Introduction Across the workflows managed by SmartPlant Materials, a wide variety of e-mails are generated, ranging from purely informative e-mails to requests for approval (of engineering requisitions, inquiries, and so forth) containing a link that leads the recipient to a special web page allowing for comfortable and secure approval without the need to start a SmartPlant Materials session and navigate to the appropriate screens. The e-mails may contain attachments that can optionally be zipped. Depending on the category of an e-mail, it is even possible to customize the e-mail contents, as described later on in this document for the Custom E-Mail for Requisitions feature.

    Whatever the layout and purpose of an e-mail generated by the system, there are some common prerequisites with respect to installation and configuration that have to be met. This document is intended to describe these prerequisites prior to explaining the usage of some special features such as Custom E-Mail for Requisition or Early Warning Queries.

    The functionality that allows you to send e-mails is available in the web environment only.

  • Java Setup for Generating E-Mails

    SmartPlant Materials Mailing Features/Early Warning Alerts 5

    Java Setup for Generating E-Mails In addition to standard Java setup, during installation the following steps must be completed in order to enable e-mail generation by SmartPlant Materials.

    Installation of the required classes and other Java settings to enable proper mailing functionality.

    From a client that has Oracle 10g installed and where loadjava.bat is located, copy the following delivered files to a directory listed in the path or into the same directory where loadjava.bat resides: Java archives:

    o activation.jar o mail.jar

    Java classes: o Client.class o Email.class o Email2.class o Fetch_Email.class o Log.class o MailMessage.class o MarianDBConnect.class o MarianProp.class o MarianPropException.class o Pop3Client.class o Pop3Exception.class o QuoteSummary.class o QuoteSummaryException.class o SMTPClient.class o UeException.class o UsedEmail.class

    In command line mode, issue loadjava -user m_sys/[email protected] -resolve -synonym jarfile

    for each Java archive named above (replace jarfile with the file name of the Java archive) and

    loadjava -user m_sys/[email protected] -resolve classfile -force -verbose

  • Java Setup for Generating E-Mails

    6 SmartPlant Materials Mailing Features/Early Warning Alerts

    for each of the Java classes listed before (replace classfile with the file name of the Java class). For both commands, replace db with the name of your database, and pw with the password of user M_SYS on that database.

    In SQL*Plus, as SYS or system: Allow accessing properties by issuing

    exec dbms_java.grant_permission('M_SYS', 'java.util.PropertyPermission', '*', 'read, write');

    Allow access to sockets by issuing exec dbms_java.grant_permission('M_SYS', 'java.net.SocketPermission', '*', 'connect, resolve');

    Allow access to local files as necessary. With respect to the generation of e-mails, read/write access is required for the contents of the directory denoted by DBA setting LOG_FILE_DEST see section DBA Settings (A.60.04) for details. For example, say your database server is a Windows machine and your LOG_FILE_DEST is set to D:\oradata\mydb\utl. In this case, you will have to issue:

    exec dbms_java.grant_permission('M_SYS', 'java.io.FilePermission', 'D:\oradata\mydb\utl\*', 'read, write, delete');

    in order to make the contents of that directory accessible to Java. Or, if your database server is a Unix machine with LOG_FILE_DEST pointing to /oradata/mydb/utl, the appropriate command is:

    exec dbms_java.grant_permission('M_SYS', 'java.io.FilePermission', '/oradata/mydb/utl/*', 'read, write, delete');

    (The same applies to granting Java access to local files for PDB, for example, with respect to DBA setting PDB_REPORT_DEST_DB.) Be sure to modify path names appropriately so that they match your directories.

  • DBA Settings (A.60.04)

    SmartPlant Materials Mailing Features/Early Warning Alerts 7

    DBA Settings (A.60.04) This section describes DBA settings relevant for mailing-related functionalities in SmartPlant Materials. Use the A.60.04 DBA Settings screen (shown below) for assigning appropriate values to these settings.

    Basic Settings (E-Mail Generation) In order to enable SmartPlant Materials to send e-mails, you need to define appropriate values for the following DBA settings:

    LOG_FILE_DEST The log file destination, almost always identical to the UTL_FILE_DIR parameter. In SQL*Plus, as SYS, you can issue the command

    show parameter utl to retrieve the value of this parameter.

    EMAIL_ACCOUNT The e-mail account within the companys mail system to be used by SmartPlant Materials.

    LOG_EMAIL_HANDLING Valid values are Y (yes) and N (no). If set to Y, communication with the mail server is protocolled in a log file for debugging purposes. Please note that there are cases in which e-mails are generated where the Y value if assigned to this DBA setting is ignored.

  • DBA Settings (A.60.04)

    8 SmartPlant Materials Mailing Features/Early Warning Alerts

    SMTP_CLIENT The name (or IP address) of the SMTP client (that is, the database server).

    SMTP_HOST The SMTP server (IP address or alias).

    SMTP_PORT The SMTP port number.

    Additional Settings (Custom E-Mail for Requisitions)

    For the Custom E-Mail for Requisitions functionality, you need to enter appropriate values for the following DBA settings in addition to those listed in the previous section: PDB_REPORT_DEST Directory for upload of PDB report.

    PDB_REPORT_DEST_DB Directory for PDB report on the database server.

    PDB_REPORT_URL Virtual dir for PDB report file in the web environment.

    REPORT_SERVER Report server name.

  • Custom E-Mail for Requisitions

    SmartPlant Materials Mailing Features/Early Warning Alerts 9

    Custom E-Mail for Requisitions SmartPlant Materials allows you to set up custom e-mail for requisitions. To summarize the procedure:

    On A.10.51, create an e-mail template for the custom e-mail for requisition feature.

    Create distribution categories with sets of mail recipients on A.10.52 Distribution Categories.

    On A.10.53, create e-mail template sets by assigning the distribution category to the appropriate e-mail templates for custom e-mail for requisitions.

    Enter the e-mail template set on R.10.41 Requisition Nodes and Templates.

    On R.30.01, enter the e-mail template set that contains the e-mail templates for custom e-mail of requisitions. During the release-to-procurement process, e-mail is generated according to your selected settings.

    Send a test e-mail to one entered address on R.30.13 Send Test Email. The e-mail is generated according to your selected settings. This screen is only available in fastcall of R.30.01.

    To work with the Custom E-Mail for Requisition feature, you must use only e-mail templates with the base structure described in the following section. This functionality will not work with templates using any other structure.

  • Custom E-Mail for Requisitions

    10 SmartPlant Materials Mailing Features/Early Warning Alerts

    Setting Up Custom E-Mail for Requisitions Use the following procedure to set up one of the variants of custom e-mail for requisitions in SmartPlant Materials. Step 1 Variant 1: On A.10.51, create an e-mail template for the custom e-mail for requisition feature. This e-mail template must have a predefined base structure for this feature to work properly. This base structure is shown below.

    To create an e-mail template with the appropriate structure, create a new template and choose the Requisition option in the Templates Type field. This structure will create an empty e-mail body. To fill the body with text, use free text or the parameters in the sections. To ensure that the template was created properly, click the Compile button. If the new template was created properly, the following message appears:

    Otherwise, you will receive detailed error messages.

  • Custom E-Mail for Requisitions

    SmartPlant Materials Mailing Features/Early Warning Alerts 11

    Optional Settings In addition to the mandatory settings of the e-mail template, you can add optional settings. These settings are parameters and free text. Free text can be used everywhere in the template. Parameters can be used only between Req_Begin and Req_End, and they must be written in the following form:

    #name of parameter# The parameters are bound to sections. These sections are defined below:

    Master_Section: between Req_Begin and Req_End and outside the other sections

    Req_Doc_Section: between Req_Docs_Begin and Req_Docs_End Req_VDR_Section: between Req_VDR_Begin and Req_VDR_End Req_Line_Section: between Req_Line_Begin and Req_Line_End Req_Line Doc_Section: between Req_Line_Docs_Begin and

    Req_Line_Docs_End Req_Line_VDR_Section: between Req_Line_VDR_Begin and

    Req_Line_VDR_End Every section can contain 32 KB of data. This information is important to keep in mind because during the release-to-procurement process, these sections will be filled with the referenced data. An error occurs when more than 32 KB of data is placed in a section. This situation is discussed later in this guide.

    To customize the e-mail template subject, use the parameters for the Master_Section. Parameters of other sections cannot be used in the e-mail subject.

    The following parameters are allowed.

    Master_Section and the e-mail subject: #PROJ_ID#, #R_CODE#, #R_SUPP#, #MR_REVISION#, #sr_revision#, #SHORT_DESC#, #DESCRIPTION#, #REL_TO_PROC_DATE#

    Req_Doc_Section: #REQ_DOCS_ATTD_ID#, #REQ_DOCS_PROJ_ID#, #REQ_DOCS_PK_TYPE#, #REQ_DOCS_PK_ID#, #REQ_DOCS_DOCU_ID#, #REQ_DOCS_DOCU_CODE#

  • Custom E-Mail for Requisitions

    12 SmartPlant Materials Mailing Features/Early Warning Alerts

    Req_VDR_Section: #REQ_VDR_ATTV_ID#, #REQ_VDR_PROJ_ID#, #REQ_VDR_PK_TYPE#, #REQ_VDR_PK_ID#, #REQ_VDR_VDR_CODE#, #REQ_VDR_COMMENT# #REQ_VDR_SCHEDULE_WEEKS#, #REQ_VDR_PROMISE_WEEKS#, #REQ_VDR_PRIORITY#, #REQ_VDR_PROM_DELV_DATE#, #REQ_VDR_REV_DELV_DATE#, #REQ_VDR_DELIVERY_DATE#, #REQ_VDR_RECEIVED_BY#, #REQ_VDR_DISTRIB_ID#, #REQ_VDR_DISTRIB_CATEGORY#, #REQ_VDR_REQUIRED_IND#, #REQ_VDR_FIRST_ISSUE#, #REQ_VDR_PERIOD#, #REQ_VDR_EVENT#, #REQ_VDR_PURPOSE#, #REQ_VDR_FINAL_ISSUE#

    Req_Line_Section: #REQ_LINE_RLI_POS#, #REQ_LINE_RLI_SUB_POS#, #REQ_LINE_CURRENCY_CODE#, #REQ_LINE_BUDGET#, #REQ_LINE_TOTAL_RELEASE_QTY#, #REQ_LINE_TOTAL_LIST_QTY#, #REQ_LINE_RECOMMEND_QTY#, #REQ_LINE_INCREASED_QTY#, #REQ_LINE_RLI_UNIT_WEIGHT#, #REQ_LINE_RLI_WEIGHT_UNIT#, #REQ_LINE_TAG_NUMBER#, #REQ_LINE_IDENT_CODE#, #REQ_LINE_QTY_UNIT_CODE#, #REQ_LINE_ITY_CODE#, #REQ_LINE_DD_CODE#, #REQ_LINE_ESTIMATED_ROS_DATE#, #REQ_LINE_PROCURE_CHANNEL#, #REQ_LINE_INQ_ORDER_SEQ#, #REQ_LINE_PROC_ORDER_SEQ#

    Req_Line_Doc_Section: #REQ_LINE_DOC_RLI_ID#, #REQ_LINE_DOC_RLI_CODE#,

  • Custom E-Mail for Requisitions

    SmartPlant Materials Mailing Features/Early Warning Alerts 13

    #REQ_LINE_DOC_ATTD_ID#, #REQ_LINE_DOC_PROJ_ID#, #REQ_LINE_DOC_PK_TYPE#, #REQ_LINE_DOC_PK_ID#, #REQ_LINE_DOC_DOCU_ID#, #REQ_LINE_DOC_DOCU_CODE#

    Req_Line_VDR_Section: #REQ_LINE_VDR_RLI_ID#, #REQ_LINE_VDR_RLI_CODE#, #REQ_LINE_VDR_ATTV_ID#, #REQ_LINE_VDR_PROJ_ID#, #REQ_LINE_VDR_PK_TYPE#, #REQ_LINE_VDR_PK_ID#, #REQ_LINE_VDR_VDR_CODE#, #REQ_LINE_VDR_COMMENT# #REQ_LINE_VDR_SCHEDULE_WEEKS#, #REQ_LINE_VDR_PROMISE_WEEKS#, #REQ_LINE_VDR_PRIORITY#, #REQ_LINE_VDR_PROM_DELV_DATE#, #REQ_LINE_VDR_REV_DELV_DATE#, #REQ_LINE_VDR_DELIVERY_DATE#, #REQ_LINE_VDR_RECEIVED_BY#, #REQ_LINE_VDR_DISTRIB_ID#, #REQ_LINE_VDR_DISTRIBUTION_CATEGORY#, #REQ_LINE_VDR_REQUIRED_IND#, #REQ_LINE_VDR_FIRST_ISSUE#, #REQ_LINE_VDR_PERIOD#, #REQ_LINE_VDR_EVENT#, #REQ_LINE_VDR_PURPOSE#, #REQ_LINE_VDR_FINAL_ISSUE#

    If a parameter is placed in the wrong section, an error message appears

    when you click the Compile button. This error message indicates exactly which parameter is in the wrong section.

    An error message also occurs if a parameter is used more than once.

  • Custom E-Mail for Requisitions

    14 SmartPlant Materials Mailing Features/Early Warning Alerts

    Below is an example of a properly configured template:

  • Custom E-Mail for Requisitions

    SmartPlant Materials Mailing Features/Early Warning Alerts 15

    Variant 2: On A.10.51, create an e-mail template for the custom e-mail for requisition feature. This e-mail template works with keywords and must have a predefined base structure for this feature to work properly. Verify that the ZIP Attachments check box is marked. This base structure is shown below.

    E-mail body creation:

    Define a function in M_PCK_EMAIL_CUSTOM to fill the e-mail body. An example function, called EMAIL_EXAMPLE, is available.

    The function must have exactly these parameters and always return a number value:

    FUNCTION email_example

    ( p_r_id IN m_reqs.r_id%TYPE,

    p_emt_id IN M_EMAIL_TEMPLATES.EMT_ID%TYPE,

    p_test IN VARCHAR2 DEFAULT 'N',

    p_email IN VARCHAR2 DEFAULT 'N',

    p_zip IN VARCHAR2 DEFAULT 'N')

    RETURN NUMBER;

  • Custom E-Mail for Requisitions

    16 SmartPlant Materials Mailing Features/Early Warning Alerts

    Some parts of the code can be modified; others must be available in your own created functions. The code that is required for all functions to fill e-mail bodies is commented in the example function M_PCK_EMAIL_CUSTOM.email_example.

    To use this defined function in an e-mail body, you must enter the keyword EMAIL=M_PCK_EMAIL_CUSTOM.your_function; . You must type it in uppercase, and it must end with a semicolon (;).

    If you have marked the ZIP Attachments indicator, then you can insert the keywords with all available defined functions via LOV.

    Attachment creation:

    To attach files to an e-mail, you can create your own reports. These reports must be available in your report directory.

    Define a function in M_PCK_EMAIL_CUSTOM to return the report name of that report you want to use to create the attachments. Four example functions, called REPORT_EXAMPLE REPORT_EXAMPLE4, are available.

    The function must have exactly these parameters and always return a VARCAHR2 value:

    FUNCTION report_example

    ( p_r_id IN m_reqs.r_id%TYPE)

    RETURN VARCHAR2;

    To use this defined function in an e-mail body, you must enter the keyword REPORT=M_PCK_EMAIL_CUSTOM.your_function; . You must type it in uppercase, and it must end with a semicolon (;).

    If you have marked the ZIP Attachments indicator, you can insert the keywords with all available defined functions via LOV.

  • Custom E-Mail for Requisitions

    SmartPlant Materials Mailing Features/Early Warning Alerts 17

    Step 2 Create distribution categories with sets of e-mail recipients on A.10.52 Distribution Categories.

    The ZIP Attachments indicator specifies if the attachments of an e-mail will be zipped or not.

  • Custom E-Mail for Requisitions

    18 SmartPlant Materials Mailing Features/Early Warning Alerts

    Step 3 On A.10.53, create e-mail template sets by assigning the distribution category to the appropriate e-mail templates for the custom e-mail for requisition.

  • Custom E-Mail for Requisitions

    SmartPlant Materials Mailing Features/Early Warning Alerts 19

    Step 4 Enter the e-mail template set on R.10.41 Requisition Nodes and Templates.

  • Custom E-Mail for Requisitions

    20 SmartPlant Materials Mailing Features/Early Warning Alerts

    Generating and Sending E-Mail On R.30.01, enter the e-mail template set that contains the e-mail templates for the custom e-mail for requisitions.

    During the release-to-procurement process, e-mail is generated according to your selected settings. If any errors occur, a message warns you that the release-to-procurement process was not successfully completed.

    You can resend these by selecting them on A.60.55 Emails.

    You can send a test e-mail for a requisition. Use fastcall entry R.30.13 Send Test Email on the R.30.01 screen. Enter an e-mail address. With the ZIP Attachments indicator, you can specify if the e-mail attachments will be zipped or not. To send a test e-mail, click the Send button.

  • Custom E-Mail for Requisitions

    SmartPlant Materials Mailing Features/Early Warning Alerts 21

  • Early Warning Alerts

    22 SmartPlant Materials Mailing Features/Early Warning Alerts

    Early Warning Alerts SmartPlant Materials allows you to define queries so that you can check the status of the database and generate e-mail alert messages. For example, you can warn a user if the delivery dates of a purchase order have become critical due to the onset of winter weather that is not allowing a ship to leave the harbor.

    Use the following screens to define and view early warning queries and alerts:

    A.60.10 Early Warning Queries A.60.11 Early Warning Setup A.60.12 Early Warning Alerts A.30.03 Roles/Menus Alerts tab A.60.45 DBMS Jobs

    Creating an Early Warning Query (EWQ) Use A.60.10 Early Warning Queries to define an early warning query. On this screen, you write a query and specify the interval or frequency for it to be run.

    Specify an Alert Code for the query. This code will identify the query and will appear in the subject of the warning e-mail.

    The Interval determines how often the query is run. The query will only be executed if the system date is greater or equal to the last execution date + interval.

  • Early Warning Alerts

    SmartPlant Materials Mailing Features/Early Warning Alerts 23

    The Mail Content determines which information is contained in the generated alert message (ALL, CHANGES, NEW, DELETED). This content is related to the previous generated alerts.

    The Last Execution field contains the date and time of the last run of this query.

    The Active check box turns the Early Warning Query feature on and off.

    The eMail check box turns the sending of email containing the alert information on and off.

    By default, the One mail per record checkbox is unchecked, which means that the user related to this query will receive one e-mail for every new record selected by the query statement. If this option is checked, only one e-mail containing all records will be sent to the user.

    The Generate Link check box activates the sending of an email containing the URL for the macro login. This functionality can only be set for the following Direct Link Forms: P.20.01, R.30.01, P.30.11, P.50.01, and S.50.06.

    The Alert Description field contains a brief explanation or description about the Early Warning Query.

    The Direct Link Form field allows assigning the alert to a specific module. You can choose from the forms contained in the list. If you are specifying a direct link form for a query, you must include the ID column related to that form in your query (see table below for details).

    In the Query Text box, write the SELECT statement or PL/SQL Block used to perform the query. Write the statement in PL/SQL-Syntax. Do not use semi-colons (;). For example: SELECT count(*) FROM m_users.

    The Parse Query button checks the consistency of the query text. If the statement is valid, you will receive the Statement successfully compiled message. Otherwise, you will receive the Statement compiled with errors message.

    The Validate Settings button checks all settings required for the automatic execution of early warning queries. The result of this check is displayed on the Validation Results window. Please note that all packages and java classes shown in the result list must be in a valid state. These objects are part of the standard installation of SmartPlant Materials. The Scheduled Jobs section displays the jobs that will execute early warning queries. See Automatic Querying Logic below for the definition of a job for early warning queries.

    Enter in the Email Header the text for the subject line of the generated email.

    The Message Returned box is a customized message where the results will be included. This field is very important because it displays the query results and is included in the body of the e-mail message. An example message would look like this: There are at the moment %1 users registered.

    The %1 sign wildcard will be replaced by the return value in the statement.

  • Early Warning Alerts

    24 SmartPlant Materials Mailing Features/Early Warning Alerts

    Required columns for direct link form Direct Link Form Required ID column

    C200102 MRR_ID

    C2001 LOC_ID

    P2001 SUP_ID

    P3011 INQ_ID

    P5001 POH_ID

    P6003 ECI_ID

    R3001 R_ID

    S5006 SPEC_HEADER_ID

    SM2001 POH_ID

    SM2011 POH_ID

    SM3001 SFI_ID/SFN_ID

    SM3002 CSR_ID

    SM3003 CSL_ID

    SM3004 ITW_ID

    SM3005 POH_ID

    SM3006 TPW_ID

    SM3007 NCR_ID

    SM3008 IW_ID

    SM3009 NTC_ID

    SM4001 PCO_ID

    SM4002 CNR_ID

    SM4003 FWD_ID

    SM4004 CNR_ID

    SM4005 BN_ID

  • Early Warning Alerts

    SmartPlant Materials Mailing Features/Early Warning Alerts 25

    Example of an Early Warning Notification This example shows an Alert Code named NEW_RIGHTS that is run daily to send a notification to list users with new privileges. The message contains wildcards for the users first and last names, as well as the new privileges. The e-mail subject will have NEW_RIGHTS in the title. The e-mail message in the body will contain the Message Returned text and the SQL results.

    Query Code entered on A.60.10 is included in the message subject:

    MARIAN EWQ: NEW_RIGHTS

    Message Returned text entered on A.60.10:

    The user %2 %3 has recently gained %1 rights

    Query Text SQL statement entered on A.60.10:

    SELECT pr.priv_code,

    us.first_name,

    us.last_name

    FROM m_users us, m_us_privs up, m_privs pr

    WHERE us.us_id = up.us_id

    AND pr.priv_id = up.priv_id

    Message Returned in e-mail body:

    The user John Smith has recently gained EXPEDITER rights

    You can place the SQL results anywhere in the phrase, as long as you use the correct order number. In the SQL statement example, %1, %2, and %3 are priv_code, first_name, and last_name, respectively.

  • Early Warning Alerts

    26 SmartPlant Materials Mailing Features/Early Warning Alerts

    Defining a User-Specific Query You can use the function m_pck_ewn.usr_id in your query to create a user-specific alert. It can be used for any column that corresponds to the User field from A.20.05 User. When the alerts are processed, the current alert user for whom the alert is generated will be delivered by this function.

    The value of this function is not defined outside of the alert processing.

    Example for the Query Text of a user-specific query:

    select i.inq_code, i.i_supp, inqn.short_desc, i.bid_req_return_date, i.inq_id

    from m_inquiries i,

    m_inquiry_nls inqn

    where i.inq_id = inqn.inq_id

    and inqn.nls_id = 1

    and issue_date is not null

    and po_buyer = m_pck_ewn.usr_id

    and proj_id = 'XYZ'

    order by 1,2

  • Early Warning Alerts

    SmartPlant Materials Mailing Features/Early Warning Alerts 27

    Assigning Alerts to a Role On A.30.03 Roles/Menus, you can assign alerts to roles on the Alerts tab.

    Assigning an alert to a role will automatically assign the alert to all users assigned to the role. A user can check on the A.60.11 screen.

  • Early Warning Alerts

    28 SmartPlant Materials Mailing Features/Early Warning Alerts

    Early Warning Setup There are two possibilities to link users with early warning queries.

    Assigning Users to an Early Warning Query (EWQ) Use the A.60.11 Early Warning Setup screen (Alerts with Users tab) to assign users to an early warning query. All users assigned to the query will receive the same message. You can use the LOV button to select a valid user. Only users with a valid e-mail address can be selected. Use the Active check box to exclude users.

    On this tab, you can also execute the query immediately by clicking the Start Alert button. This query will generate the messages on the A.60.12 screen and send the messages to the users by e-mail.

    Selecting Alerts defined by Role On the second window, alerts assigned to a role are shown for each user. Depending on the privilege SHOW ALL ALERTS, you will see either alerts for all roles and users or only the alerts assigned to your current login role. You can deselect alerts by unchecking the Active check box.

  • Early Warning Alerts

    SmartPlant Materials Mailing Features/Early Warning Alerts 29

    Early Warning Alerts The A.60.12 Early Warning Alerts screen displays alerts generated on A.60.11 with the Start Query button and those using the automatic job execution defined on A.60.45. The alert messages are sorted by user and query code name.

    Depending on the privilege SHOW ALL ALERTS, you will see either alert messages for all users or only the alerts assigned to your current login role. For alerts defined on A.60.10 with a direct link form, the Call button allows you to directly call the linked form with the corresponding record.

    There is now the option to open A.60.12 not only from the menu, but also by clicking

    the alert button on the menu screen. This button will only be active if there are current alert messages existing for the current login (user/role). If A.60.12 is called using this button, then alert messages are queried automatically.

  • Early Warning Alerts

    30 SmartPlant Materials Mailing Features/Early Warning Alerts

    Automatic Querying Logic To use the automatic execution of early warning queries, you must define a job on the A.60.45 screen. The value chosen for the interval should be less than or equal to the interval chosen on A.60.10. In the Executed PU field, enter the following statement:

    BEGIN m_pck_ewn.process_warnings; END;

    Then click the Install button to activate the job for scheduled execution.

    The system will then execute the query and send the results to users registered as receivers after each interval.

    On the A.60.10 screen, you use the One mail per record check box to define how the messages will be sent.

    If the One mail per record check box is checked, on the first execution, an e-mail for each record returned is sent to the users. On the second execution, the system checks the previous e-mail and records that match are not sent again. So, when you register and execute a query for a list of users, for example, at the first execution you receive a list of all users. From the second execution on, the system sends you a message only when a new user is added.

    If the One mail per record check box is not checked, on the first execution the user receives only one e-mail containing all selected records. On a second execution, the software checks the previous e-mail. If a record has been added, a new e-mail is sent that contains all selected records, including the old ones.

  • Index

    SmartPlant Materials Mailing Features/Early Warning Alerts 31

    Index

    automatic querying logic, 30 early warning queries (EWQs)

    creating queries, 22 example, 25 One mail per record, 30 query logic, 30

    Oracle setup, 5 required classes setup, 5 requisition e-mail

    optional settings, 11 summary steps, 9 template, 9, 10, 15 template sets, 9, 18

    requisition e-mail optional settings Master_Section, 11 Req_Doc_Section, 11 Req_Line_Doc_Section, 12 Req_Line_Section, 12 Req_Line_VDR_Section, 13 Req_VDR_Section, 12

    setup Oracle setup, 5 required classes, 5 SQL*Plus, 6

    sockets setup, 6 SQL*Plus setup, 6

    IntroductionJava Setup for Generating E-MailsDBA Settings (A.60.04)Basic Settings (E-Mail Generation)Additional Settings (Custom E-Mail for Requisitions)

    Custom E-Mail for RequisitionsSetting Up Custom E-Mail for RequisitionsGenerating and Sending EMail

    Early Warning AlertsCreating an Early Warning Query (EWQ)Example of an Early Warning NotificationDefining a User-Specific QueryAssigning Alerts to a RoleEarly Warning SetupAssigning Users to an Early Warning Query (EWQ)Selecting Alerts defined by Role

    Early Warning AlertsAutomatic Querying Logic

    Index