How to add the Clear action to a message in the MVCM Automation Viewer Priority Area (MVCM MVCA)

Version 2
    Share:|

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    MainView Console Automation for zEnterprise


    APPLIES TO:

    MVCM MVCA MainView Console Management for zEnterprise MainView Console Automation for zEnterprise



    QUESTION:

    How do you add the Clear action to the Right-Click menu for an MVCM Automation Viewer Priority Area message. Also, how do you remove a message from the MVCM Automation Viewer Priority Area?


    ANSWER:

    Create the notifyRdDel RDL2 filter and the clearPAmsg function below. Note: These RDL2 rules are attached to this Knowledge Article in the ZIP file ClearPAMessages.zip. Instructions for importing these rules follow the description of the rules.

    The notifyRdDel filter below moves RED and WHITE console messages to the MVCM Automation Viewer Priority Area. Lines 25 and 26 add an "Actions" menu item to the Right-Click menu in the viewer which will contain a Delete Message item.
     

      User-added image
      
    The   notifyRdDel filter is below: 
       
      //
    // Trigger: notifyRdDel
    //
    // Description:
    //  This function marks all WHITE messages as being permanent
    //  messages. A monitor is established and clearRd is called
    //  when the message scrolls of the screen or changes color.
    //  "Delete Message" option is added to the rule so user can
    //  manually delete it from the priority area pane
    //
    // See Also:
    //  clearRd, clearPAmsg
    //
    // Copyright (c) 2019, BMC Software, Inc.
    //

    trigger on message.COLOR == WHITE || message.COLOR == RED

    markMessagePermanent(message)

    // Add Actions - Delete Message menu item to right-click menu
    // in the MVCA viewer. Delete Message will delete a selected
    // message from the priority area pane

        message.COMMANDS[0].DESCRIPTION = "Delete Message"
        message.COMMANDS[0].FUNCTION = "do clearPAmsg(\"" & message.ID & "\")"

    monitorMessage(message, "clearRd")
      
    Right-clicking on a message in the Priority Area, and selecting Actions - Delete Message will call the clearPAmsg RDL2 function, which will remove the selected message from the MVCM Automation viewers Priority Area. 

    The   clearPAmsg function is below:  
     
      function clearPAmsg(msgid)
    global PERMANENT_MESSAGES
    i = PERMANENT_MESSAGES.size() - 1

    do while i >= 0

        if PERMANENT_MESSAGES[i].ID == msgid then
            clearMessagePermanent(PERMANENT_MESSAGES[i])
            i =  -1
        else
            i = i - 1
        endif
    end
            
    return 0
      
    The result can be seen in the MVCM Automation viewer window below: 
       
      User-added image

     


    Article Number:

    000163833


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles