FYI or Response Required notifications – Follow up

October 27th, 2008 Matt

This is a quick follow up to a comment posted on the original thread – I had a discussion with some people about the post, and was asked the following (hence the new post):  “Can we use wma.name = ‘RESULT’ instead of wma.subtype=’RESPOND’ as each message that requires a RESPONSE action will have RESULT attribute?”.  Here’s my response:


Not every message that requires a response will have a RESULT attribute, though. The RESULT attribute only applies to notifications which have conditional branching based on a result applied to them.

If you have no result type, but have respond attributes, then the notification still requires a response but does not have a result.

Have a look at this test flow for an example. Launching the flow and then selecting from the WF_NOTIFICATION_ATTRIBUTES table returns one row for the attribute IA1 – there is no RESULT attribute since the notification does not have a result.

Here’s the output:

**** Notifications

NID   Context         Status
----- --------------- --------
40899 NEW_TYP4:1:1692 OPEN

SELECT notification_id, NAME
FROM   wf_notification_attributes
WHERE  notification_id = 40899
/

NOTIFICATION_ID NAME
--------------- ----
          40899 IA1

So, although the notification requires a response, there is no RESULT attribute, and it’s certainly not uncommon to have notifications and messages defined in this way – if the requirement is to capture a response, but not to branch conditionally depending on the result, this is the way to build the Workflow.

Matt

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

Posted in Oracle, Technical | No Comments »

FYI or Response Required notifications

October 24th, 2008 Matt

A thread on Metalink some time back asked how to tell whether a notification requires a response or not, and I’ve just found some notes that I took on the subject at the time. [For those without Metalink access, the exact question is "How do I know from the backend what notifications require action and what notifications and just FYI"].

The first thing I thought about the question was “what does it actually ask?” There are two possible things that the person posing the question might be after. Either they want to know what MESSAGES are defined in the system, and do they require a response or not; or they are looking at NOTIFICATIONS that have been sent to users to see whether they require a response. Accordingly, there are two different answers, since the source of the data is completely different.

Let’s take the first possible questions – what messages are there in the system, and do they require a response of not? The key thing in either of the situations is whether the notification has any attributes which require a response or not – in which case the table that needs to be accessed is WF_MESSAGE_ATTRIBUTES which stores all of this information. In order to make the information more understandable, I would also extend the query to look at the WF_ITEM_TYPES_TL and WF_MESSAGES_TL tables, which provide the display name for each of the internal names (message and item type), which makes it much easier to understand which message and item type you are dealing with.

Firstly, retrieve all the messages from the system which have a message attribute which is does not have a type of RESPOND, but which also do not have any RESPOND attributes. This takes care of any messages which have multiple attributes, and at least one of them is a response attribute. Secondly, we need to include any of the messages which have RESPOND attributes, and union the result sets together. I have written the two SELECT statements as a sub-query in my example, so that it is then much easier to sort by whatever order you require. Here’s the code:

SELECT *
FROM   ( SELECT DISTINCT 'FYI'          action
         ,      wfi.display_name        item_type
         ,      wfma.message_type       item_type_internal
         ,      wfmt.display_name       message_name
         ,      wfma.message_name       message_internal
         FROM   wf_message_attributes   wfma
         ,      wf_item_types_tl        wfi
         ,      wf_messages_tl          wfmt
         WHERE  wfma.SUBTYPE     != 'RESPOND'
         AND    wfma.message_type = wfi.name
         AND    wfma.message_type = wfmt.type
         AND    wfma.message_name = wfmt.name
         AND    (wfma.message_type, wfma.message_name) NOT IN ( SELECT DISTINCT wfma2.message_type
                                                                ,      wfma2.message_name
                                                                FROM   wf_message_attributes   wfma2
                                                                WHERE  wfma2.SUBTYPE      = 'RESPOND'
                                                              )
         UNION
         SELECT DISTINCT 'Response Required'
         ,      wfi.display_name        item_type
         ,      wfma.message_type       item_type_internal
         ,      wfmt.display_name       message_name
         ,      wfma.message_name       message_internal
         FROM   wf_message_attributes   wfma
         ,      wf_item_types_tl        wfi
         ,      wf_messages_tl          wfmt
         WHERE  wfma.SUBTYPE     = 'RESPOND'
         AND    wfma.message_type = wfi.name
         AND    wfma.message_type = wfmt.type
         AND    wfma.message_name = wfmt.name
       ) messages
ORDER BY item_type_internal, message_internal

The second question requires us to expand the query a bit further – we now need to include the notifications that are open in the system, so include WF_NOTIFICATIONS in the query as well. Apart from the join between this table and the others, the only other change that I have made to the query is to include the notification_id in the query as well. Here’s the code for the second query:

SELECT *
FROM   ( SELECT DISTINCT 'FYI'           action
         ,      wfi.display_name         item_type
         ,      wfn.message_type         item_type_internal
         ,      wfmt.display_name        message_name
         ,      wfn.message_name         message_internal
         ,      wfn.notification_id
         FROM   wf_notifications        wfn
         ,      wf_message_attributes   wfma
         ,      wf_item_types_tl        wfi
         ,      wf_messages_tl          wfmt
         WHERE  wfn.message_type  = wfma.message_type
         AND    wfn.message_name  = wfma.message_name
         AND    wfma.message_type = wfi.name
         AND    wfma.SUBTYPE     != 'RESPOND'
         AND    wfma.message_type = wfmt.type
         AND    wfma.message_name = wfmt.name
         AND    (wfn.message_type, wfn.message_name) NOT IN ( SELECT DISTINCT wfn2.message_type
                                                            ,      wfn2.message_name
                                                            FROM   wf_notifications        wfn2
                                                            ,      wf_message_attributes   wfma2
                                                            WHERE  wfn2.message_type  = wfma2.message_type
                                                            AND    wfn2.message_name  = wfma2.message_name
                                                            AND    wfma2.SUBTYPE      = 'RESPOND' )
         UNION
         SELECT DISTINCT 'Response Required'
         ,      wfi.display_name         item_type
         ,      wfn.message_type         item_type_internal
         ,      wfmt.display_name        message_name
         ,      wfn.message_name         message_internal
         ,      wfn.notification_id
         FROM   wf_notifications        wfn
         ,      wf_message_attributes   wfma
         ,      wf_item_types_tl        wfi
         ,      wf_messages_tl          wfmt
         WHERE  wfn.message_type  = wfma.message_type
         AND    wfn.message_name  = wfma.message_name
         AND    wfma.message_type = wfi.name
         AND    wfma.SUBTYPE      = 'RESPOND'
         AND    wfma.message_type = wfmt.type
         AND    wfma.message_name = wfmt.name
       ) notifications
ORDER BY item_type_internal

Hopefully that all answers the question – how do I know what notifications require a response and which do not? It also answers the unwitting question – how do I know what messages require a response and which do not?

As ever, comments more than welcome!

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

Posted in Oracle, Technical | No Comments »

Bulk updating workflow users

October 17th, 2008 Matt

Recently, there was a question asked on Metalink about how to update a large number of user preferences in one easy step. The original question was to see how to turn off the email preference for users, in an environment that had been cloned from production.

There are a couple of ways that you could do this, but my preferred way is through the WF_DIRECTORY APIs – I’m currently working with TCA a lot, and so the importance of using the supplied APIs is really being hammered home!

I’ve attached a script which loops through the records in the WF_USERS table, and updates the notification preference to ‘QUERY’ for all the records it finds – if you want to change different preference settings, then you just plug them into the script. Although the API is designed for use with ad-hoc roles, there is no reason why this does not work with standard roles. I tested it this morning on eBS release 11.5.10.2 on a 10g database running on Linux, and it worked fine for me.

Enjoy!

SQL script

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

Posted in Oracle, Technical | No Comments »

DBMS_OUTPUT Limitations

October 11th, 2008 Matt

I’ve just hit (for the nth time) the limit in DBMS_OUTPUT.PUT_LINE that you can only have 1000000 characters in the output.  I know that that sounds a lot, but if you’re debugging complex workflows (with lots written out to the screen), and processing multiple flows in the same transaction, then this can easily be blown.  I know that in 10g, you can have an unlimited DBMS_OUTPUT buffer, but not everyone is using that version, or even using SQL*Plus.

So I “googled” (yes, it’s a verb!) the error that I was getting thrown, and (as ever) found this thread on AskTom.

Tom has provided a new PL/SQL package which replicates pretty much what DBMS_OUTPUT does by storing it in a PL/SQL table, and then has a view on top of it to retrieve (and delete) the data from the table.  You can then just select from the view to get the output back.

I’ve copied the code into the attached SQL file, just for ease:

DBMS_OUTPUT alternative

Enjoy!

Matt

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

Posted in Oracle, Technical | No Comments »

Who’s logged in?

October 1st, 2008 Matt

I’ve just been asked to come up with a quick script for our DBAs to let them know who has been using the system recently. They want something that they can use to pick up the recent eBS users and their email addresses, so that they can let them know when the system is about to be bounced or shut down.

So, here’s the SQL:

SELECT DISTINCT ppf.full_name
, fu.user_name
, NVL(ppf.email_address,fu.email_address) email_address
FROM per_people_f ppf
, fnd_user fu
, fnd_logins fl
WHERE fl.start_time > SYSDATE - 2
AND fu.user_id = fl.user_id
AND ppf.person_id(+) = fu.employee_id
AND fu.user_name NOT IN ('SYSADMIN', 'GUEST')
/

Note, it will only pick up recent eBS users – it doesn’t look at database users who are logged in, so if there is other access to the system then you need to be aware that this isn’t going to be a definitive list. Good starter for ten though.

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

Posted in Oracle, Technical | No Comments »

  • Pages

    • About Us
    • Services From WorkflowFAQ
    • Training
    • Workflow Book
    • Careers
    • Forum
    • Blog
  • Oracle 11i Workflow Certified Expert
    Oracle 11i System Administrator Certified Expert

  • Blog

    You are currently browsing the WorkflowFAQ weblog archives for October, 2008.

    Archives

    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • October 2009
    • August 2009
    • July 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
  • Categories

    • General Computing (27)
    • Non-Oracle (14)
    • Oracle (49)
      • Functional (6)
      • Technical (44)
    • Personal (2)
    • Uncategorized (1)

  • Links

  • General Computing

    • Computing Magazine
    • Download.com
    • SourceForge.net
    • The Daily WTF
    • The Register
  • Non-Computing

    • BBC News
    • Cuteable
    • My wife’s shop
    • The Guardian
  • Oracle Related

    • AppsDBA
    • Oracle
    • Oracle Apps Blog
    • Oracle Magazine Interactive
    • Oracle Support
    • Oracle Technology Network
    • Oracle UK
    • Oracle Workflow Forum on OTN
    • Oracle WTF
    • OraFAQ
    • Steven Chan
    • Steven Feuerstein

  • Search


  • QR Code Gimmick

    QR Code for http://www.workflowfaq.com/2008/10

WorkflowFAQ is proudly powered by WordPress | Copyright © 2008 TS Fifteen Ltd. All rights reserved.